@sabaiway/agent-workflow-kit 23.8.0 → 23.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -0
- package/SKILL.md +1 -1
- package/capability.json +1 -1
- package/package.json +1 -1
- package/references/modes/coverage-check.md +4 -2
- package/references/modes/gates.md +1 -1
- package/references/modes/now.md +1 -1
- package/references/modes/procedures.md +1 -1
- package/references/modes/recommendations.md +2 -2
- package/tools/checker-block/index.mjs +2 -0
- package/tools/checker-block/place.mjs +71 -0
- package/tools/checker-block/tail.mjs +16 -0
- package/tools/coverage-check/block.mjs +75 -0
- package/tools/coverage-check/help.mjs +47 -0
- package/tools/coverage-check/index.mjs +5 -0
- package/tools/coverage-check.mjs +62 -112
- package/tools/coverage-declared/judge.mjs +2 -3
- package/tools/gates-init.mjs +3 -3
- package/tools/now-render.mjs +1 -1
- package/tools/procedures.mjs +5 -11
- package/tools/recommendations.mjs +4 -4
- package/tools/source-size/help.mjs +8 -7
- package/tools/source-size/index.mjs +1 -0
- package/tools/source-size/limits.mjs +8 -2
- package/tools/source-size/piles.mjs +2 -2
- package/tools/source-size/reason.mjs +0 -1
- package/tools/source-size/record.mjs +6 -13
- package/tools/source-size/setup.mjs +2 -2
- package/tools/source-size-config.mjs +29 -41
- package/tools/source-size-core.mjs +3 -2
- package/tools/source-size-judge.mjs +11 -28
- package/tools/source-size-refusal.mjs +1 -1
- package/tools/source-size-report.mjs +24 -27
- package/tools/source-size-runs.mjs +31 -24
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,57 @@ Semantically versioned ([semver](https://semver.org)), newest first. The `versio
|
|
|
4
4
|
is the current release. `upgrade` mode reads a project's `docs/ai/.workflow-version` and applies
|
|
5
5
|
every `migrations/<version>-<slug>.md` newer than it, in semver order.
|
|
6
6
|
|
|
7
|
+
## 23.10.0 — a line added inside a file's limits no longer stops the size check (AD-238)
|
|
8
|
+
|
|
9
|
+
**After `/agent-workflow-kit upgrade`, the size check no longer sums the lines of each declared root.** Before, a
|
|
10
|
+
regeneration recorded each root's line sum under `aggregate`, and one line added to any file, however far within its
|
|
11
|
+
limits, stopped the check and asked a reason for growth no single file shows.
|
|
12
|
+
|
|
13
|
+
- **No per-root line sum is judged or recorded.** A file within its limits is no finding, however the root grows;
|
|
14
|
+
every per-file and layout record keeps its ratchet, and files per root still stops a growing root where layout is
|
|
15
|
+
recorded.
|
|
16
|
+
- **An existing record keeps working.** A minted config that still holds `aggregate` gets one warning about it on
|
|
17
|
+
every check that judges it, with the paste-ready `--write-baseline` line, which needs no reason where nothing else
|
|
18
|
+
rises. That regeneration drops the sum, printing one `<root>: aggregate lines <n> → none` line per root.
|
|
19
|
+
- **Every regeneration writes config schema 3**, which is schema 2 with no `aggregate`. The reader takes schemas 1,
|
|
20
|
+
2 and 3. A write that changes the file's schema prints `moved from schema <from> to schema <to> in this write`, and
|
|
21
|
+
the first write of an absent config prints `written at schema 3 in this write`; each adds that a kit that predates
|
|
22
|
+
that schema stops by name until that copy is upgraded.
|
|
23
|
+
- **A clone or a vendored copy on kit 23.9.0 or earlier stops by name** on a config written at schema 3
|
|
24
|
+
(`"schema" must be 1 or 2, got 3`, exit 2) until that copy is upgraded. Before the write, the kit says so only in
|
|
25
|
+
the deployed sum's warning; after it, in the line above.
|
|
26
|
+
- **A config with a file record and no sum is judged**, where it stopped before as half-written: a config is absent,
|
|
27
|
+
authored (no `baseline`) or minted (`baseline` present).
|
|
28
|
+
- **The verbatim move of a minted schema-1 config** (by `--adopt`, or by a `--write-baseline` that refuses a raise)
|
|
29
|
+
writes schema 2 where the file holds `aggregate`, which it carries as it is, and schema 3 where it holds none; an
|
|
30
|
+
admitted regeneration of a schema-1 config lands on schema 3.
|
|
31
|
+
- **Fixed:** a directory named `constructor` no longer stops the size check where layout is judged.
|
|
32
|
+
- The green practice line, the procedures block, the `now` CAMPAIGN line, `--help` and the advisor's texts no longer
|
|
33
|
+
state a sum or a half-written record.
|
|
34
|
+
|
|
35
|
+
## 23.9.0 — a failed coverage check shows what failed and the fix first (AD-237)
|
|
36
|
+
|
|
37
|
+
**After `/agent-workflow-kit upgrade`, a red `coverage-check.mjs --check` run opens with its failure, and so do a
|
|
38
|
+
usage mistake and an unexpected error.** Before, a red run printed its machine lines and notes first and its failures
|
|
39
|
+
after them in indented groups, a refused attestation context as a `REFUSED` line; a usage mistake and an unexpected
|
|
40
|
+
error went to standard error.
|
|
41
|
+
|
|
42
|
+
- **A red run prints one block on standard output:** `coverage-check: FAIL — <what failed>`, naming each class it
|
|
43
|
+
meets in a fixed order (the declared list, the lcov file, changed Node lines or files uncovered with their count,
|
|
44
|
+
red-proof obligations unmet with their count, the evidence store, the attestation context refused); then each
|
|
45
|
+
finding at column one starting with its place (`file:line`, a file, or `.` with the path leading its text when the
|
|
46
|
+
path cannot stand as a place); then one `coverage-check: REMEDY — …` line per class; then the lines a green run
|
|
47
|
+
prints, in their old order.
|
|
48
|
+
- **A usage mistake** prints the verdict line and the `Usage:` lines (exit 2); **an unexpected error** prints the
|
|
49
|
+
verdict line naming it, a REMEDY line and the stack, with no machine line (exit 1). Standard error stays empty.
|
|
50
|
+
- **What stays:** every exit code, everything the check judges, both machine lines (`lcov-sha256=` and `attested=`)
|
|
51
|
+
in count and content, and every run that exits 0, byte for byte. Two stated exceptions: `--help` says
|
|
52
|
+
"attestation context refused" where it said `REFUSED`; and in a red run with no attestation context
|
|
53
|
+
the `NO VERDICT` line says the findings stand above it.
|
|
54
|
+
- **A new kit module, `tools/checker-block/`,** places each finding and makes the verdict text, each finding's
|
|
55
|
+
text, the remedies and the after lines safe before the shared composer; the later checkers of the kit's tools will
|
|
56
|
+
use it too.
|
|
57
|
+
|
|
7
58
|
## 23.8.0 — the size record's reasons stay honest, and every run says what its scope left out (AD-236)
|
|
8
59
|
|
|
9
60
|
**After `/agent-workflow-kit upgrade`, the kit writes its own reason `initial adoption` only into record entries the
|
package/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: agent-workflow-kit
|
|
|
3
3
|
description: Deploy or upgrade a portable AI-agent memory-and-workflow system in any project. Use when the user wants to bootstrap `docs/ai/` + an entry-point `AGENTS.md` (+ `CLAUDE.md` alias) + cap/archive/index enforcement in a new or existing repo, set up the Memory Map and session protocols, install the docs-rotation pre-commit hook, or run `/agent-workflow-kit` / `/agent-workflow-kit upgrade`. Triggers on phrases like "set up the memory system", "deploy the AI workflow here", "bootstrap docs/ai", "upgrade the workflow". New to the epic, story and task tier? Run `/agent-workflow-kit tier`. A typed decision with a confidence from Jev? Run `/agent-workflow-kit jev`.
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
metadata:
|
|
6
|
-
version: '23.
|
|
6
|
+
version: '23.10.0'
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# agent-workflow-kit
|
package/capability.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sabaiway/agent-workflow-kit",
|
|
3
|
-
"version": "23.
|
|
3
|
+
"version": "23.10.0",
|
|
4
4
|
"description": "Portable, cross-agent memory & workflow for AI coding agents — Claude Code, Codex, Cursor, Devin Desktop. One command deploys an AGENTS.md entry point + docs/ai context with cap/archive/index enforcement into any repo.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agents",
|
|
@@ -6,10 +6,12 @@ The **final-run checker** (strip-the-kit D3(c)+(d)) — two deterministic arms o
|
|
|
6
6
|
|
|
7
7
|
Run `node ${CLAUDE_SKILL_DIR}/tools/coverage-check.mjs --check [--cwd <dir>]`:
|
|
8
8
|
|
|
9
|
-
0. **Attestation precondition (the provenance arm).** An lcov on disk carries no evidence of the tree it came from, so reading one and issuing a verdict certifies whatever happens to be there — the false GREEN direction is the dangerous one, because a line appended AFTER the suite ran has no `DA` entry and therefore reads non-executable ("nothing to cover"). Provenance is a CONSEQUENCE in exactly one context: a `run-gates --final` run deletes the artifact before any gate spawns. That runner mints a random nonce and writes `final-start.attempt` as a ONE-WAY COMMITMENT over `{nonce, tree fingerprint, base}`; the raw nonce rides the environment to this child, which recomputes the commitment and requires the record to carry it. Neither half suffices alone — a bare nonce is unverifiable, a persisted attempt id is reconstructible from public repo state — and the commitment is also the only place the BASE is bound, since no record stores it. The raw nonce is stripped from the red-proof probe environment so no descendant retains a live capability. `attested=` states whether a coverage VERDICT was ISSUED — pass **or** fail — never whether coverage passed: a valid handshake over an lcov that lists uncovered lines still reads `attested=yes` and still exits 1. Outcomes: **attested** → the coverage verdict is issued; **no handshake** → `attested=no` + `NO VERDICT` (exit 0, findings still printed, uncovered lines still exit 1 — the findings contract is unchanged); **a valid handshake over a run that read NO lcov BYTES** (the file is absent, or the path was refused as a non-regular file) → `attested=no` + `NO VERDICT`: the run owned the artifact's lifetime and read nothing, so it certifies NOTHING — reading `yes` there would be the false green this arm exists to close, one layer up. The predicate is the consumed bytes (`lcov-sha256` is a digest, not `none`), never the skip flag, so a refused path can never attest either. The two halves are independent: WITHHOLDING the verdict never changes an exit code — an absent file stays exit 0 (the loud `skipped-no-lcov`), and the refused non-regular path keeps its OWN fail-closed exit 1; **a handshake describing another tree or matching no recorded attempt** →
|
|
10
|
-
1. **Coverage arm (D3(d)):** every CHANGED executable Node line (`.mjs`/`.cjs`/`.js`, tracked working-vs-HEAD changes + untracked-not-ignored files) must be covered — uncovered lines are LISTED `file:line` and fail; a changed file ABSENT from the lcov map is a file-level red (never "non-executable" by silence); changed out-of-domain files (e.g. `.sh`) and unsupported-source files (e.g. `.ts`) are LISTED — the claim is narrowed honestly, not widened. NO lcov file at the path (ENOENT) = a LOUD `skipped-no-lcov` (exit 0, stated — produce the file via the unit-tests gate's lcov reporters); any other status failure exits 1 naming the path and the code where it has one; a symlink at the path is a refusal (lstat, no-follow). **The declared list:** a project may name in `docs/ai/coverage-declared.json` — a strict config written by hand, `{ "schema": 1, "entries": [{ "path": "<exact repo path>", "reason": "<one line>" }] }` — changed files nothing runs at their repository path (a fixture a test copies out and runs elsewhere). A listed changed file with no executed line in the lcov this run read is not judged and is printed with its reason; one with an executed line is judged as any other file; every line about the list prints on every run. An unreadable or malformed list fails (exit 1) and applies nothing. Under a final run the list must be the one the run started with, or the
|
|
9
|
+
0. **Attestation precondition (the provenance arm).** An lcov on disk carries no evidence of the tree it came from, so reading one and issuing a verdict certifies whatever happens to be there — the false GREEN direction is the dangerous one, because a line appended AFTER the suite ran has no `DA` entry and therefore reads non-executable ("nothing to cover"). Provenance is a CONSEQUENCE in exactly one context: a `run-gates --final` run deletes the artifact before any gate spawns. That runner mints a random nonce and writes `final-start.attempt` as a ONE-WAY COMMITMENT over `{nonce, tree fingerprint, base}`; the raw nonce rides the environment to this child, which recomputes the commitment and requires the record to carry it. Neither half suffices alone — a bare nonce is unverifiable, a persisted attempt id is reconstructible from public repo state — and the commitment is also the only place the BASE is bound, since no record stores it. The raw nonce is stripped from the red-proof probe environment so no descendant retains a live capability. `attested=` states whether a coverage VERDICT was ISSUED — pass **or** fail — never whether coverage passed: a valid handshake over an lcov that lists uncovered lines still reads `attested=yes` and still exits 1. Outcomes: **attested** → the coverage verdict is issued; **no handshake** → `attested=no` + `NO VERDICT` (exit 0, findings still printed, uncovered lines still exit 1 — the findings contract is unchanged); **a valid handshake over a run that read NO lcov BYTES** (the file is absent, or the path was refused as a non-regular file) → `attested=no` + `NO VERDICT`: the run owned the artifact's lifetime and read nothing, so it certifies NOTHING — reading `yes` there would be the false green this arm exists to close, one layer up. The predicate is the consumed bytes (`lcov-sha256` is a digest, not `none`), never the skip flag, so a refused path can never attest either. The two halves are independent: WITHHOLDING the verdict never changes an exit code — an absent file stays exit 0 (the loud `skipped-no-lcov`), and the refused non-regular path keeps its OWN fail-closed exit 1; **a handshake describing another tree or matching no recorded attempt** → the class attestation context refused (exit 1), never a verdict in either direction. One fully anchored `coverage-check: attested=<yes|no>` machine line rides every run, on the same exactly-once contract as the sha line — and a withheld verdict TRAVELS: `run-gates` carries it as `coverage=not-run` on the summary line and names it on the checker's table row, and `core-evidence summary` never renders an unqualified GREEN over a final record that consumed no lcov. Stated residuals, both named rather than implied: (a) an operator who runs both processes can forge the store or the code — the kit's standing self-discipline posture, not a security boundary; (b) **"the run owns the artifact" is exclusive by CONVENTION over the fixed path, not enforced** — a writer outside the run (a second `run-gates`, a hand-run `--only unit-tests`, an orphaned test process) can place foreign evidence between the deletion and the checker's read, and every check then agrees. Closing (b) needs an attempt-unique artifact path, which the runner can name but the declared producer cmd must reference — queued as LCOV-EXCLUSIVE-OWNERSHIP. What this arm removes is the false green that needs no second process and nobody trying: evidence that predates the edit.
|
|
10
|
+
1. **Coverage arm (D3(d)):** every CHANGED executable Node line (`.mjs`/`.cjs`/`.js`, tracked working-vs-HEAD changes + untracked-not-ignored files) must be covered — uncovered lines are LISTED `file:line` and fail; a changed file ABSENT from the lcov map is a file-level red (never "non-executable" by silence); changed out-of-domain files (e.g. `.sh`) and unsupported-source files (e.g. `.ts`) are LISTED — the claim is narrowed honestly, not widened. NO lcov file at the path (ENOENT) = a LOUD `skipped-no-lcov` (exit 0, stated — produce the file via the unit-tests gate's lcov reporters); any other status failure exits 1 naming the path and the code where it has one; a symlink at the path is a refusal (lstat, no-follow). **The declared list:** a project may name in `docs/ai/coverage-declared.json` — a strict config written by hand, `{ "schema": 1, "entries": [{ "path": "<exact repo path>", "reason": "<one line>" }] }` — changed files nothing runs at their repository path (a fixture a test copies out and runs elsewhere). A listed changed file with no executed line in the lcov this run read is not judged and is printed with its reason; one with an executed line is judged as any other file; every line about the list prints on every run. An unreadable or malformed list fails (exit 1) and applies nothing. Under a final run the list must be the one the run started with, or the attestation context is refused (exit 1).
|
|
11
11
|
2. **Red-proof arm (D3(c)):** every authoritative current-base `red-proof` declaration must verify — the bound test file exists (deleted fails), its content sha256 matches the declaration (custody), the test resolves (zero-match fails) and runs green N/N NOW, and the declaration's pre-fix fingerprint differs from the current tree (equal = reuse/forgery, refused). A malformed evidence store fails CLOSED.
|
|
12
12
|
|
|
13
|
+
**The red output.** A red run prints ONE block on standard output and nothing on standard error. Its first line, `coverage-check: FAIL — …`, names each class the run meets, in this order: the declared list, the lcov file, changed Node lines or files uncovered (with their count), red-proof obligations unmet (with their count), the evidence store, the attestation context refused. Then each finding at its place — `file:line`, a file, or `.` with the path leading its text when the path cannot stand as a place — then one `coverage-check: REMEDY — …` line per class met, then the lines a green run also prints: `lcov-sha256=`, the notes, the declared list's lines, the verified red-proof line, `attested=` and, where no verdict was issued and the context was not refused, the `NO VERDICT` line. A usage mistake prints the verdict line and the `Usage:` lines (exit 2); an unexpected error prints the verdict line naming it, a remedy line and the stack, with no machine line (exit 1). Every green run but `--help` prints what it printed before; `--help` says "attestation context refused" where it said `REFUSED`.
|
|
14
|
+
|
|
13
15
|
Wire it as the LAST declared gate in `docs/ai/gates.json` — `run-gates --final` REFUSES a declaration where the canonical coverage-check gate is not last (nothing may run after the checker consumed the lcov) or where its cmd is not ONE plain invocation of the kit's OWN tool (a masked form or a lookalike path never counts).
|
|
14
16
|
|
|
15
17
|
**Invariants:** writes nothing · spawns read-only `git` queries + the bound-test probes (`node --test`, shell-free) · no network · exit 0 pass / 1 fail (locations listed) / 2 usage.
|
|
@@ -21,7 +21,7 @@ Declared gates can also be **auto-approved** (no permission prompt on a byte-exa
|
|
|
21
21
|
|
|
22
22
|
**Candidate line — the review-receipt gate (opt-in, never auto-seeded; AD-021).** Projects that configure a reviewed/council `plan-execution.review` recipe can declare the review-state check as one more gate — the exact candidate `{ id, title, cmd }` line and its contract live under `${CLAUDE_SKILL_DIR}/references/modes/review-state.md` (step 3).
|
|
23
23
|
|
|
24
|
-
**Candidate line — the source-size gate (opt-in, never auto-seeded).** A project declaring the source-size practice (`docs/ai/source-size.json`) can declare its checker as one more gate, offered **only over a MINTED schema
|
|
24
|
+
**Candidate line — the source-size gate (opt-in, never auto-seeded).** A project declaring the source-size practice (`docs/ai/source-size.json`) can declare its checker as one more gate, offered **only over a MINTED practice past schema 1** — an absent config has nothing to offer, an authored-but-unminted one is withheld by name rather than declaring a gate that would refuse, and a minted schema-1 one is withheld naming its `--write-baseline` move. Adoption is ONE consented verb, `node ${CLAUDE_SKILL_DIR}/tools/source-size-check.mjs --adopt --reason "<text>" [--cwd <project>]`: it mints the record and declares this gate and NOTHING else, is idempotent once adopted, and with no config refuses with the exact file to author. The advisor surfaces it as the `source-size` item, reading a declared cmd as one of THREE claims rather than a yes/no — **canonical** (this copy — answered), **tool-elsewhere** (the same shape resolving to a DIFFERENT real copy — a vendored deployment, converging on a `source-size-copy` acknowledgement, never on `--adopt`, which would collide on the declared id), **not-the-tool** (a gate merely CARRYING the id is a squatter: rename it, or repoint its cmd at this `--check` form) — in that precedence. An unminted record stays the same attention outcome for either copy, and no acknowledgement silences it.
|
|
25
25
|
|
|
26
26
|
**Candidate lines — the kit's own checkers (opt-in, one consented verb).** `control-bytes`, `plan-shape`, `spec-check`, `spec-coverage` and `project-rules` can each be declared as a gate of your project: `node ${CLAUDE_SKILL_DIR}/tools/checker-gates.mjs --cwd <project>` previews them and writes nothing. Each is offered only over a state where its checker runs by design: `control-bytes` over a `.git` directory or gitfile at the project root, `plan-shape` and `project-rules` on any deployment, `spec-check` over a regular `docs/ai/specs/index.md`, `spec-coverage` over a regular `docs/ai/spec-coverage.json` beside that store root. An offered checker prints its paste-ready entry line; the upgrade's `tier` ask writes the offered entries on your explicit yes — add-only, placed by the rule below, not stamp-gated, after the preview printed the disclosure below. An entry it wrote is removed by hand from `docs/ai/gates.json`: the verb never un-declares. `epic-shape` and `queue-audit` take a project operand and `doc-parity` checks only the kit's own package, so none of them is offered.
|
|
27
27
|
|
package/references/modes/now.md
CHANGED
|
@@ -13,7 +13,7 @@ The four blocks keep this order:
|
|
|
13
13
|
1. **NOW** — every plan in flight, its derived phase, current and next step, then the tree fingerprint, clean state, review verdict lines, final run and red-proof currency. No plan and several plans are rendered states; never pick one silently.
|
|
14
14
|
2. **STEPS** — every ledger row with one of `landed`, `in progress`, `pending` or `unjudged`. The rows are the steps; invent no numbering.
|
|
15
15
|
3. **QUEUE** — every work-carrying row (live, parked, ambiguous) under the full line-numbered heading path it carries, with per-class counts covering every row of the bucket, terminal and record included, and names rather than ids. Only a path through `## Pending / backlog` calls its position priority; every other bucket is archive and calls it position.
|
|
16
|
-
4. **CAMPAIGN** — source-size config state (`absent`, `authored`, `
|
|
16
|
+
4. **CAMPAIGN** — source-size config state (`absent`, `authored`, `minted`), caps, roots and recorded over-cap files. An absent opt-in config is a rendered state.
|
|
17
17
|
|
|
18
18
|
Evidence alone sets a ledger status: the row's path and verb, then the path fact, changed set and exclusion fact. The plan's prose never sets a status. A checked box or terminal marker is only a claim; when evidence contradicts it, print the claim beside the evidence-derived status. Keep anomaly and current red-proof annotations beside the same status too. Every status line names its evidence source.
|
|
19
19
|
|
|
@@ -31,7 +31,7 @@ Run **`node ${CLAUDE_SKILL_DIR}/tools/procedures.mjs <activity> [--override <slo
|
|
|
31
31
|
|
|
32
32
|
**Flow armed-halves block (session-start read side).** When the config carries a `flow` block, the advisor also renders `Flow (schema 1) — armed halves (config · chain · bookkeeping):` — the **config half** (preset · councilRounds · kitMinVersion), the **chain half** (a light read-only probe of the flow store on the checker's fixed path: ARMED at an adoption record, UNARMED for an absent or unadopted store, fail-closed BROKEN wording for a malformed one), and the **bookkeeping half** (each declared path: declared non-excluded — the tracked-file floor verifies on the `set-flow` arming path — vs loudly DECLARED-EXCLUDED). A config with no `flow` block renders byte-identically to before and pays no store probe.
|
|
33
33
|
|
|
34
|
-
**Declared source-size practice block (upfront knowledge, D-17 U1).** When the project declares a source-size practice in `docs/ai/source-size.json`, the advisor also renders `Declared source-size practice (docs/ai/source-size.json) — known BEFORE the code is written:` — the caps, the five limits with their tolerances, whether layout is recorded, on schema 1 the `--write-baseline` move, what is recorded and the canonical WHY sentence (the plan-time layout itself is the planning canon's Module ledger). `--json` carries the SAME lines under **`declaredPractice`** (an empty array when nothing is declared), so the human and structured renders never diverge. The
|
|
34
|
+
**Declared source-size practice block (upfront knowledge, D-17 U1).** When the project declares a source-size practice in `docs/ai/source-size.json`, the advisor also renders `Declared source-size practice (docs/ai/source-size.json) — known BEFORE the code is written:` — the caps, the five limits with their tolerances, whether layout is recorded, on schema 1 the `--write-baseline` move, what is recorded and the canonical WHY sentence (the plan-time layout itself is the planning canon's Module ledger). `--json` carries the SAME lines under **`declaredPractice`** (an empty array when nothing is declared), so the human and structured renders never diverge. The three config states each read as themselves: **ABSENT** renders nothing at all (a project declaring no practice is handed no invented limits), **AUTHORED** is pre-mint (no file size is recorded yet), **MINTED** carries the recorded count. A declaration that cannot be read (malformed, unknown-keyed, a dangling symlink) renders ONE loud `UNREADABLE` line and the advisor **still exits 0** — the practice's own checker owns the exit code for its config (exit 2 there) and its declared gate reds the gate matrix. Read through the practice's pure read core, so this advisor never reaches its writer half.
|
|
35
35
|
|
|
36
36
|
**Readers-sweep block (`plan-authoring` only, unconditional).** Before the review-loop block the advisor renders `Readers sweep (before the first review) — …`: the search form for every config key, registry entry, exported constant, receipt field or canon sentence the plan changes, and the classification rule (a ledger row, a stated non-goal, or unchanged with its proof). The command line `run: node <kit>/tools/repo-search.mjs --pattern <the literal>` ALWAYS renders — bare wherever the `--kit-tools` tier could seed that path (the tier's own byte-form, the same predicate), and single-quoted otherwise (an unseedable path has no rule to match); `--pattern-file <f>` only for a pattern carrying a shell-significant byte; when the project's MCP registration is complete (`/agent-workflow-kit mcp`) a `use: repo_search {"pattern": "<the literal>"}` line renders ABOVE it — registration on disk, never a claim the tool is loaded in this session. `--json` carries the SAME lines under **`readersSweep`** (an empty array for the other activities).
|
|
37
37
|
|
|
@@ -37,10 +37,10 @@ A variant's posture note, where its key has one, is printed by `init` from this
|
|
|
37
37
|
|
|
38
38
|
- `gates-inert` — the gate matrix is DECLARED but verifies nothing, and the two causes have different remedies, so the item renders a different apply for each. **Cause A** — a canonical `coverage-check` gate with no producer gate declared BEFORE it (none at all, or one declared after it, which writes the lcov too late): the run certifies no coverage of its own — `coverage=not-run` when nothing wrote an lcov, or a verdict over STALE bytes an earlier run left in the git dir, which is worse because it reads as `coverage=certified`. The remedy needs the producer to run BEFORE the checker — declared or MOVED there. When the checker is the LAST declared gate and the project's own scripts yield an offerable producer, the fill PLACES that producer before it, so the apply is the ordinary `gates-init` dry-run preview. Otherwise — no offerable producer, or a checker that is not last — it is the user item `gates-inert.unfillable`: the user's own step is to edit `docs/ai/gates.json` (the exact producer form lives in `${CLAUDE_SKILL_DIR}/references/modes/gates.md`), because the fill never reorders entries it did not write. When the declaration carries, anywhere, a gate in a form an earlier kit wrote that the upgrade moves (one whose tail holds only test paths), or the fill withheld its `node --test` script because the kit folder does not hold this kit's command and reporter, the apply is `/agent-workflow-kit upgrade` in place of both: it moves an earlier kit's gate with no question, or a line of its report names what stops it. **Cause B** — every declared gate is one of the kit's own canonical checkers, so the matrix runs no project-verification command at all: the apply is the `gates-init` dry-run preview, the same consent-gated seeder the `gates-declaration` item renders, and after the SAME confirmation you run the `--apply` line it prints. Neither cause changes any gate result, exit code or receipt — the item adds no enforcement, only the offer. Risk profile: `docs/ai/gates.json` is a PRIVILEGED file (a declared gate is auto-approvable by the wired hook), so both causes land in the same place — where the fill can help, it declares a project-controlled command on your explicit yes; where it cannot, the edit is the user's own step.
|
|
39
39
|
|
|
40
|
-
- `source-size` — the arms differ by what the declared gate IS. **`adopted-elsewhere`** — the gate runs a DIFFERENT real copy of this checker (a vendored deployment): the practice runs, the advisor cannot resolve it as its own sibling, and the realpath anchor does not widen (that stops a lookalike). So the convergence is the ack writer's preview (`--lane source-size-copy` → `sourceSizeCopyAck`), never `--adopt`, which would mint and then be refused by the fill on the declared id. The fingerprint binds the declared claims AS AUTHORED, sorted, not resolved paths, so a second external copy re-fires it. **`id-squatter`** — a gate carries the `source-size` id and is not this checker under any reading: the gate matrix reads as running the size check while it runs none, so it is the user's own step (rename the id, or repoint the cmd at this `--check`). **`unminted`**, for both copies: a gate refusing every run over an authored
|
|
40
|
+
- `source-size` — the arms differ by what the declared gate IS. **`adopted-elsewhere`** — the gate runs a DIFFERENT real copy of this checker (a vendored deployment): the practice runs, the advisor cannot resolve it as its own sibling, and the realpath anchor does not widen (that stops a lookalike). So the convergence is the ack writer's preview (`--lane source-size-copy` → `sourceSizeCopyAck`), never `--adopt`, which would mint and then be refused by the fill on the declared id. The fingerprint binds the declared claims AS AUTHORED, sorted, not resolved paths, so a second external copy re-fires it. **`id-squatter`** — a gate carries the `source-size` id and is not this checker under any reading: the gate matrix reads as running the size check while it runs none, so it is the user's own step (rename the id, or repoint the cmd at this `--check`). **`unminted`**, for both copies: a gate refusing every run over an authored record (over an absent one the check judges layout alone), attention, and NO acknowledgement silences it; only the verb differs (with the gate declared elsewhere, `--write-baseline`); a line carrying the placeholder takes your own sentence, by the `recipe:` line. **`schema-1`** — the check stops on a minted schema-1 config, so this arm comes first: its `--write-baseline` line carries NO reason (a pinned one would launder a raise; a raise riding the move refuses, and the agent writes that raise's reason from what the run shows, with no question to the user), every run until the move. **`layout`** — on a config with no layout record, the record of the piles already there comes first, as its own item: a no writes nothing and the item returns every run; its `recipe:` line names the branch states, and `source-size.layout` is applied before the `hook-checks` check line runs, whose layout line follows that record. **`piles`** — each recorded pile with no queue row gets one, at the end of the queue's Later bucket; a write the queue's own declared check would refuse is not made and the stated skip says why. Risk profile: `docs/ai/gates.json` is a PRIVILEGED file, so every arm here either records an acknowledgement or hands you an edit — the kit declares nothing on its own.
|
|
41
41
|
- `gate-hook` — the offer wires the hook on the harness lane: the agent applies it on the chat yes after the check; `init` previews and applies it on the terminal yes as the route the user may take instead. Over a wired hook the key renders the kit item `gate-hook.not-current` instead: the placed hook file is absent or differs from the body the kit writes for it. An older body validates your declaration through its OWN baked copy and goes dark on a key it does not know, such as `lcovProducer` (present, whatever its value), so every gate prompts again with no error anywhere. The agent applies the kit item with no question after the check, whose result names the file with its new digest, and the old one too over a differing file; it writes only the hook file. Risk profile: the offer places a hook file and wires one settings entry; the kit item writes one hook file with the kit's body; the declaration is never touched.
|
|
42
42
|
- `enforcement` — copies the bundled runtime files of `references/scripts/` into the kit folder `scripts/agent-workflow/`, then runs the project's own hook installer, which installs the pre-commit hook. The lane is harness: the agent applies the item on the chat yes after the check, whose result shows each script the kit places with its bytes and the installer it runs with its bytes; `init` applies it on the batch terminal yes as the route the user may take instead. The copy is create-only: an existing file stands and nothing is written through a link, and the offer renders only on no Node evidence. The hook invokes `node` directly, so a committer without it on PATH gets a loud failure. The installer refuses to overwrite a pre-commit hook it did not write: an install it refuses removes the scripts this apply copied, and the item is offered again with the installer's output shown; over a pre-commit hook the installer did not write the item is not offered — its skip names the user's own step. Risk profile: local tooling and a Git hook are added on the chat yes after the check, or on init's y.
|
|
43
|
-
- `hook-checks` — the agent applies the item on the chat yes after the check; `init` applies it on the terminal y as the route the user may take instead. Risk profile: future commits stop on the rules check and, where judged, on the size check's findings — lines
|
|
43
|
+
- `hook-checks` — the agent applies the item on the chat yes after the check; `init` applies it on the terminal y as the route the user may take instead. Risk profile: future commits stop on the rules check and, where judged, on the size check's findings — lines and layout; over a clone with no pre-commit hook the installer writes its whole hook, so commits also stop on its docs and archive lines.
|
|
44
44
|
- `attribution` — the agent applies the item on the chat yes after the check, setting one key in the project `.claude/settings.json`; `init` applies it on the terminal y as the route the user may take instead. An existing "includeCoAuthoredBy": false already converges the item unless an "attribution" key sets a commit or PR text; a local-scope override is the user's own edit. Risk profile: one settings key, nothing widened.
|
|
45
45
|
- `footprint-global` — the agent applies the item on the chat yes after the check, which prints each line it removes; `init` applies it on the terminal y as the route the user may take instead. Another of the user's repositories may rely on the same lines: a no keeps the block, and the item returns at the next run. The apply prints the removed lines as a backup. Risk profile: lines removed from the machine-global excludes file.
|
|
46
46
|
- `mcp-channel` — the offer is to REGISTER the kit's read-only stdio MCP server in this project on the harness lane: a registration is a command your MCP client will RUN. The agent applies it on the chat yes after the check; `init` previews the exact entry and applies it on the terminal y as the route the user may take instead. What the registration buys: path questions and literal searches become typed tool calls whose arguments are named JSON fields instead of a string handed to a shell, so a pipe, a redirect or a quote inside a pattern or a path stays DATA and is never interpreted. Posture: the server is a **read-only child of your client** (path/type/size/line facts and literal search over this project root; no write and no exec API), and like the client itself it runs **outside the Bash sandbox** — the sandbox is not what bounds it, the server's own root containment is. The two allow rules it adds make those two tools promptless and nothing else. The **`.differing`** arm is also a harness item: an `agent-workflow` entry already stands in `.mcp.json` and **structurally differs** from what this kit copy would write (another kit copy, a hand-edited path, an added `env`; the comparison ignores key order, so re-serialized identical bytes are the same registration). The check shows the entry standing in `.mcp.json` and the entry it would write; the chat yes confirms the replacement. `init` previews `mcp --replace` and replaces only on the terminal y. Stated limit: this item does **not** detect a `disabledMcpjsonServers` veto, so a converged `mcp-channel` means *what the mode writes is in place*, not *the client will load it* — see `${CLAUDE_SKILL_DIR}/references/modes/mcp.md`. Risk profile: a new read-only channel your client will launch; no write or exec exposure; a differing registration is replaced only on the checked chat yes or the terminal y and every other declaration is kept.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { composeRedBlock } from '../../references/scripts/shared/index.mjs';
|
|
2
|
+
|
|
3
|
+
const ROOT_PLACE = '.';
|
|
4
|
+
const PARENT_SEGMENT = '..';
|
|
5
|
+
const PATH_SEPARATOR = '/';
|
|
6
|
+
const LINE_MARKER = ':';
|
|
7
|
+
const FINDING_SEPARATOR = ': ';
|
|
8
|
+
const EMPTY_TEXT = '';
|
|
9
|
+
const SPACE = ' ';
|
|
10
|
+
const MIN_LINE = 1;
|
|
11
|
+
const TRAILING_SLASH = /\/$/;
|
|
12
|
+
const UNSAFE_PLACE = /[\\:\r\n]/;
|
|
13
|
+
const CARRIAGE_RETURN = /\r/g;
|
|
14
|
+
const LINE_FEED = /\n/g;
|
|
15
|
+
const LEADING_SPACE = /^ /;
|
|
16
|
+
const SHOWN_CARRIAGE_RETURN = '\\r';
|
|
17
|
+
const SHOWN_LINE_FEED = '\\n';
|
|
18
|
+
const SHOWN_LEADING_SPACE = '\\u0020';
|
|
19
|
+
|
|
20
|
+
const escapeLineBreaks = (text) => typeof text === 'string'
|
|
21
|
+
? text.replace(CARRIAGE_RETURN, SHOWN_CARRIAGE_RETURN).replace(LINE_FEED, SHOWN_LINE_FEED)
|
|
22
|
+
: text;
|
|
23
|
+
|
|
24
|
+
export const escapeLineText = (text) => typeof text === 'string'
|
|
25
|
+
? escapeLineBreaks(text).replace(LEADING_SPACE, SHOWN_LEADING_SPACE) : text;
|
|
26
|
+
|
|
27
|
+
export const placeFinding = ({ root, name, path, line, laterLines = [] }) => {
|
|
28
|
+
const rootPrefix = root.replace(TRAILING_SLASH, EMPTY_TEXT);
|
|
29
|
+
const relative = path === (rootPrefix || PATH_SEPARATOR) ? ROOT_PLACE
|
|
30
|
+
: typeof path === 'string' && path.startsWith(`${rootPrefix}${PATH_SEPARATOR}`)
|
|
31
|
+
? path.slice(rootPrefix.length + PATH_SEPARATOR.length) : path;
|
|
32
|
+
if (relative === ROOT_PLACE && line === undefined) return { place: ROOT_PLACE, lead: EMPTY_TEXT };
|
|
33
|
+
const lineSuffix = line === undefined ? EMPTY_TEXT : `${LINE_MARKER}${String(line)}`;
|
|
34
|
+
const place = String(relative) + lineSuffix;
|
|
35
|
+
const segments = typeof path === 'string'
|
|
36
|
+
? (path.startsWith(PATH_SEPARATOR) ? path.slice(PATH_SEPARATOR.length) : path).split(PATH_SEPARATOR)
|
|
37
|
+
: [];
|
|
38
|
+
const ownPlace = typeof path === 'string'
|
|
39
|
+
&& segments.every((segment) => segment !== EMPTY_TEXT && segment !== ROOT_PLACE && segment !== PARENT_SEGMENT)
|
|
40
|
+
&& relative !== EMPTY_TEXT && relative !== ROOT_PLACE && !UNSAFE_PLACE.test(relative)
|
|
41
|
+
&& !relative.startsWith(SPACE) && relative !== name
|
|
42
|
+
&& (line === undefined || (Number.isSafeInteger(line) && line >= MIN_LINE))
|
|
43
|
+
&& !laterLines.some((text) => typeof text === 'string' && text.startsWith(`${place}${FINDING_SEPARATOR}`));
|
|
44
|
+
return ownPlace ? { place, lead: EMPTY_TEXT }
|
|
45
|
+
: { place: ROOT_PLACE, lead: `${escapeLineText(String(path) + lineSuffix)}${FINDING_SEPARATOR}` };
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const mapList = (list, transform) => Array.isArray(list) ? Array.from(list, transform) : list;
|
|
49
|
+
|
|
50
|
+
export const composeCheckerBlock = ({ name, root, failed, findings = [], remedies, after = [] }) => {
|
|
51
|
+
const afterLines = mapList(after, escapeLineBreaks);
|
|
52
|
+
const findingList = mapList(findings, (finding) => {
|
|
53
|
+
if (finding === null || typeof finding !== 'object') return finding;
|
|
54
|
+
const { path, line, text, detail } = finding;
|
|
55
|
+
const { place, lead } = placeFinding({
|
|
56
|
+
root, name, path, line, laterLines: Array.isArray(afterLines) ? afterLines : [],
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
59
|
+
place,
|
|
60
|
+
text: typeof text === 'string' && text.length ? lead + escapeLineText(text) : text,
|
|
61
|
+
...(detail === undefined ? {} : { detail }),
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
return composeRedBlock({
|
|
65
|
+
name,
|
|
66
|
+
failed: escapeLineText(failed),
|
|
67
|
+
findings: findingList,
|
|
68
|
+
remedies: mapList(remedies, escapeLineText),
|
|
69
|
+
after: afterLines,
|
|
70
|
+
});
|
|
71
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { guardChecker } from '../../references/scripts/shared/index.mjs';
|
|
2
|
+
|
|
3
|
+
const LINE_FEED = '\n';
|
|
4
|
+
|
|
5
|
+
export const runCheckerTail = ({ name, exitCode, remedy }, run, host) => {
|
|
6
|
+
const answer = guardChecker({ name, exitCode, remedy }, run);
|
|
7
|
+
const writeAnswer = (result) => {
|
|
8
|
+
const lines = result.lines ?? result.stdout.split(LINE_FEED);
|
|
9
|
+
const text = lines.join(LINE_FEED);
|
|
10
|
+
if (text.length) host.stdout.write(text.endsWith(LINE_FEED) ? text : `${text}${LINE_FEED}`);
|
|
11
|
+
const code = result.code ?? result.exitCode;
|
|
12
|
+
host.exitCode = code;
|
|
13
|
+
return code;
|
|
14
|
+
};
|
|
15
|
+
return answer instanceof Promise ? answer.then(writeAnswer) : writeAnswer(answer);
|
|
16
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { composeCheckerBlock } from '../checker-block/index.mjs';
|
|
2
|
+
import { COVERAGE_DECLARED_REL } from '../coverage-declared/index.mjs';
|
|
3
|
+
|
|
4
|
+
export const CHECKER_NAME = 'coverage-check';
|
|
5
|
+
const ZERO = 0;
|
|
6
|
+
const CLASS_SEPARATOR = '; ';
|
|
7
|
+
const WITHHELD_PREFIX = `${CHECKER_NAME}: NO VERDICT — `;
|
|
8
|
+
const RED_NO_CONTEXT = `${WITHHELD_PREFIX}no final-run attestation context — a verdict is issued only inside the run that owns the lcov (run-gates.mjs --final); findings above are informational`;
|
|
9
|
+
const CLASS_TEXTS = [
|
|
10
|
+
{
|
|
11
|
+
verdict: () => 'the declared list is unusable',
|
|
12
|
+
remedy: `fix what each finding above names in ${COVERAGE_DECLARED_REL}, then re-run`,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
verdict: () => 'the lcov file is unusable',
|
|
16
|
+
remedy: 'let the declared unit-tests gate write the lcov file as a regular file this run can read, then re-run',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
verdict: (count) => `${count} changed Node line(s) or file(s) uncovered`,
|
|
20
|
+
remedy: 'cover each changed line and file above with a test that executes it, then re-run',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
verdict: (count) => `${count} red-proof obligation(s) unmet`,
|
|
24
|
+
remedy: 're-observe each red proof above on its pre-fix tree, or restore its bound test until it runs green N/N',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
verdict: () => 'the evidence store is unusable',
|
|
28
|
+
remedy: 'repair or move aside the evidence store above, then re-run',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
verdict: () => 'the attestation context was refused',
|
|
32
|
+
remedy: 're-run run-gates.mjs --final on a tree no gate changes',
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
export const buildDeclaredFindings = ({ configFailure, failures }) => configFailure
|
|
37
|
+
? [{ path: COVERAGE_DECLARED_REL, text: configFailure }] : failures;
|
|
38
|
+
|
|
39
|
+
export const buildLcovFindings = (failure) => failure ? [{
|
|
40
|
+
path: failure.path,
|
|
41
|
+
text: failure.error
|
|
42
|
+
? `status could not be read (${failure.error.code ?? failure.error.message})`
|
|
43
|
+
: 'not a regular file (a symlink/device is never read — fail closed)',
|
|
44
|
+
}] : [];
|
|
45
|
+
|
|
46
|
+
export const buildUncoveredFindings = (failures) => failures.map(({ path, line }) => ({
|
|
47
|
+
path,
|
|
48
|
+
...(line === undefined ? {} : { line }),
|
|
49
|
+
text: line === undefined ? 'absent from coverage — the suite never executed this changed file'
|
|
50
|
+
: 'changed line not executed by the suite',
|
|
51
|
+
}));
|
|
52
|
+
|
|
53
|
+
export const buildRedProofFindings = (failures) => failures.map(({ file, testId, reason }) => ({
|
|
54
|
+
path: file, text: `${testId}: ${reason}`,
|
|
55
|
+
}));
|
|
56
|
+
|
|
57
|
+
export const buildEvidenceFindings = (path, failure) => failure ? [{ path, text: failure }] : [];
|
|
58
|
+
|
|
59
|
+
export const buildAttestationFindings = (root, refusal) => refusal ? [{ path: root, text: refusal }] : [];
|
|
60
|
+
|
|
61
|
+
export const isRed = (classes) => classes.some((findings) => findings.length > ZERO);
|
|
62
|
+
|
|
63
|
+
export const composeCoverageBlock = ({ root, classes, after, withoutContext = false }) => {
|
|
64
|
+
if (!isRed(classes)) return after;
|
|
65
|
+
const met = classes.map((findings, index) => ({ findings, ...CLASS_TEXTS[index] }))
|
|
66
|
+
.filter(({ findings }) => findings.length > ZERO);
|
|
67
|
+
return composeCheckerBlock({
|
|
68
|
+
name: CHECKER_NAME,
|
|
69
|
+
root,
|
|
70
|
+
failed: met.map(({ findings, verdict }) => verdict(findings.length)).join(CLASS_SEPARATOR),
|
|
71
|
+
findings: met.flatMap(({ findings }) => findings),
|
|
72
|
+
remedies: met.map(({ remedy }) => remedy),
|
|
73
|
+
after: after.map((line) => withoutContext && line.startsWith(WITHHELD_PREFIX) ? RED_NO_CONTEXT : line),
|
|
74
|
+
});
|
|
75
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { COVERAGE_DECLARED_REL } from '../coverage-declared/index.mjs';
|
|
2
|
+
|
|
3
|
+
export const LCOV_BASENAME = 'agent-workflow-lcov.info';
|
|
4
|
+
const USAGE = 'Usage:\n node coverage-check.mjs --check [--cwd <dir>]';
|
|
5
|
+
const HELP = `coverage-check — the D3(c)+(d) final-run checker (agent-workflow family).
|
|
6
|
+
|
|
7
|
+
${USAGE}
|
|
8
|
+
|
|
9
|
+
Reads the FIXED kit-owned lcov file (<git dir>/${LCOV_BASENAME}; AW_LCOV_FILE overrides —
|
|
10
|
+
produced by the declared unit-tests gate cmd's --experimental-test-coverage lcov reporters and
|
|
11
|
+
deleted fresh by run-gates --final), lists uncovered CHANGED executable Node lines file:line,
|
|
12
|
+
lists changed out-of-domain files (the coverage claim is narrowed to Node lines), and VERIFIES
|
|
13
|
+
every current-base red-proof record: bound test present, content hash unchanged, green N/N
|
|
14
|
+
(AW_CORE_EVIDENCE_RERUNS, default 3), pre-fix fingerprint differing from the current tree.
|
|
15
|
+
An absent lcov file (ENOENT) is a LOUD skipped-no-lcov (exit 0 — NO coverage check ran, stated).
|
|
16
|
+
Any other lcov status failure, a symlinked lcov path, an uncovered line, a broken red-proof
|
|
17
|
+
obligation, or a malformed evidence store fails (exit 1).
|
|
18
|
+
A changed file listed in ${COVERAGE_DECLARED_REL} (one { path, reason } entry per file nothing
|
|
19
|
+
runs at its repository path) with no executed line in the lcov read is not judged; it and every
|
|
20
|
+
other list line print on every run. An unreadable or malformed list fails (exit 1); with a context
|
|
21
|
+
the list must be the one the final run started with (AW_FINAL_ATTEST_DECLARED), else the run
|
|
22
|
+
fails as attestation context refused (exit 1).
|
|
23
|
+
|
|
24
|
+
A coverage VERDICT is issued ONLY inside the run that owns the artifact's lifetime: run-gates
|
|
25
|
+
--final deletes the lcov before any gate spawns and hands this checker an attestation context
|
|
26
|
+
(a nonce whose one-way commitment over {nonce, fingerprint, base} is the final-start attempt id).
|
|
27
|
+
One anchored machine line rides every run: coverage-check: attested=<yes|no>. It states whether a
|
|
28
|
+
coverage VERDICT was ISSUED — pass OR fail — never that coverage passed.
|
|
29
|
+
attested=yes → a verdict was issued over the lcov BYTES this run read (a failing one still
|
|
30
|
+
exits 1); the predicate is the consumed digest, never the skip flag.
|
|
31
|
+
attested=no → NO VERDICT: no handshake, or no lcov bytes were read at all (an absent file or a
|
|
32
|
+
refused path — nothing read, nothing certified). Withholding a verdict never
|
|
33
|
+
changes an exit code: an absent lcov stays exit 0, a refused non-regular path
|
|
34
|
+
keeps its own fail-closed exit 1, and uncovered lines still exit 1. Findings are
|
|
35
|
+
still printed; run-gates carries the withheld verdict as coverage=not-run.
|
|
36
|
+
attestation context refused (exit 1) → the context describes another tree or another declared
|
|
37
|
+
list, or matches no recorded attempt.
|
|
38
|
+
Residual, stated: ownership of the fixed path is CONVENTION, not enforcement — a concurrent writer
|
|
39
|
+
to it can still place foreign evidence (queued as LCOV-EXCLUSIVE-OWNERSHIP).
|
|
40
|
+
|
|
41
|
+
Sandbox-safe: no network; writes nothing; spawns read-only git queries and the bound-test
|
|
42
|
+
probes (node --test, shell-free) — the D4 sandbox lane. The attestation variables are consumed and
|
|
43
|
+
removed from this process's environment before anything spawns, so no child inherits the capability.
|
|
44
|
+
Read-only. Exit codes: 0 pass / no-verdict / skipped-loud; 1 fail or attestation context refused; 2 usage.`;
|
|
45
|
+
|
|
46
|
+
export const composeHelp = () => HELP;
|
|
47
|
+
export const composeUsage = () => USAGE;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export {
|
|
2
|
+
CHECKER_NAME, composeCoverageBlock, isRed, buildDeclaredFindings, buildLcovFindings,
|
|
3
|
+
buildUncoveredFindings, buildRedProofFindings, buildEvidenceFindings, buildAttestationFindings,
|
|
4
|
+
} from './block.mjs';
|
|
5
|
+
export { LCOV_BASENAME, composeHelp, composeUsage } from './help.mjs';
|