agentleFS
intersystems-communityintersystems-community/iris-agentic-dev/skills/iris-coverage-setup/SKILL.md

iris-coverage-setup

Skill49 starsChanged 24 days agoMITView on GitHub

Enable the IRIS line-by-line monitor (bbsiz CPF parameter). Run once per container before measuring ObjectScript test coverage. Verifies $zu(84) is functional and diagnoses build incompatibility.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 0 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If it throws <FUNCTION>: this IRIS build does not support $zu(84).

    line 33
  2. Very specific:

    Run in %SYS namespace (or via MCP tool with namespace="%SYS"):

    line 38
  3. Very specific:

    Verify it wrote to iris.cpf:

    line 48
  4. Very specific:

    If Start() returns ERROR #6060: Somebody else is using the Monitor — another process has the monitor.

    line 75
  5. Very specific:

    If n = 0 despite code running — the monitor buffer allocated but $zu(84,0) returns 84 (state value, not error) and no counts were captured.

    line 96
  6. Very specific:

    Only one process can hold the monitor at a time — always Stop() before Start()

    line 104

≈ “Common” is an estimate: at least 1 in 5 of the 383,637 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/iris-coverage-setup — Enable IRIS Line-by-Line Monitor

Configure the IRIS instance so %Monitor.System.LineByLine can collect execution counts. Required before running /iris-coverage-run. Needs an IRIS restart.

Background

%Monitor.System.LineByLine wraps $zu(84,...) kernel calls. The shared memory buffer for line counting is controlled by bbsiz in iris.cpf [config]. It defaults to -1 (disabled). Without it set, Start() appears to succeed but collects nothing.

Build compatibility:

BuildWorks?Notes
AI builds (2026.x.0AI)✓Standard kernel
SQLT.145+ / sqlt146✓Standard kernel
TBLP 127 (2026.3.0TBLP)✗$zu(84) not wired — <FUNCTION> error

Step 1 — Check if monitor is already functional

// In any namespace — if this returns 1, skip to Step 3
write $zu(84,0,1,1,1,1,1,1), !   // returns 1 = OK, throws <FUNCTION> = not available
do $zu(84,0,0)                    // stop/cleanup after check

If it throws <FUNCTION>: this IRIS build does not support $zu(84). Coverage measurement is not possible. Stop here and document the gap.

Step 2 — Set bbsiz and restart

Run in %SYS namespace (or via MCP tool with namespace="%SYS"):

set cfg = ##class(Config.config).Open()
write "Current bbsiz: ", cfg.bbsiz, !   // expect -1
set cfg.bbsiz = 4096                     // 4 MB buffer
set sc = cfg.%Save()
write $system.Status.GetErrorText(sc), !

Verify it wrote to iris.cpf:

grep bbsiz /usr/irissys/iris.cpf   # expect: bbsiz=4096

IMPORTANT: Do NOT add MonitorEnabled=1 to iris.cpf — that key is invalid and crashes IRIS on startup with "Invalid parameter name 'MonitorEnabled'".

Restart IRIS:

docker restart <container-name>

Step 3 — Verify monitor is functional after restart

// Verify $zu(84) subsystem is live
write $zu(84,0,1,1,1,1,1,1), !   // must return 1

// Verify Start/Stop cycle works
set sc = ##class(%Monitor.System.LineByLine).Start($lb("MyClass.1"), "", "")
write $system.Status.GetErrorText(sc), !   // expect empty = OK
do ##class(%Monitor.System.LineByLine).Stop()

If Start() returns ERROR #6060: Somebody else is using the Monitor — another process has the monitor. Stop it:

do ##class(%Monitor.System.LineByLine).Stop()

Step 4 — Verify result query returns data

set sc = ##class(%Monitor.System.LineByLine).Start($lb("MyClass.1"), "", "")
// ... run some code that calls MyClass methods ...
do ##class(%Monitor.System.LineByLine).Stop()

set rset = ##class(%ResultSet).%New("%Monitor.System.LineByLine:Result")
do rset.Execute("MyClass.1")
set n = 0
while rset.Next() { set n = n + 1 }
write "Lines returned: ", n, !   // expect > 0 if MyClass was exercised

If n = 0 despite code running — the monitor buffer allocated but $zu(84,0) returns 84 (state value, not error) and no counts were captured. This indicates the build doesn't fully support in-process line counting even with bbsiz set. Use dpgenai1 or an AI build.

Notes

  • bbsiz is in [config] section, not [Monitor] section (which has no standard parameters)
  • $zu(84,0) returning 84 is NOT an error code — it's the current state bitmask
  • Only one process can hold the monitor at a time — always Stop() before Start()
  • Results must be queried in the same IRIS process that called Stop()
  • INT routine name = ClassName.1 (not .cls, not ClassName.INT)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.