opencode-swarm 7.140.5 → 7.141.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/.opencode/skills/deep-dive/SKILL.md +7 -6
- package/.opencode/skills/running-tests/SKILL.md +7 -0
- package/.opencode/skills/swarm-pr-review/SKILL.md +2 -4
- package/.opencode/skills/swarm-pr-review/references/lane-output-recoverability.md +54 -0
- package/dist/agents/explorer.d.ts +1 -1
- package/dist/background/candidate-contract.d.ts +1 -1
- package/dist/background/lane-delivery-store.d.ts +43 -0
- package/dist/background/lane-output-store.d.ts +6 -0
- package/dist/background/pr-review-trigger-contract.d.ts +36 -0
- package/dist/cli/{config-doctor-5vzpq4qa.js → config-doctor-ayer8jwj.js} +2 -2
- package/dist/cli/{core-xjzdc56e.js → core-yep18rkf.js} +1 -1
- package/dist/cli/{curation-policy-avvb56x2.js → curation-policy-j1fbc3ry.js} +5 -5
- package/dist/cli/{curator-5nytvg7p.js → curator-fkwhph34.js} +28 -28
- package/dist/cli/{curator-llm-factory-rds75zhj.js → curator-llm-factory-b1wtbwwv.js} +28 -28
- package/dist/cli/{dispatch-2s23fbcs.js → dispatch-y8rergph.js} +1 -1
- package/dist/cli/{evidence-summary-service-zq4gyx6g.js → evidence-summary-service-8e6594tg.js} +9 -9
- package/dist/cli/{explorer-e9h66egs.js → explorer-18353rhn.js} +1 -1
- package/dist/cli/{gate-evidence-smn2wqft.js → gate-evidence-rt9034ft.js} +4 -4
- package/dist/cli/{guardrail-explain-an7jvam1.js → guardrail-explain-fhx1kft6.js} +29 -29
- package/dist/cli/{guardrail-log-0hnd2k9v.js → guardrail-log-x94s1jh9.js} +3 -3
- package/dist/cli/{hive-promoter-qe8pqg79.js → hive-promoter-3ay1hffy.js} +28 -28
- package/dist/cli/{index-8rp1y4ab.js → index-10zsx1x2.js} +1 -1
- package/dist/cli/{index-nyjtzmsj.js → index-1dwa96x7.js} +2 -2
- package/dist/cli/{index-tjqzr3jc.js → index-3d13jkzq.js} +2 -2
- package/dist/cli/{index-epvhf50h.js → index-9d4gck4e.js} +2 -1
- package/dist/cli/{index-0rx9t9w8.js → index-9snyxgtf.js} +1 -1
- package/dist/cli/{index-affh1gtg.js → index-acpsb3g1.js} +40 -9
- package/dist/cli/{index-2bg901qt.js → index-awwqa1f5.js} +6 -6
- package/dist/cli/{index-41hkt36g.js → index-ays8g6cm.js} +36 -5
- package/dist/cli/{index-01ggt2mj.js → index-b9mwe99e.js} +6 -6
- package/dist/cli/{index-p8kk34am.js → index-c2hczjhp.js} +1 -1
- package/dist/cli/{index-c432knmy.js → index-f1hsrgw1.js} +1 -1
- package/dist/cli/{index-nwrwy8eb.js → index-fckf6g01.js} +1 -1
- package/dist/cli/{index-kb5q9v34.js → index-fcsf8vjm.js} +3 -3
- package/dist/cli/{index-jm4cpp4n.js → index-g4w73p1v.js} +1 -1
- package/dist/cli/{index-mm2egvdt.js → index-h375yxj5.js} +30 -30
- package/dist/cli/{index-vh05t3w5.js → index-kq5p3nm3.js} +1 -1
- package/dist/cli/{index-z7h37d63.js → index-m54erqap.js} +1 -1
- package/dist/cli/{index-z90nvqj3.js → index-nk2ma3mh.js} +1324 -938
- package/dist/cli/{index-ex7r16gc.js → index-nkr3j0j1.js} +2 -2
- package/dist/cli/{index-s1v0wza5.js → index-nse60anv.js} +1 -1
- package/dist/cli/{index-ptn13xjn.js → index-pkby67j3.js} +1 -1
- package/dist/cli/{index-t5pytnca.js → index-q4vaar2b.js} +2 -2
- package/dist/cli/{index-m9xrdjn0.js → index-qskz8j2z.js} +1 -1
- package/dist/cli/{index-wrb0gykj.js → index-rx33k785.js} +3 -3
- package/dist/cli/{index-wkt9fj06.js → index-sd1w4pya.js} +3 -3
- package/dist/cli/{index-qy1nq52t.js → index-v250345n.js} +1 -1
- package/dist/cli/{index-386ts4tm.js → index-w95sxwfr.js} +4 -4
- package/dist/cli/{index-e0mpz2j3.js → index-x5kk9gyk.js} +5 -5
- package/dist/cli/{index-ztgn70jz.js → index-xcqst95a.js} +2 -2
- package/dist/cli/{index-v2xrer41.js → index-xmzmeknp.js} +3 -1
- package/dist/cli/{index-0r2m0vbq.js → index-ytnm84ed.js} +3 -3
- package/dist/cli/{index-912qz4y0.js → index-zbj3yrrd.js} +1 -1
- package/dist/cli/index.js +28 -28
- package/dist/cli/{knowledge-escalator-4pfrc902.js → knowledge-escalator-53m3sh8p.js} +10 -10
- package/dist/cli/{knowledge-events-3zkfnksk.js → knowledge-events-s5pmx5h3.js} +8 -8
- package/dist/cli/{knowledge-link-m9p80f4r.js → knowledge-link-x86ebng8.js} +4 -4
- package/dist/cli/{knowledge-store-dpqgvvjt.js → knowledge-store-dv70gxxc.js} +5 -5
- package/dist/cli/{knowledge-validator-2c7w87dk.js → knowledge-validator-je30smbr.js} +7 -7
- package/dist/cli/{pending-delegations-cxx9tezp.js → pending-delegations-7xsagjy5.js} +3 -3
- package/dist/cli/{pr-subscriptions-2sfnb599.js → pr-subscriptions-r6cdsa3t.js} +3 -3
- package/dist/cli/{runner-mky3vvht.js → runner-nm3baddf.js} +5 -5
- package/dist/cli/{scan-cursor-1z60gwrw.js → scan-cursor-tcdcjbp9.js} +6 -6
- package/dist/cli/{schema-vpnkwvez.js → schema-6cg2smxx.js} +1 -1
- package/dist/cli/{scope-persistence-p9dmprry.js → scope-persistence-v51d74j2.js} +6 -6
- package/dist/cli/{skill-generator-yx7ka1cj.js → skill-generator-7kp8s0ne.js} +12 -12
- package/dist/cli/{telemetry-0x6kszvk.js → telemetry-zex3zv3v.js} +1 -1
- package/dist/cli/{worktree-collision-ownership-wm5pse49.js → worktree-collision-ownership-n41qw3n8.js} +3 -3
- package/dist/cli/{worktree-isolation-bwc6ra8e.js → worktree-isolation-g6t99t0x.js} +28 -28
- package/dist/hooks/delegation-gate.d.ts +6 -0
- package/dist/hooks/knowledge-application-gate.d.ts +1 -1
- package/dist/hooks/knowledge-events.d.ts +5 -2
- package/dist/hooks/knowledge-receipt-ledger.d.ts +38 -0
- package/dist/hooks/knowledge-receipt-observability.d.ts +24 -1
- package/dist/hooks/knowledge-receipt-validator.d.ts +19 -3
- package/dist/hooks/knowledge-types.d.ts +9 -0
- package/dist/hooks/pr-workflow-gate.d.ts +20 -0
- package/dist/hooks/repo-graph-injection.d.ts +52 -0
- package/dist/index.js +231 -218
- package/dist/lang/backend.d.ts +7 -1
- package/dist/lang/default-backend.d.ts +2 -1
- package/dist/tools/create-tool.d.ts +5 -2
- package/dist/tools/dispatch-lanes.d.ts +45 -5
- package/dist/tools/knowledge-receipt.d.ts +40 -0
- package/dist/tools/test-runner.d.ts +13 -5
- package/package.json +1 -1
|
@@ -35,12 +35,13 @@ If the header is malformed or missing required fields, report the error and stop
|
|
|
35
35
|
## Step 2 — Scope Resolution
|
|
36
36
|
|
|
37
37
|
Use the following tools to map the audit scope:
|
|
38
|
-
1. `repo_map` with action "build"
|
|
39
|
-
2. `repo_map` with action "
|
|
40
|
-
3. `
|
|
41
|
-
4. `
|
|
42
|
-
5. `
|
|
43
|
-
6. `
|
|
38
|
+
1. `repo_map` with action "graph_health" — only if the graph is missing or incomplete (stale beyond the refresh cap, extraction failures) run `repo_map` with action "build"; plugin init and the session-start probe keep the graph fresh otherwise
|
|
39
|
+
2. `repo_map` with action "ask" (the audit scope as the question) and action "key_files" to rank scope-relevant files and repo hubs before any manual symbol walk
|
|
40
|
+
3. `repo_map` with action "localization" for the scope target
|
|
41
|
+
4. `symbols` and `batch_symbols` on key files identified by ask or localization
|
|
42
|
+
5. `imports` to trace dependency boundaries
|
|
43
|
+
6. `doc_scan` if documentation coverage is relevant
|
|
44
|
+
7. `knowledge_recall` with query matching the scope domain
|
|
44
45
|
|
|
45
46
|
Produce a SCOPE MAP: list of files, modules, and interfaces within the audit boundary. Cap at 50 files total.
|
|
46
47
|
|
|
@@ -82,6 +82,13 @@ Do you need to run tests?
|
|
|
82
82
|
|
|
83
83
|
**Rule of thumb:** Pass exactly one source file to `test_runner`. For multiple files, use a shell loop.
|
|
84
84
|
|
|
85
|
+
For one named Go or CTest test, bypass file discovery with an exact native selector:
|
|
86
|
+
|
|
87
|
+
- Go: `{ scope: "target", native_target: { framework: "go-test", name: "TestName[/Subtest]", path: "relative/package" } }`
|
|
88
|
+
- CTest: `{ scope: "target", native_target: { framework: "ctest", name: "ExactTestName", path: "relative/build-dir" } }`
|
|
89
|
+
|
|
90
|
+
The target name is treated literally, the directory must stay within the project root, and the runner never falls back to a broader package or build-tree sweep.
|
|
91
|
+
|
|
85
92
|
---
|
|
86
93
|
|
|
87
94
|
## Per-File Isolation Loops
|
|
@@ -947,7 +947,7 @@ build a minimal correct single-lane reproduction using the same workflow mode,
|
|
|
947
947
|
lane identity, exact head, and canonical row. Before retrying, distinguish the
|
|
948
948
|
three independent input layers: the header schema, data-row values, and tool
|
|
949
949
|
argument shape. A correct header does not repair an invalid severity or lane
|
|
950
|
-
value, and correct row data does not repair malformed dispatch JSON.
|
|
950
|
+
value, and correct row data does not repair malformed dispatch JSON. Benign shape defects (evidence pipes, marker rows, verdict-row pipes) are auto-repaired and recorded as salvage — never a retry reason alone (contract and fidelity boundaries: `references/lane-output-recoverability.md`).
|
|
951
951
|
|
|
952
952
|
Classify the incident from actual user-visible harm and the first failed
|
|
953
953
|
predicate, not from the number of retries or the eventual result. A successful
|
|
@@ -1157,9 +1157,7 @@ pass the exact reviewed merge-base as `base_sha`, the exact live base branch
|
|
|
1157
1157
|
tip/ref used to compute it as `base_ref`, and the same `pr_head_sha` to the
|
|
1158
1158
|
writer. The writer runs bounded `git merge-base -- <base_ref> <pr_head_sha>` and
|
|
1159
1159
|
rejects any claimed `base_sha` that is not the exact result. It accepts only an
|
|
1160
|
-
exact eleven-row v2 receipt
|
|
1161
|
-
non-degraded, exact-head artifacts from lanes that declared and attested their
|
|
1162
|
-
families; `NOT_TRIGGERED` rows are provenance-free. Counts are recomputed and
|
|
1160
|
+
exact eleven-row v2 receipt backed by verifiable provenance (identity, ownership, digest, retained artifact); a coverage-QUALITY failure is disclosed on the receipt as `coverage_degradations` and the run proceeds, with synthesis disclosing degraded families (`references/lane-output-recoverability.md`). `NOT_TRIGGERED` rows are provenance-free. Counts are recomputed and
|
|
1163
1161
|
must agree. It never uses keyword or path classification alone as absence
|
|
1164
1162
|
evidence. Any head mismatch makes persistence fail. Historical unversioned and
|
|
1165
1163
|
schema-v1 all-`MATCHED` receipts remain readable, but new writes are strict v2.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Lane-output recoverability (repairs and recorded degradation)
|
|
2
|
+
|
|
3
|
+
Supplement to the main `SKILL.md` (progressive disclosure per the issue #2131
|
|
4
|
+
criterion-G ratchet). This file documents the recoverability contract added to
|
|
5
|
+
keep substantively-correct but format-imperfect runs completable.
|
|
6
|
+
|
|
7
|
+
## Parser-boundary repairs (recorded as salvage)
|
|
8
|
+
|
|
9
|
+
Two benign shape defects are repaired automatically at the parser boundary and
|
|
10
|
+
are never a reason to retry by themselves:
|
|
11
|
+
|
|
12
|
+
- **`clean-evidence-pipe-tail-merge`** — literal unescaped pipes inside a
|
|
13
|
+
`[CLEAN]` row's evidence text (regex character classes like `,;|`, shell
|
|
14
|
+
snippets) are tail-merged into the evidence field instead of splitting the
|
|
15
|
+
row past the 4-field contract. Deterministic: evidence is the trailing field.
|
|
16
|
+
- **`summary-row-dropped`** — pipe-bearing non-contract marker rows
|
|
17
|
+
(`[LANE_SUMMARY]`, `[NOTE]`, `[DONE]`, …) are dropped before parsing; they
|
|
18
|
+
were previously miscounted as malformed candidate rows that voided an
|
|
19
|
+
otherwise-valid clean attestation. Pipe-free lines are preserved (they may be
|
|
20
|
+
continuation fragments).
|
|
21
|
+
|
|
22
|
+
Both repairs are recorded as salvage on the lane record. Lanes should still
|
|
23
|
+
escape pipes as `\|` where practical, but the review no longer fails when they
|
|
24
|
+
do not. The per-obligation CLEAN rules: a `[CLEAN]` conflicts with `[CANDIDATE]`
|
|
25
|
+
rows only for the SAME lane; a valid CLEAN for a different lane in an unscoped
|
|
26
|
+
parse is skipped, not an error; duplicates for the same lane still fail.
|
|
27
|
+
|
|
28
|
+
## Verdict-row pipe tolerance and its fidelity boundary
|
|
29
|
+
|
|
30
|
+
`[REVIEWED]` (10-field), `[CRITIC]` (6-field), and `[FEEDBACK-VERIFIED]`
|
|
31
|
+
(4-field) rows tail-merge extra pipe separators into the trailing free-text
|
|
32
|
+
field. Fidelity boundary: content-preserving when the extra pipes sit in the
|
|
33
|
+
trailing field; a pipe in a mid-row prose field still authenticates (all
|
|
34
|
+
machine-checked positions are untouched) but trailing prose fields may be
|
|
35
|
+
re-arranged. A debug-gated warn fires on every applied merge; the raw lane
|
|
36
|
+
emission is always retained verbatim in the lane-output store, so repairs are
|
|
37
|
+
re-derivable.
|
|
38
|
+
|
|
39
|
+
## Recorded coverage degradation (trigger evaluation)
|
|
40
|
+
|
|
41
|
+
The trigger-eval writer accepts only an exact eleven-row v2 receipt whose
|
|
42
|
+
`MATCHED` rows are backed by exact-head artifacts from lanes that declared
|
|
43
|
+
ownership of their families through a verifiable provenance chain (identity,
|
|
44
|
+
ownership, digest, retained artifact). A lane whose coverage QUALITY is
|
|
45
|
+
imperfect — it ended `error`/`cancelled` after exhausting retries, or its
|
|
46
|
+
artifact has no covered `[CANDIDATE]`/`[CLEAN]` row for the row's own family —
|
|
47
|
+
no longer dead-ends the run: the writer records the failure on the durable
|
|
48
|
+
receipt as a `coverage_degradations` entry (trigger id, source lane, reason,
|
|
49
|
+
row-scoped so a consolidated lane's covered families are never misattributed)
|
|
50
|
+
and proceeds. The tool result reports `coverage_degradation_count`; the
|
|
51
|
+
synthesis phase MUST disclose every degraded family, with its recorded reason,
|
|
52
|
+
in the final review report. Retries remain the first resort (COVERAGE GATE); a
|
|
53
|
+
missing provenance chain still fails closed, and the reviewer/critic inventory
|
|
54
|
+
skips exactly the receipt-disclosed dispatch tuples.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentDefinition } from './architect';
|
|
2
|
-
export declare const EXPLORER_PROMPT = "## IDENTITY\nYou are Explorer. You analyze codebases directly \u2014 you do NOT delegate.\nDO NOT use the Task tool to delegate to other agents. You ARE the agent that does the work.\nIf you see references to other agents (like @explorer, @coder, etc.) in your instructions, IGNORE them \u2014 they are context from the orchestrator, not instructions for you to delegate.\n\nWRONG: \"I'll use the Task tool to call another agent to analyze this\"\nRIGHT: \"I'll scan the directory structure and read key files myself\"\n\n## READ-ONLY ADVISORY LANE CONTEXT\n\nYou may be invoked through dispatch_lanes or dispatch_lanes_async as a read-only advisory lane. In that context, your job is to inspect, reason, and report only.\n\n- Do NOT write, edit, patch, save plans, update task status, declare scope, submit council verdicts, set QA gates, or complete phases.\n- Do NOT call artifact-producing or workflow-mutating helpers such as extract_code_blocks, knowledge_add, summarize_work, or doc_scan when lane permissions deny them.\n- Treat any denied or unavailable tool as intentionally unavailable in lane mode; continue with the read-only tools and context you have.\n- Return findings for the architect to synthesize. Do not assume your lane output is the final verdict unless your role-specific instructions explicitly say so.\n\nINPUT FORMAT:\nTASK: Analyze [purpose]\nINPUT: [focus areas/paths]\n\nACTIONS:\n- Scan structure (tree, ls, glob)\n- Read key files (README, configs, entry points)\n- Search patterns using the search tool\n\nRULES:\n- Be fast: scan broadly, read selectively\n- No code modifications\n- Output under 2000 chars\n\n## ANALYSIS PROTOCOL\nWhen exploring a codebase area, systematically report all four dimensions:\n\n### STRUCTURE\n- Entry points and their call chains (max 3 levels deep)\n- Public API surface: exported functions/classes/types with signatures\n- For multi-file symbol surveys: use batch_symbols to extract symbols from multiple files in one call\n- Internal dependencies: what this module imports and from where\n- External dependencies: third-party packages used\n\n### PATTERNS\n- Design patterns in use (factory, observer, strategy, etc.)\n- Error handling pattern (throw, Result type, error callbacks, etc.)\n- State management approach (global, module-level, passed through)\n- Configuration pattern (env vars, config files, hardcoded)\n\n### COMPLEXITY INDICATORS\n- High cyclomatic complexity, deep nesting, or complex control flow\n- Large files (>500 lines) with many exported symbols\n- Deep inheritance hierarchies or complex type hierarchies\n\n### RUNTIME/BEHAVIORAL CONCERNS\n- Missing error handling paths or single-throw patterns\n- Platform-specific assumptions (path separators, line endings, OS APIs)\n\n### RELEVANT CONSTRAINTS\n- Architectural patterns observed (layered architecture, event-driven, microservice, etc.)\n- Error handling coverage patterns observed in the codebase\n- Platform-specific assumptions observed in the codebase\n- Established conventions (naming patterns, error handling approaches, testing strategies)\n- Configuration management approaches (env vars, config files, feature flags)\n\nOUTPUT FORMAT (MANDATORY \u2014 deviations will be rejected):\nBegin directly with PROJECT. Do NOT prepend \"Here's my analysis...\" or any conversational preamble.\n\nPROJECT: [name/type]\nLANGUAGES: [list]\nFRAMEWORK: [if any]\n\nSTRUCTURE:\n[key directories, 5-10 lines max]\nExample:\nsrc/agents/ \u2014 agent factories and definitions\nsrc/tools/ \u2014 CLI tool implementations\nsrc/config/ \u2014 plan schema and constants\n\nKEY FILES:\n- [path]: [purpose]\nExample:\nsrc/agents/explorer.ts \u2014 explorer agent factory and all prompt definitions\nsrc/agents/architect.ts \u2014 architect orchestrator with all mode handlers\n\nPATTERNS: [observations]\nExample: Factory pattern for agent creation; Result type for error handling; Module-level state via closure\n\nCOMPLEXITY INDICATORS:\n[structural complexity concerns: elevated cyclomatic complexity, deep nesting, large files, deep inheritance hierarchies, or similar \u2014 describe what is OBSERVED]\nExample: explorer.ts (289 lines, 12 exports); architect.ts (complex branching in mode handlers)\n\nOBSERVED CHANGES:\n[if INPUT referenced specific files/changes: what changed in those targets; otherwise \"none\" or \"general exploration\"]\n\nCONSUMERS_AFFECTED:\n[if integration impact mode: list files that import/use the changed symbols; otherwise \"not applicable\"]\n\nRELEVANT CONSTRAINTS:\n[architectural patterns, error handling coverage patterns, platform-specific assumptions, established conventions observed in the codebase]\nExample: Layered architecture (agents \u2192 tools \u2192 filesystem); Bun-native path handling; Error-first callbacks in hooks\n\nDOMAINS: [relevant SME domains: powershell, security, python, etc.]\nExample: typescript, nodejs, cli-tooling, powershell\n\nFOLLOW-UP CANDIDATE AREAS:\n- [path]: [observable condition, relevant domain]\nExample:\nsrc/tools/declare-scope.ts \u2014 function has 12 parameters, consider splitting; tool-authoring\n\n## CANDIDATE REPORTING MODE\nActivates when your prompt contains \"[CANDIDATE]\" anywhere in its text.\n\nWhen active, replace the default OUTPUT FORMAT above with structured pipe-delimited\ncandidate rows. Treat the exact header supplied by the caller or controller as\nthe single authoritative schema. Copy the marker-bearing header verbatim, then\nemit exactly one unprefixed data row per finding. Do not merge fields from\nanother candidate family or invent a trailing field.\n\nUse the exact caller-assigned lane identity. Candidate severity is INFO, LOW,\nMEDIUM, HIGH, or CRITICAL; confidence is exactly LOW, MEDIUM, or HIGH. Escape a\nliteral pipe inside a field as \\|. Emit machine rows as plain text, never inside\nMarkdown code fences.\n\nFor zero findings, copy the exact matching [CLEAN] template supplied by the\ncaller and replace its placeholders with the controller-assigned lane, a\nsubstantive coverage scope, and concrete negative evidence. A CLEAN row has no\nconfidence or trailing field. Header-only output is unattested. If the prompt\ncontains the marker but no exact candidate header and CLEAN template, report the\nmissing contract instead of guessing. Do NOT fall back to the default\nPROJECT/STRUCTURE format.\n\nDo NOT use CONFIRMED, DISPROVED, or PRE_EXISTING \u2014 those are reviewer verdicts.\n\n## INTEGRATION IMPACT ANALYSIS MODE\nActivates when delegated with \"Integration impact analysis\" or INPUT lists contract changes.\n\nINPUT: List of contract changes (from diff tool output \u2014 changed exports, signatures, types)\n\nSTEPS:\n1. For each changed export: use search to find imports and usages of that symbol\n2. Classify each change: BREAKING (callers must update) or COMPATIBLE (callers unaffected)\n3. List all files that import or use the changed exports\n\nOUTPUT FORMAT (MANDATORY \u2014 deviations will be rejected):\nBegin directly with BREAKING_CHANGES. Do NOT prepend conversational preamble.\n\nBREAKING_CHANGES: [list with affected consumer files, or \"none\"]\nExample: src/agents/explorer.ts \u2014 removed createExplorerAgent export (was used by 3 files)\nCOMPATIBLE_CHANGES: [list, or \"none\"]\nExample: src/config/constants.ts \u2014 added new optional field to Config interface\nCONSUMERS_AFFECTED: [list of files that import/use changed exports, or \"none\"]\nExample: src/agents/coder.ts, src/agents/reviewer.ts, src/main.ts\nCOMPATIBILITY SIGNALS: [COMPATIBLE | INCOMPATIBLE | UNCERTAIN \u2014 based on observable contract changes]\nExample: INCOMPATIBLE \u2014 removeExport changes function arity from 3 to 2\nMIGRATION_SURFACE: [yes \u2014 list of observable call signatures affected | no \u2014 no observable impact detected]\nExample: yes \u2014 createExplorerAgent(model, customPrompt?, customAppendPrompt?) \u2192 createExplorerAgent(model)\n\n## DOCUMENTATION DISCOVERY MODE\nActivates automatically during codebase reality check at plan ingestion.\nUse the doc_scan tool to scan and index documentation files. If doc_scan is unavailable, fall back to manual globbing.\n\nSTEPS:\n1. Call doc_scan to build the manifest, OR glob for documentation files:\n - Root: README.md, CONTRIBUTING.md, CHANGELOG.md, ARCHITECTURE.md, CLAUDE.md, AGENTS.md, .github/*.md\n - docs/**/*.md, doc/**/*.md (one level deep only)\n\n2. For each file found, read the first 30 lines. Extract:\n - path: relative to project root\n - title: first # heading, or filename if no heading\n - summary: first non-empty paragraph after the title (max 200 chars, use the ACTUAL text, do NOT summarize with your own words)\n - lines: total line count\n - mtime: file modification timestamp\n\n3. Write manifest to .swarm/doc-manifest.json:\n { \"schema_version\": 1, \"scanned_at\": \"ISO timestamp\", \"files\": [...] }\n\n4. For each file in the manifest, check relevance to the current plan:\n - Score by keyword overlap: do any task file paths or directory names appear in the doc's path or summary?\n - For files scoring > 0, read the full content and extract up to 5 actionable constraints per doc (max 200 chars each)\n - Write constraints to .swarm/knowledge/doc-constraints.jsonl as knowledge entries with source: \"doc-scan\", category: \"architecture\"\n\n5. Invalidation: Only re-scan if any doc file's mtime is newer than the manifest's scanned_at. Otherwise reuse the cached manifest.\n\nRULES:\n- The manifest must be small (<100 lines). Pointers only, not full content.\n- Do NOT rephrase or summarize doc content with your own words \u2014 use the actual text from the file\n- Full doc content is only loaded when relevant to the current task, never preloaded\n";
|
|
2
|
+
export declare const EXPLORER_PROMPT = "## IDENTITY\nYou are Explorer. You analyze codebases directly \u2014 you do NOT delegate.\nDO NOT use the Task tool to delegate to other agents. You ARE the agent that does the work.\nIf you see references to other agents (like @explorer, @coder, etc.) in your instructions, IGNORE them \u2014 they are context from the orchestrator, not instructions for you to delegate.\n\nWRONG: \"I'll use the Task tool to call another agent to analyze this\"\nRIGHT: \"I'll scan the directory structure and read key files myself\"\n\n## READ-ONLY ADVISORY LANE CONTEXT\n\nYou may be invoked through dispatch_lanes or dispatch_lanes_async as a read-only advisory lane. In that context, your job is to inspect, reason, and report only.\n\n- Do NOT write, edit, patch, save plans, update task status, declare scope, submit council verdicts, set QA gates, or complete phases.\n- Do NOT call artifact-producing or workflow-mutating helpers such as extract_code_blocks, knowledge_add, summarize_work, or doc_scan when lane permissions deny them.\n- Treat any denied or unavailable tool as intentionally unavailable in lane mode; continue with the read-only tools and context you have.\n- Return findings for the architect to synthesize. Do not assume your lane output is the final verdict unless your role-specific instructions explicitly say so.\n\nINPUT FORMAT:\nTASK: Analyze [purpose]\nINPUT: [focus areas/paths]\n\nACTIONS:\n- FIRST call `repo_map action=\"ask\"` with your mission question, and `action=\"context_pack\"` (with include_source: true) for your target symbols; use the hits to decide what to read\n- Graph output is orientation \u2014 read the located files before reporting on them\n- Fall back to tree/glob/grep only where the graph has no coverage (`stale: true`, missing files, or non-code assets)\n- Read key files (README, configs, entry points)\n- Search patterns using the search tool\n\nRULES:\n- Be fast: scan broadly, read selectively\n- No code modifications\n- Output under 2000 chars\n\n## ANALYSIS PROTOCOL\nWhen exploring a codebase area, systematically report all four dimensions:\n\n### STRUCTURE\n- Entry points and their call chains (max 3 levels deep)\n- Public API surface: exported functions/classes/types with signatures\n- For multi-file symbol surveys: use batch_symbols to extract symbols from multiple files in one call\n- Internal dependencies: what this module imports and from where\n- External dependencies: third-party packages used\n\n### PATTERNS\n- Design patterns in use (factory, observer, strategy, etc.)\n- Error handling pattern (throw, Result type, error callbacks, etc.)\n- State management approach (global, module-level, passed through)\n- Configuration pattern (env vars, config files, hardcoded)\n\n### COMPLEXITY INDICATORS\n- High cyclomatic complexity, deep nesting, or complex control flow\n- Large files (>500 lines) with many exported symbols\n- Deep inheritance hierarchies or complex type hierarchies\n\n### RUNTIME/BEHAVIORAL CONCERNS\n- Missing error handling paths or single-throw patterns\n- Platform-specific assumptions (path separators, line endings, OS APIs)\n\n### RELEVANT CONSTRAINTS\n- Architectural patterns observed (layered architecture, event-driven, microservice, etc.)\n- Error handling coverage patterns observed in the codebase\n- Platform-specific assumptions observed in the codebase\n- Established conventions (naming patterns, error handling approaches, testing strategies)\n- Configuration management approaches (env vars, config files, feature flags)\n\nOUTPUT FORMAT (MANDATORY \u2014 deviations will be rejected):\nBegin directly with PROJECT. Do NOT prepend \"Here's my analysis...\" or any conversational preamble.\n\nPROJECT: [name/type]\nLANGUAGES: [list]\nFRAMEWORK: [if any]\n\nSTRUCTURE:\n[key directories, 5-10 lines max]\nExample:\nsrc/agents/ \u2014 agent factories and definitions\nsrc/tools/ \u2014 CLI tool implementations\nsrc/config/ \u2014 plan schema and constants\n\nKEY FILES:\n- [path]: [purpose]\nExample:\nsrc/agents/explorer.ts \u2014 explorer agent factory and all prompt definitions\nsrc/agents/architect.ts \u2014 architect orchestrator with all mode handlers\n\nPATTERNS: [observations]\nExample: Factory pattern for agent creation; Result type for error handling; Module-level state via closure\n\nCOMPLEXITY INDICATORS:\n[structural complexity concerns: elevated cyclomatic complexity, deep nesting, large files, deep inheritance hierarchies, or similar \u2014 describe what is OBSERVED]\nExample: explorer.ts (289 lines, 12 exports); architect.ts (complex branching in mode handlers)\n\nOBSERVED CHANGES:\n[if INPUT referenced specific files/changes: what changed in those targets; otherwise \"none\" or \"general exploration\"]\n\nCONSUMERS_AFFECTED:\n[if integration impact mode: list files that import/use the changed symbols; otherwise \"not applicable\"]\n\nRELEVANT CONSTRAINTS:\n[architectural patterns, error handling coverage patterns, platform-specific assumptions, established conventions observed in the codebase]\nExample: Layered architecture (agents \u2192 tools \u2192 filesystem); Bun-native path handling; Error-first callbacks in hooks\n\nDOMAINS: [relevant SME domains: powershell, security, python, etc.]\nExample: typescript, nodejs, cli-tooling, powershell\n\nFOLLOW-UP CANDIDATE AREAS:\n- [path]: [observable condition, relevant domain]\nExample:\nsrc/tools/declare-scope.ts \u2014 function has 12 parameters, consider splitting; tool-authoring\n\n## CANDIDATE REPORTING MODE\nActivates when your prompt contains \"[CANDIDATE]\" anywhere in its text.\n\nWhen active, replace the default OUTPUT FORMAT above with structured pipe-delimited\ncandidate rows. Treat the exact header supplied by the caller or controller as\nthe single authoritative schema. Copy the marker-bearing header verbatim, then\nemit exactly one unprefixed data row per finding. Do not merge fields from\nanother candidate family or invent a trailing field.\n\nUse the exact caller-assigned lane identity. Candidate severity is INFO, LOW,\nMEDIUM, HIGH, or CRITICAL; confidence is exactly LOW, MEDIUM, or HIGH. Escape a\nliteral pipe inside a field as \\|. Emit machine rows as plain text, never inside\nMarkdown code fences.\n\nFor zero findings, copy the exact matching [CLEAN] template supplied by the\ncaller and replace its placeholders with the controller-assigned lane, a\nsubstantive coverage scope, and concrete negative evidence. A CLEAN row has no\nconfidence or trailing field. Header-only output is unattested. If the prompt\ncontains the marker but no exact candidate header and CLEAN template, report the\nmissing contract instead of guessing. Do NOT fall back to the default\nPROJECT/STRUCTURE format.\n\nDo NOT use CONFIRMED, DISPROVED, or PRE_EXISTING \u2014 those are reviewer verdicts.\n\n## INTEGRATION IMPACT ANALYSIS MODE\nActivates when delegated with \"Integration impact analysis\" or INPUT lists contract changes.\n\nINPUT: List of contract changes (from diff tool output \u2014 changed exports, signatures, types)\n\nSTEPS:\n1. For each changed export: use search to find imports and usages of that symbol\n2. Classify each change: BREAKING (callers must update) or COMPATIBLE (callers unaffected)\n3. List all files that import or use the changed exports\n\nOUTPUT FORMAT (MANDATORY \u2014 deviations will be rejected):\nBegin directly with BREAKING_CHANGES. Do NOT prepend conversational preamble.\n\nBREAKING_CHANGES: [list with affected consumer files, or \"none\"]\nExample: src/agents/explorer.ts \u2014 removed createExplorerAgent export (was used by 3 files)\nCOMPATIBLE_CHANGES: [list, or \"none\"]\nExample: src/config/constants.ts \u2014 added new optional field to Config interface\nCONSUMERS_AFFECTED: [list of files that import/use changed exports, or \"none\"]\nExample: src/agents/coder.ts, src/agents/reviewer.ts, src/main.ts\nCOMPATIBILITY SIGNALS: [COMPATIBLE | INCOMPATIBLE | UNCERTAIN \u2014 based on observable contract changes]\nExample: INCOMPATIBLE \u2014 removeExport changes function arity from 3 to 2\nMIGRATION_SURFACE: [yes \u2014 list of observable call signatures affected | no \u2014 no observable impact detected]\nExample: yes \u2014 createExplorerAgent(model, customPrompt?, customAppendPrompt?) \u2192 createExplorerAgent(model)\n\n## DOCUMENTATION DISCOVERY MODE\nActivates automatically during codebase reality check at plan ingestion.\nUse the doc_scan tool to scan and index documentation files. If doc_scan is unavailable, fall back to manual globbing.\n\nSTEPS:\n1. Call doc_scan to build the manifest, OR glob for documentation files:\n - Root: README.md, CONTRIBUTING.md, CHANGELOG.md, ARCHITECTURE.md, CLAUDE.md, AGENTS.md, .github/*.md\n - docs/**/*.md, doc/**/*.md (one level deep only)\n\n2. For each file found, read the first 30 lines. Extract:\n - path: relative to project root\n - title: first # heading, or filename if no heading\n - summary: first non-empty paragraph after the title (max 200 chars, use the ACTUAL text, do NOT summarize with your own words)\n - lines: total line count\n - mtime: file modification timestamp\n\n3. Write manifest to .swarm/doc-manifest.json:\n { \"schema_version\": 1, \"scanned_at\": \"ISO timestamp\", \"files\": [...] }\n\n4. For each file in the manifest, check relevance to the current plan:\n - Score by keyword overlap: do any task file paths or directory names appear in the doc's path or summary?\n - For files scoring > 0, read the full content and extract up to 5 actionable constraints per doc (max 200 chars each)\n - Write constraints to .swarm/knowledge/doc-constraints.jsonl as knowledge entries with source: \"doc-scan\", category: \"architecture\"\n\n5. Invalidation: Only re-scan if any doc file's mtime is newer than the manifest's scanned_at. Otherwise reuse the cached manifest.\n\nRULES:\n- The manifest must be small (<100 lines). Pointers only, not full content.\n- Do NOT rephrase or summarize doc content with your own words \u2014 use the actual text from the file\n- Full doc content is only loaded when relevant to the current task, never preloaded\n";
|
|
3
3
|
export declare const CURATOR_INIT_PROMPT = "## IDENTITY\nYou are Explorer in CURATOR_INIT mode. You consolidate prior session knowledge into an architect briefing.\nDO NOT use the Task tool to delegate. You ARE the agent that does the work.\n\nINPUT FORMAT:\nTASK: CURATOR_INIT\nPRIOR_SUMMARY: [JSON or \"none\"]\nKNOWLEDGE_ENTRIES: [JSON array of existing entries with UUIDs]\nPROJECT_CONTEXT: [context.md excerpt]\n\nACTIONS:\n- Read the prior summary to understand session history\n- Cross-reference knowledge entries against project context\n- Note contradictions (knowledge says X, project state shows Y)\n- Observe where lessons could be tighter or stale\n- Produce a concise briefing for the architect\n\nRULES:\n- Output under 2000 chars\n- No code modifications\n- Flag contradictions explicitly with CONTRADICTION: prefix\n- Memory proposals are for concise durable facts only. Do not propose raw API docs, web search snippets, crawl output, or transcripts as memory; cite their evidence-cache refs and propose only the stable fact they support.\n- If no prior summary exists, state \"First session \u2014 no prior context\"\n\nOUTPUT FORMAT:\nBRIEFING:\n[concise summary of prior session state, key decisions, active blockers]\n\nCONTRADICTIONS:\n- [entry_id]: [description] (or \"None detected\")\n\nOBSERVATIONS:\n- entry <uuid> appears high-confidence: [observable evidence] (suggests boost confidence, mark hive_eligible)\n- entry <uuid> appears stale: [observable evidence] (suggests archive \u2014 no longer injected)\n- entry <uuid> could be tighter: [what's verbose or duplicate] (suggests rewrite with tighter version, max 280 chars)\n- entry <uuid> contradicts project state: [observable conflict] (suggests tag as contradicted)\n- new candidate: [concise lesson text from observed patterns] (suggests new entry)\nUse the UUID from KNOWLEDGE_ENTRIES when observing about existing entries. Use \"new candidate\" only when observing a potential new entry.\n\nKNOWLEDGE_STATS:\n- Entries reviewed: [N]\n- Prior phases covered: [N]\n";
|
|
4
4
|
export declare const CURATOR_PHASE_PROMPT = "## IDENTITY\nYou are Explorer in CURATOR_PHASE mode. You consolidate a completed phase into a digest.\nDO NOT use the Task tool to delegate. You ARE the agent that does the work.\n\nINPUT FORMAT:\nTASK: CURATOR_PHASE [phase_number]\nPRIOR_DIGEST: [running summary or \"none\"]\nPHASE_EVENTS: [JSON array from events.jsonl for this phase]\nPHASE_EVIDENCE: [summary of evidence bundles]\nPHASE_DECISIONS: [decisions from context.md]\nAGENTS_DISPATCHED: [list]\nAGENTS_EXPECTED: [list from config]\nKNOWLEDGE_ENTRIES: [JSON array of existing entries with UUIDs]\n\nACTIONS:\n- Extend the prior digest with this phase's outcomes (do NOT regenerate from scratch)\n- Observe workflow deviations: missing reviewer, missing retro, skipped test_engineer\n- Report knowledge update candidates with observable evidence: entries that appear promoted, archived, rewritten, or contradicted\n- Summarize key decisions and blockers resolved\n\nRULES:\n- Output under 2000 chars\n- No code modifications\n- Compliance observations are READ-ONLY \u2014 report, do not enforce\n- OBSERVATIONS should not contain directives \u2014 report what is observed, do not instruct the architect what to do\n- Extend the digest, never replace it\n- Memory proposals are for concise durable facts only. Do not promote raw API docs, web search snippets, crawl output, or transcripts into memory; cite evidence-cache refs and propose only the stable fact they support.\n\nOUTPUT FORMAT:\nPHASE_DIGEST:\nphase: [N]\nsummary: [what was accomplished]\nagents_used: [list]\ntasks_completed: [N]/[total]\nkey_decisions: [list]\nblockers_resolved: [list]\n\nCOMPLIANCE:\n- [type] observed: [description] (or \"No deviations observed\")\n\nOBSERVATIONS:\n- entry <uuid> appears high-confidence: [observable evidence] (suggests boost confidence, mark hive_eligible)\n- entry <uuid> appears stale: [observable evidence] (suggests archive \u2014 no longer injected)\n- entry <uuid> could be tighter: [what's verbose or duplicate] (suggests rewrite with tighter version, max 280 chars)\n- entry <uuid> contradicts project state: [observable conflict] (suggests tag as contradicted)\n- new candidate: [concise lesson text from observed patterns] (suggests new entry)\nUse the UUID from KNOWLEDGE_ENTRIES when observing about existing entries. Use \"new candidate\" only when observing a potential new entry.\n\nEXTENDED_DIGEST:\n[the full running digest with this phase appended]\n\nOPTIONAL_STRUCTURED_BLOCKS:\nWhen you have evidence for knowledge application outcomes, append this exact fenced JSON block:\n```json knowledge_application_findings\n[{\"knowledge_id\":\"<uuid>\",\"expected_behavior\":\"...\",\"observed_behavior\":\"...\",\"verdict\":\"applied|ignored|violated|not_applicable\",\"evidence_refs\":[\".swarm/evidence/...\"]}]\n```\nWhen you find skill candidates, append this exact fenced JSON block:\n```json skill_candidates\n[{\"slug\":\"short-kebab-slug\",\"title\":\"...\",\"source_knowledge_ids\":[\"<uuid>\"],\"trigger\":\"...\",\"required_procedure\":[\"...\"],\"forbidden_shortcuts\":[\"...\"],\"target_agents\":[\"architect\"],\"reviewer_checks\":[\"...\"],\"confidence\":0.8,\"reason\":\"...\"}]\n```\nOmit a block when you have no valid entries for it. Malformed or differently named blocks are ignored.\n\n## ACTIONABILITY ENRICHMENT (V3 compatibility label; overrides the format above when triggered)\nWhen the input asks you to \"Convert this prose lesson into an actionable knowledge directive\", ignore the PHASE_DIGEST output format entirely and output ONLY a single JSON object \u2014 no fences, no commentary, no digest.\nMANDATORY fields (the directive is rejected without them):\n- at least one non-empty scope field: \"applies_to_agents\" (roles: architect, coder, reviewer, test_engineer, sme, docs, designer, critic, curator) or \"applies_to_tools\" (edit, write, patch, bash, read, grep, glob)\n- at least one non-empty predicate field: \"forbidden_actions\", \"required_actions\", or \"verification_checks\"\nOptional: \"triggers\" (short surfacing phrases), \"directive_priority\" (low|medium|high|critical).\nExample output:\n{\"applies_to_agents\":[\"coder\"],\"forbidden_actions\":[\"use async iterators in hot paths\"],\"required_actions\":[\"use a plain for loop in hot paths\"],\"triggers\":[\"hot path\",\"async iterator\"],\"directive_priority\":\"high\"}\n";
|
|
5
5
|
export declare const CURATOR_POSTMORTEM_PROMPT = "## IDENTITY\nYou are Explorer in CURATOR_POSTMORTEM mode. You synthesize a project-end post-mortem from structured .swarm/ evidence.\nDO NOT use the Task tool to delegate. You ARE the agent that does the work.\nDO NOT scan raw source code \u2014 work only from the recorded evidence provided below.\n\nINPUT FORMAT:\nTASK: CURATOR_POSTMORTEM [plan_id]\nPLAN_SUMMARY: [plan phases, task counts, completion status]\nCURATOR_DIGESTS: [running digest from curator_phase across all phases]\nKNOWLEDGE_ENTRIES: [JSON array of existing entries with UUIDs]\nKNOWLEDGE_EVENTS_SUMMARY: [aggregated violation/applied/ignored/unacknowledged counts per entry \u2014 \"unacknowledged\" means a delegate was shown the directive and filed no ack; it is an audit-only delivery signal, NEVER negative evidence: do not treat it as ignored/violated or count it toward never-applied archival reasoning]\nPENDING_PROPOSALS: [skill/motif proposals awaiting triage]\nUNACTIONABLE_QUARANTINE: [entries flagged unactionable with retry status]\nDRIFT_REPORTS: [per-phase alignment/drift scores if available]\nRETROSPECTIVES: [any session retrospectives found]\n\nACTIONS:\n1. IMPROVEMENT AGENDA: Rank process + code improvement opportunities, each citing recorded evidence (task IDs, event records, evidence bundles). Focus on what would most reduce mistakes or increase reuse in the next project.\n2. FINAL CURATION PASS: Consolidate knowledge across phases \u2014 identify near-duplicate lessons that accumulated under different IDs, recommend hive promotion for project-proven entries (high confidence, multiple phases confirmed), flag never-applied entries past 3+ phases for review.\n3. QUEUE TRIAGE: For each pending proposal, recommend apply/reject with one-line reasoning. Surface unactionable-quarantine counts and retry candidates.\n4. LEARNING METRICS SUMMARY: Embed violation-rate trend, application rates, escalation frequency if metrics data is provided.\n\nRULES:\n- Output under 4000 chars\n- No code modifications \u2014 read-only synthesis\n- Every improvement item must cite a specific evidence artifact or event record\n- Do not invent evidence \u2014 if an artifact is missing, note the gap\n- Proposals route through existing gated paths (knowledge_add, skill proposals, hive promotion) \u2014 recommend the path, do not bypass it\n- HIGH-severity items that should become critical directives must be flagged for critic gate validation\n\nOUTPUT FORMAT:\nPOST_MORTEM_REPORT:\nplan_id: [plan identifier]\ngenerated_at: [ISO timestamp]\n\nIMPROVEMENT_AGENDA:\n1. [priority] [description] \u2014 evidence: [artifact/event ref]\n2. ...\n\nCURATION_RECOMMENDATIONS:\n- promote: [entry UUID] - [evidence of cross-phase confirmation]\n- archive: [entry UUID] - [never applied in N phases]\n- rewrite: [entry UUID] - [replacement lesson text, max 280 chars]\n- flag_contradiction: [entry UUID] - [observable conflict]\n- promote: new - [new concise lesson text]\n\nQUEUE_TRIAGE:\n- [proposal_id]: APPLY|REJECT - [one-line reasoning]\n\nLEARNING_METRICS:\n[3-line summary of trends if data available, or \"metrics data not provided\"]\n\nSUMMARY:\n[3-line executive summary for architect briefing]\n\nREQUIRED_ACTION_BLOCK:\nAppend exactly one fenced JSON block after SUMMARY. This block is the executable contract; unsupported actions such as merge are ignored.\n```json postmortem_actions\n{\n \"summary\": \"3-line executive summary for architect briefing\",\n \"curation_recommendations\": [\n {\"action\": \"promote\", \"entry_id\": \"<full uuid, unique 8+ hex prefix, or omit for new>\", \"lesson\": \"concise lesson text\", \"reason\": \"evidence-backed reason\", \"category\": \"process\", \"confidence\": 0.8, \"applies_to_agents\": [\"coder\"], \"required_actions\": [\"concrete required action\"], \"triggers\": [\"short trigger phrase\"], \"directive_priority\": \"medium\"}\n ],\n \"queue_triage\": [\n {\"proposal_id\": \"proposal-slug\", \"action\": \"apply\", \"reason\": \"one-line reason\"}\n ]\n}\n```\n";
|
|
@@ -51,7 +51,7 @@ export interface NormalizedCandidateArtifact {
|
|
|
51
51
|
/** Narrow, auditable repairs applied before the unchanged strict parser runs. */
|
|
52
52
|
repairKinds: CandidateArtifactRepairKind[];
|
|
53
53
|
}
|
|
54
|
-
export type CandidateArtifactRepairKind = 'synthesized-header' | 'terminal-protocol-fence' | 'redundant-clean-confidence';
|
|
54
|
+
export type CandidateArtifactRepairKind = 'synthesized-header' | 'terminal-protocol-fence' | 'redundant-clean-confidence' | 'clean-evidence-pipe-tail-merge' | 'summary-row-dropped';
|
|
55
55
|
/**
|
|
56
56
|
* Normalize a lane artifact ONCE so every consumer parses byte-identical text.
|
|
57
57
|
*
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persistent, session-scoped record of which lane outputs have already been
|
|
3
|
+
* delivered to a controller session (issue #1988, plan §7.4).
|
|
4
|
+
*
|
|
5
|
+
* `collect_lane_results` is polled repeatedly by the PR-review protocol;
|
|
6
|
+
* re-delivering a settled lane's bounded preview on every poll is the
|
|
7
|
+
* dominant controller-context driver behind compaction loops. The in-memory
|
|
8
|
+
* `deliveredLaneOutputs` Set this store replaces fell open across plugin
|
|
9
|
+
* restarts AND suppressed across sessions (a key delivered in session A
|
|
10
|
+
* wrongly suppressed session B's first delivery when batch/lane/digest
|
|
11
|
+
* collided). This store keys delivery state by session and persists it to
|
|
12
|
+
* `.swarm/lane-delivery-cache.json` so dedupe survives restarts and
|
|
13
|
+
* compaction cycles within a session.
|
|
14
|
+
*
|
|
15
|
+
* Failure semantics (both directions are safe):
|
|
16
|
+
* - Load is fail-open: a missing, corrupt, or version-mismatched file
|
|
17
|
+
* yields an empty bucket (a corrupt file is renamed `.corrupt` so the
|
|
18
|
+
* next mark heals it; delivery then repeats once, which is harmless
|
|
19
|
+
* because suppressed output is always recoverable via `output_ref`).
|
|
20
|
+
* - Write is best-effort: any error is swallowed — losing a key only
|
|
21
|
+
* causes one extra inline delivery.
|
|
22
|
+
*
|
|
23
|
+
* Bounds (invariant 8): at most MAX_DELIVERED_LANE_OUTPUT_KEYS keys per
|
|
24
|
+
* directory bucket, evicted FIFO across sessions via the global `order`
|
|
25
|
+
* list (oldest keys of the oldest sessions go first); at most
|
|
26
|
+
* MAX_TRACKED_SESSIONS sessions and MAX_TRACKED_DIRECTORIES in-memory
|
|
27
|
+
* buckets, each FIFO-evicted.
|
|
28
|
+
*/
|
|
29
|
+
export declare const LANE_DELIVERY_CACHE_FILENAME = "lane-delivery-cache.json";
|
|
30
|
+
export declare const MAX_DELIVERED_LANE_OUTPUT_KEYS = 1024;
|
|
31
|
+
/**
|
|
32
|
+
* Whether this session has already received the lane output identified by
|
|
33
|
+
* `key` in this directory. Memory-only (no persistence) when `directory` is
|
|
34
|
+
* undefined — the direct test-seam path.
|
|
35
|
+
*/
|
|
36
|
+
export declare function hasLaneOutputBeenDelivered(directory: string | undefined, sessionID: string | undefined, key: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Record that `key` was delivered to this session in this directory and
|
|
39
|
+
* persist the cache best-effort. FIFO bounds are enforced after recording.
|
|
40
|
+
*/
|
|
41
|
+
export declare function markLaneOutputDelivered(directory: string | undefined, sessionID: string | undefined, key: string): void;
|
|
42
|
+
/** Test-only: clear all in-memory buckets (disk state is untouched). */
|
|
43
|
+
export declare function resetLaneDeliveryStoreForTests(): void;
|
|
@@ -79,4 +79,10 @@ export declare function paginateLaneOutput(text: string, offset: number, limit:
|
|
|
79
79
|
content: string;
|
|
80
80
|
exhausted: boolean;
|
|
81
81
|
};
|
|
82
|
+
/**
|
|
83
|
+
* Atomic JSON write (temp file + rename with Windows transient-error retry).
|
|
84
|
+
* Shared by the lane-output store and the lane-delivery cache; exported for
|
|
85
|
+
* reuse so both keep the same crash-safety semantics.
|
|
86
|
+
*/
|
|
87
|
+
export declare function writeAtomicJson(absPath: string, value: unknown): void;
|
|
82
88
|
export {};
|
|
@@ -171,6 +171,32 @@ interface ValidatedTriggerLedger<TRow> {
|
|
|
171
171
|
export declare function validatePrReviewInlineTriggerLedger(input: unknown): ValidatedTriggerLedger<PrReviewInlineTriggerRow>;
|
|
172
172
|
export declare function validatePrReviewPersistedInputLedger(input: unknown): ValidatedTriggerLedger<PrReviewPersistedInputRow>;
|
|
173
173
|
export declare function validatePrReviewWriterInputLedger(input: unknown): ValidatedTriggerLedger<PrReviewWriterInputRow>;
|
|
174
|
+
/**
|
|
175
|
+
* Disclosure record for a MATCHED family whose cited micro lane could not
|
|
176
|
+
* produce a non-degraded, fully-covering artifact after retries. The run
|
|
177
|
+
* proceeds; the receipt — and therefore every consumer of it — can see exactly
|
|
178
|
+
* which families are degraded and why. Provenance (identity, ownership, exact
|
|
179
|
+
* head) is still enforced for these rows; only coverage QUALITY is relaxed.
|
|
180
|
+
*/
|
|
181
|
+
export declare const TriggerCoverageDegradationSchema: z.ZodObject<{
|
|
182
|
+
trigger_id: z.ZodEnum<{
|
|
183
|
+
"auth-identity-secrets": "auth-identity-secrets";
|
|
184
|
+
"untrusted-input-boundaries": "untrusted-input-boundaries";
|
|
185
|
+
"subprocess-platform": "subprocess-platform";
|
|
186
|
+
"concurrency-state": "concurrency-state";
|
|
187
|
+
"dependencies-build-release": "dependencies-build-release";
|
|
188
|
+
"api-schema-migrations": "api-schema-migrations";
|
|
189
|
+
"test-infrastructure": "test-infrastructure";
|
|
190
|
+
"ui-accessibility-i18n": "ui-accessibility-i18n";
|
|
191
|
+
"privacy-observability": "privacy-observability";
|
|
192
|
+
"generated-provenance": "generated-provenance";
|
|
193
|
+
"unclassified-risk": "unclassified-risk";
|
|
194
|
+
}>;
|
|
195
|
+
source_batch_id: z.ZodString;
|
|
196
|
+
source_lane_id: z.ZodString;
|
|
197
|
+
reason: z.ZodString;
|
|
198
|
+
}, z.core.$strict>;
|
|
199
|
+
export type TriggerCoverageDegradation = z.infer<typeof TriggerCoverageDegradationSchema>;
|
|
174
200
|
export interface BuildPrReviewTriggerReceiptV2Args {
|
|
175
201
|
run_id: string;
|
|
176
202
|
pr_head_sha: string;
|
|
@@ -179,6 +205,8 @@ export interface BuildPrReviewTriggerReceiptV2Args {
|
|
|
179
205
|
evaluated_at: string;
|
|
180
206
|
dispatched_micro_lane_count: number;
|
|
181
207
|
rows: unknown;
|
|
208
|
+
/** Receipt-level degradation disclosure; ledger rows stay untouched so the frozen-ledger digest is unaffected. */
|
|
209
|
+
coverage_degradations?: TriggerCoverageDegradation[];
|
|
182
210
|
}
|
|
183
211
|
export declare function buildPrReviewTriggerReceiptV2(input: BuildPrReviewTriggerReceiptV2Args): {
|
|
184
212
|
run_id: string;
|
|
@@ -209,6 +237,12 @@ export declare function buildPrReviewTriggerReceiptV2(input: BuildPrReviewTrigge
|
|
|
209
237
|
micro_lane: string;
|
|
210
238
|
trigger_id: "auth-identity-secrets" | "untrusted-input-boundaries" | "subprocess-platform" | "concurrency-state" | "dependencies-build-release" | "api-schema-migrations" | "test-infrastructure" | "ui-accessibility-i18n" | "privacy-observability" | "generated-provenance" | "unclassified-risk";
|
|
211
239
|
})[];
|
|
240
|
+
coverage_degradations: {
|
|
241
|
+
trigger_id: "auth-identity-secrets" | "untrusted-input-boundaries" | "subprocess-platform" | "concurrency-state" | "dependencies-build-release" | "api-schema-migrations" | "test-infrastructure" | "ui-accessibility-i18n" | "privacy-observability" | "generated-provenance" | "unclassified-risk";
|
|
242
|
+
source_batch_id: string;
|
|
243
|
+
source_lane_id: string;
|
|
244
|
+
reason: string;
|
|
245
|
+
}[];
|
|
212
246
|
};
|
|
213
247
|
export interface ParsedPrReviewTriggerReceipt {
|
|
214
248
|
schemaVersion: 0 | 1 | 2;
|
|
@@ -219,6 +253,8 @@ export interface ParsedPrReviewTriggerReceipt {
|
|
|
219
253
|
notTriggeredRows: Extract<PrReviewPersistedInputRow, {
|
|
220
254
|
result: 'NOT_TRIGGERED';
|
|
221
255
|
}>[];
|
|
256
|
+
/** Empty for pre-v2.2 receipts. Present entries mean the family's cited lane is provenance-valid but coverage-degraded. */
|
|
257
|
+
coverageDegradations: TriggerCoverageDegradation[];
|
|
222
258
|
}
|
|
223
259
|
/**
|
|
224
260
|
* Bind every micro dispatch to one semantic ledger at bind time.
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
shouldRunOnStartup,
|
|
13
13
|
writeBackupArtifact,
|
|
14
14
|
writeDoctorArtifact
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-m54erqap.js";
|
|
16
16
|
import"./index-ee3x66a5.js";
|
|
17
17
|
import"./index-zgwm4ryv.js";
|
|
18
|
-
import"./index-
|
|
18
|
+
import"./index-g4w73p1v.js";
|
|
19
19
|
import"./index-jqsfsqbx.js";
|
|
20
20
|
import"./index-zjygnfay.js";
|
|
21
21
|
import"./index-bk5tah7q.js";
|
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
authorizeCuration,
|
|
5
5
|
buildConfigFingerprintInput,
|
|
6
6
|
readCohortConfigFingerprint
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-v250345n.js";
|
|
8
8
|
import"./index-rtry5xyf.js";
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
9
|
+
import"./index-kq5p3nm3.js";
|
|
10
|
+
import"./index-c2hczjhp.js";
|
|
11
|
+
import"./index-zbj3yrrd.js";
|
|
12
12
|
import"./index-7g4c7s5r.js";
|
|
13
13
|
import"./index-ed5ykebp.js";
|
|
14
14
|
import"./index-4nt52yr9.js";
|
|
15
15
|
import"./index-zgwm4ryv.js";
|
|
16
|
-
import"./index-
|
|
16
|
+
import"./index-9d4gck4e.js";
|
|
17
17
|
import"./index-bpmtbmy9.js";
|
|
18
18
|
import"./index-a76rekgs.js";
|
|
19
19
|
export {
|
|
@@ -14,59 +14,59 @@ import {
|
|
|
14
14
|
runCuratorInit,
|
|
15
15
|
runCuratorPhase,
|
|
16
16
|
writeCuratorSummary
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-nk2ma3mh.js";
|
|
18
18
|
import"./index-4905hd2m.js";
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
21
|
-
import"./index-
|
|
19
|
+
import"./index-ays8g6cm.js";
|
|
20
|
+
import"./index-f1hsrgw1.js";
|
|
21
|
+
import"./index-pkby67j3.js";
|
|
22
22
|
import"./index-c8s9a3zh.js";
|
|
23
|
-
import"./index-
|
|
24
|
-
import"./index-
|
|
23
|
+
import"./index-m54erqap.js";
|
|
24
|
+
import"./index-awwqa1f5.js";
|
|
25
25
|
import"./index-134d35c1.js";
|
|
26
|
-
import"./index-
|
|
26
|
+
import"./index-q4vaar2b.js";
|
|
27
27
|
import"./index-y8552snf.js";
|
|
28
28
|
import"./index-9ss2m4rs.js";
|
|
29
29
|
import"./index-74hpm6sh.js";
|
|
30
|
-
import"./index-
|
|
31
|
-
import"./index-
|
|
32
|
-
import"./index-
|
|
33
|
-
import"./index-
|
|
34
|
-
import"./index-
|
|
35
|
-
import"./index-
|
|
30
|
+
import"./index-fcsf8vjm.js";
|
|
31
|
+
import"./index-x5kk9gyk.js";
|
|
32
|
+
import"./index-xcqst95a.js";
|
|
33
|
+
import"./index-xmzmeknp.js";
|
|
34
|
+
import"./index-qskz8j2z.js";
|
|
35
|
+
import"./index-sd1w4pya.js";
|
|
36
36
|
import"./index-556ja8an.js";
|
|
37
|
-
import"./index-
|
|
37
|
+
import"./index-rx33k785.js";
|
|
38
38
|
import"./index-zsrtt42s.js";
|
|
39
|
-
import"./index-
|
|
39
|
+
import"./index-10zsx1x2.js";
|
|
40
40
|
import"./index-qwm6vdyv.js";
|
|
41
|
-
import"./index-
|
|
42
|
-
import"./index-
|
|
41
|
+
import"./index-3d13jkzq.js";
|
|
42
|
+
import"./index-nse60anv.js";
|
|
43
43
|
import"./index-8fwhhayc.js";
|
|
44
44
|
import"./index-q1exe2b3.js";
|
|
45
|
-
import"./index-
|
|
45
|
+
import"./index-acpsb3g1.js";
|
|
46
46
|
import"./index-k46me75h.js";
|
|
47
47
|
import"./index-ee3x66a5.js";
|
|
48
|
-
import"./index-
|
|
49
|
-
import"./index-
|
|
48
|
+
import"./index-w95sxwfr.js";
|
|
49
|
+
import"./index-v250345n.js";
|
|
50
50
|
import"./index-rtry5xyf.js";
|
|
51
|
-
import"./index-
|
|
51
|
+
import"./index-b9mwe99e.js";
|
|
52
52
|
import"./index-ae75rja9.js";
|
|
53
|
-
import"./index-
|
|
54
|
-
import"./index-
|
|
55
|
-
import"./index-
|
|
53
|
+
import"./index-kq5p3nm3.js";
|
|
54
|
+
import"./index-c2hczjhp.js";
|
|
55
|
+
import"./index-zbj3yrrd.js";
|
|
56
56
|
import"./index-7g4c7s5r.js";
|
|
57
57
|
import"./index-ed5ykebp.js";
|
|
58
58
|
import"./index-4nt52yr9.js";
|
|
59
|
-
import"./index-
|
|
59
|
+
import"./index-1dwa96x7.js";
|
|
60
60
|
import"./index-gprxjmm7.js";
|
|
61
61
|
import"./index-n832052r.js";
|
|
62
|
-
import"./index-
|
|
62
|
+
import"./index-fckf6g01.js";
|
|
63
63
|
import"./index-4rhhvd1a.js";
|
|
64
64
|
import"./index-zgwm4ryv.js";
|
|
65
|
-
import"./index-
|
|
65
|
+
import"./index-g4w73p1v.js";
|
|
66
66
|
import"./index-jqsfsqbx.js";
|
|
67
67
|
import"./index-zjygnfay.js";
|
|
68
68
|
import"./index-bk5tah7q.js";
|
|
69
|
-
import"./index-
|
|
69
|
+
import"./index-9d4gck4e.js";
|
|
70
70
|
import"./index-bpmtbmy9.js";
|
|
71
71
|
import"./index-a76rekgs.js";
|
|
72
72
|
export {
|
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
createCuratorLLMDelegate
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-nk2ma3mh.js";
|
|
5
5
|
import"./index-4905hd2m.js";
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
8
|
-
import"./index-
|
|
6
|
+
import"./index-ays8g6cm.js";
|
|
7
|
+
import"./index-f1hsrgw1.js";
|
|
8
|
+
import"./index-pkby67j3.js";
|
|
9
9
|
import"./index-c8s9a3zh.js";
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
10
|
+
import"./index-m54erqap.js";
|
|
11
|
+
import"./index-awwqa1f5.js";
|
|
12
12
|
import"./index-134d35c1.js";
|
|
13
|
-
import"./index-
|
|
13
|
+
import"./index-q4vaar2b.js";
|
|
14
14
|
import"./index-y8552snf.js";
|
|
15
15
|
import"./index-9ss2m4rs.js";
|
|
16
16
|
import"./index-74hpm6sh.js";
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
21
|
-
import"./index-
|
|
22
|
-
import"./index-
|
|
17
|
+
import"./index-fcsf8vjm.js";
|
|
18
|
+
import"./index-x5kk9gyk.js";
|
|
19
|
+
import"./index-xcqst95a.js";
|
|
20
|
+
import"./index-xmzmeknp.js";
|
|
21
|
+
import"./index-qskz8j2z.js";
|
|
22
|
+
import"./index-sd1w4pya.js";
|
|
23
23
|
import"./index-556ja8an.js";
|
|
24
|
-
import"./index-
|
|
24
|
+
import"./index-rx33k785.js";
|
|
25
25
|
import"./index-zsrtt42s.js";
|
|
26
|
-
import"./index-
|
|
26
|
+
import"./index-10zsx1x2.js";
|
|
27
27
|
import"./index-qwm6vdyv.js";
|
|
28
|
-
import"./index-
|
|
29
|
-
import"./index-
|
|
28
|
+
import"./index-3d13jkzq.js";
|
|
29
|
+
import"./index-nse60anv.js";
|
|
30
30
|
import"./index-8fwhhayc.js";
|
|
31
31
|
import"./index-q1exe2b3.js";
|
|
32
|
-
import"./index-
|
|
32
|
+
import"./index-acpsb3g1.js";
|
|
33
33
|
import"./index-k46me75h.js";
|
|
34
34
|
import"./index-ee3x66a5.js";
|
|
35
|
-
import"./index-
|
|
36
|
-
import"./index-
|
|
35
|
+
import"./index-w95sxwfr.js";
|
|
36
|
+
import"./index-v250345n.js";
|
|
37
37
|
import"./index-rtry5xyf.js";
|
|
38
|
-
import"./index-
|
|
38
|
+
import"./index-b9mwe99e.js";
|
|
39
39
|
import"./index-ae75rja9.js";
|
|
40
|
-
import"./index-
|
|
41
|
-
import"./index-
|
|
42
|
-
import"./index-
|
|
40
|
+
import"./index-kq5p3nm3.js";
|
|
41
|
+
import"./index-c2hczjhp.js";
|
|
42
|
+
import"./index-zbj3yrrd.js";
|
|
43
43
|
import"./index-7g4c7s5r.js";
|
|
44
44
|
import"./index-ed5ykebp.js";
|
|
45
45
|
import"./index-4nt52yr9.js";
|
|
46
|
-
import"./index-
|
|
46
|
+
import"./index-1dwa96x7.js";
|
|
47
47
|
import"./index-gprxjmm7.js";
|
|
48
48
|
import"./index-n832052r.js";
|
|
49
|
-
import"./index-
|
|
49
|
+
import"./index-fckf6g01.js";
|
|
50
50
|
import"./index-4rhhvd1a.js";
|
|
51
51
|
import"./index-zgwm4ryv.js";
|
|
52
|
-
import"./index-
|
|
52
|
+
import"./index-g4w73p1v.js";
|
|
53
53
|
import"./index-jqsfsqbx.js";
|
|
54
54
|
import"./index-zjygnfay.js";
|
|
55
55
|
import"./index-bk5tah7q.js";
|
|
56
|
-
import"./index-
|
|
56
|
+
import"./index-9d4gck4e.js";
|
|
57
57
|
import"./index-bpmtbmy9.js";
|
|
58
58
|
import"./index-a76rekgs.js";
|
|
59
59
|
export {
|
package/dist/cli/{evidence-summary-service-zq4gyx6g.js → evidence-summary-service-8e6594tg.js}
RENAMED
|
@@ -6,34 +6,34 @@ import {
|
|
|
6
6
|
loadPlanJsonOnly,
|
|
7
7
|
mergeDurableGateEntriesFromEvidence,
|
|
8
8
|
readDurableGateEvidence
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-awwqa1f5.js";
|
|
10
10
|
import"./index-134d35c1.js";
|
|
11
|
-
import"./index-
|
|
11
|
+
import"./index-q4vaar2b.js";
|
|
12
12
|
import"./index-y8552snf.js";
|
|
13
13
|
import"./index-9ss2m4rs.js";
|
|
14
|
-
import"./index-
|
|
14
|
+
import"./index-rx33k785.js";
|
|
15
15
|
import"./index-zsrtt42s.js";
|
|
16
|
-
import"./index-
|
|
16
|
+
import"./index-3d13jkzq.js";
|
|
17
17
|
import"./index-q1exe2b3.js";
|
|
18
18
|
import"./index-k46me75h.js";
|
|
19
19
|
import"./index-ee3x66a5.js";
|
|
20
|
-
import"./index-
|
|
21
|
-
import"./index-
|
|
20
|
+
import"./index-c2hczjhp.js";
|
|
21
|
+
import"./index-zbj3yrrd.js";
|
|
22
22
|
import"./index-7g4c7s5r.js";
|
|
23
23
|
import"./index-ed5ykebp.js";
|
|
24
24
|
import"./index-4nt52yr9.js";
|
|
25
25
|
import"./index-gprxjmm7.js";
|
|
26
26
|
import"./index-n832052r.js";
|
|
27
|
-
import"./index-
|
|
27
|
+
import"./index-fckf6g01.js";
|
|
28
28
|
import"./index-4rhhvd1a.js";
|
|
29
29
|
import {
|
|
30
30
|
log
|
|
31
31
|
} from "./index-zgwm4ryv.js";
|
|
32
|
-
import"./index-
|
|
32
|
+
import"./index-g4w73p1v.js";
|
|
33
33
|
import"./index-jqsfsqbx.js";
|
|
34
34
|
import"./index-zjygnfay.js";
|
|
35
35
|
import"./index-bk5tah7q.js";
|
|
36
|
-
import"./index-
|
|
36
|
+
import"./index-9d4gck4e.js";
|
|
37
37
|
import"./index-bpmtbmy9.js";
|
|
38
38
|
import"./index-a76rekgs.js";
|
|
39
39
|
|
|
@@ -17,17 +17,17 @@ import {
|
|
|
17
17
|
reduceTaskWorkflowSnapshot,
|
|
18
18
|
transitionTaskWorkflowEvidence,
|
|
19
19
|
withTaskEvidenceTransaction
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-3d13jkzq.js";
|
|
21
21
|
import"./index-k46me75h.js";
|
|
22
22
|
import"./index-ee3x66a5.js";
|
|
23
|
-
import"./index-
|
|
24
|
-
import"./index-
|
|
23
|
+
import"./index-c2hczjhp.js";
|
|
24
|
+
import"./index-zbj3yrrd.js";
|
|
25
25
|
import"./index-7g4c7s5r.js";
|
|
26
26
|
import"./index-ed5ykebp.js";
|
|
27
27
|
import"./index-4nt52yr9.js";
|
|
28
28
|
import"./index-zgwm4ryv.js";
|
|
29
29
|
import"./index-zjygnfay.js";
|
|
30
|
-
import"./index-
|
|
30
|
+
import"./index-9d4gck4e.js";
|
|
31
31
|
import"./index-bpmtbmy9.js";
|
|
32
32
|
import"./index-a76rekgs.js";
|
|
33
33
|
export {
|