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
|
@@ -33,32 +33,32 @@ import {
|
|
|
33
33
|
sanitizeSlug,
|
|
34
34
|
selectCandidateEntries,
|
|
35
35
|
writeEvalStub
|
|
36
|
-
} from "./index-
|
|
37
|
-
import"./index-
|
|
36
|
+
} from "./index-fcsf8vjm.js";
|
|
37
|
+
import"./index-acpsb3g1.js";
|
|
38
38
|
import"./index-k46me75h.js";
|
|
39
39
|
import"./index-ee3x66a5.js";
|
|
40
|
-
import"./index-
|
|
41
|
-
import"./index-
|
|
40
|
+
import"./index-w95sxwfr.js";
|
|
41
|
+
import"./index-v250345n.js";
|
|
42
42
|
import"./index-rtry5xyf.js";
|
|
43
|
-
import"./index-
|
|
43
|
+
import"./index-b9mwe99e.js";
|
|
44
44
|
import"./index-ae75rja9.js";
|
|
45
|
-
import"./index-
|
|
46
|
-
import"./index-
|
|
47
|
-
import"./index-
|
|
45
|
+
import"./index-kq5p3nm3.js";
|
|
46
|
+
import"./index-c2hczjhp.js";
|
|
47
|
+
import"./index-zbj3yrrd.js";
|
|
48
48
|
import"./index-7g4c7s5r.js";
|
|
49
49
|
import"./index-ed5ykebp.js";
|
|
50
50
|
import"./index-4nt52yr9.js";
|
|
51
|
-
import"./index-
|
|
51
|
+
import"./index-1dwa96x7.js";
|
|
52
52
|
import"./index-gprxjmm7.js";
|
|
53
53
|
import"./index-n832052r.js";
|
|
54
|
-
import"./index-
|
|
54
|
+
import"./index-fckf6g01.js";
|
|
55
55
|
import"./index-4rhhvd1a.js";
|
|
56
56
|
import"./index-zgwm4ryv.js";
|
|
57
|
-
import"./index-
|
|
57
|
+
import"./index-g4w73p1v.js";
|
|
58
58
|
import"./index-jqsfsqbx.js";
|
|
59
59
|
import"./index-zjygnfay.js";
|
|
60
60
|
import"./index-bk5tah7q.js";
|
|
61
|
-
import"./index-
|
|
61
|
+
import"./index-9d4gck4e.js";
|
|
62
62
|
import"./index-bpmtbmy9.js";
|
|
63
63
|
import"./index-a76rekgs.js";
|
|
64
64
|
export {
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
scanDelegationFallbacksForRecovery,
|
|
12
12
|
scanDelegationsForRecovery
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-nse60anv.js";
|
|
14
14
|
import"./index-k46me75h.js";
|
|
15
15
|
import"./index-ee3x66a5.js";
|
|
16
|
-
import"./index-
|
|
16
|
+
import"./index-zbj3yrrd.js";
|
|
17
17
|
import"./index-7g4c7s5r.js";
|
|
18
18
|
import"./index-ed5ykebp.js";
|
|
19
19
|
import {
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "./index-4nt52yr9.js";
|
|
22
22
|
import"./index-zgwm4ryv.js";
|
|
23
23
|
import"./index-zjygnfay.js";
|
|
24
|
-
import"./index-
|
|
24
|
+
import"./index-9d4gck4e.js";
|
|
25
25
|
import"./index-bpmtbmy9.js";
|
|
26
26
|
import"./index-a76rekgs.js";
|
|
27
27
|
|
|
@@ -20,61 +20,61 @@ import {
|
|
|
20
20
|
sanitizeWorktreeTaskId,
|
|
21
21
|
standardWorktreeByCallID,
|
|
22
22
|
standardWorktreeSerializationSessions
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-nk2ma3mh.js";
|
|
24
24
|
import"./index-4905hd2m.js";
|
|
25
|
-
import"./index-
|
|
26
|
-
import"./index-
|
|
27
|
-
import"./index-
|
|
25
|
+
import"./index-ays8g6cm.js";
|
|
26
|
+
import"./index-f1hsrgw1.js";
|
|
27
|
+
import"./index-pkby67j3.js";
|
|
28
28
|
import"./index-c8s9a3zh.js";
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
29
|
+
import"./index-m54erqap.js";
|
|
30
|
+
import"./index-awwqa1f5.js";
|
|
31
31
|
import"./index-134d35c1.js";
|
|
32
|
-
import"./index-
|
|
32
|
+
import"./index-q4vaar2b.js";
|
|
33
33
|
import"./index-y8552snf.js";
|
|
34
34
|
import"./index-9ss2m4rs.js";
|
|
35
35
|
import"./index-74hpm6sh.js";
|
|
36
|
-
import"./index-
|
|
37
|
-
import"./index-
|
|
38
|
-
import"./index-
|
|
39
|
-
import"./index-
|
|
40
|
-
import"./index-
|
|
41
|
-
import"./index-
|
|
36
|
+
import"./index-fcsf8vjm.js";
|
|
37
|
+
import"./index-x5kk9gyk.js";
|
|
38
|
+
import"./index-xcqst95a.js";
|
|
39
|
+
import"./index-xmzmeknp.js";
|
|
40
|
+
import"./index-qskz8j2z.js";
|
|
41
|
+
import"./index-sd1w4pya.js";
|
|
42
42
|
import"./index-556ja8an.js";
|
|
43
|
-
import"./index-
|
|
43
|
+
import"./index-rx33k785.js";
|
|
44
44
|
import"./index-zsrtt42s.js";
|
|
45
|
-
import"./index-
|
|
45
|
+
import"./index-10zsx1x2.js";
|
|
46
46
|
import"./index-qwm6vdyv.js";
|
|
47
|
-
import"./index-
|
|
48
|
-
import"./index-
|
|
47
|
+
import"./index-3d13jkzq.js";
|
|
48
|
+
import"./index-nse60anv.js";
|
|
49
49
|
import"./index-8fwhhayc.js";
|
|
50
50
|
import"./index-q1exe2b3.js";
|
|
51
|
-
import"./index-
|
|
51
|
+
import"./index-acpsb3g1.js";
|
|
52
52
|
import"./index-k46me75h.js";
|
|
53
53
|
import"./index-ee3x66a5.js";
|
|
54
|
-
import"./index-
|
|
55
|
-
import"./index-
|
|
54
|
+
import"./index-w95sxwfr.js";
|
|
55
|
+
import"./index-v250345n.js";
|
|
56
56
|
import"./index-rtry5xyf.js";
|
|
57
|
-
import"./index-
|
|
57
|
+
import"./index-b9mwe99e.js";
|
|
58
58
|
import"./index-ae75rja9.js";
|
|
59
|
-
import"./index-
|
|
60
|
-
import"./index-
|
|
61
|
-
import"./index-
|
|
59
|
+
import"./index-kq5p3nm3.js";
|
|
60
|
+
import"./index-c2hczjhp.js";
|
|
61
|
+
import"./index-zbj3yrrd.js";
|
|
62
62
|
import"./index-7g4c7s5r.js";
|
|
63
63
|
import"./index-ed5ykebp.js";
|
|
64
64
|
import"./index-4nt52yr9.js";
|
|
65
65
|
import {
|
|
66
66
|
resolveWorktreeIsolationConfig
|
|
67
|
-
} from "./index-
|
|
67
|
+
} from "./index-1dwa96x7.js";
|
|
68
68
|
import"./index-gprxjmm7.js";
|
|
69
69
|
import"./index-n832052r.js";
|
|
70
|
-
import"./index-
|
|
70
|
+
import"./index-fckf6g01.js";
|
|
71
71
|
import"./index-4rhhvd1a.js";
|
|
72
72
|
import"./index-zgwm4ryv.js";
|
|
73
|
-
import"./index-
|
|
73
|
+
import"./index-g4w73p1v.js";
|
|
74
74
|
import"./index-jqsfsqbx.js";
|
|
75
75
|
import"./index-zjygnfay.js";
|
|
76
76
|
import"./index-bk5tah7q.js";
|
|
77
|
-
import"./index-
|
|
77
|
+
import"./index-9d4gck4e.js";
|
|
78
78
|
import"./index-bpmtbmy9.js";
|
|
79
79
|
import"./index-a76rekgs.js";
|
|
80
80
|
export {
|
|
@@ -346,6 +346,11 @@ export declare function resolveDelegatedPlanTaskId(args: Record<string, unknown>
|
|
|
346
346
|
* rejected by the membership gate in prepareCoderScope with their own message).
|
|
347
347
|
*/
|
|
348
348
|
declare function describeCoderScopeFailure(args: Record<string, unknown>, planTaskIds: ReadonlySet<string>): string;
|
|
349
|
+
type FileDirectiveExtractionMode = 'enforce' | 'observe';
|
|
350
|
+
declare function extractTaskFileDirectives(args: Record<string, unknown>, mode?: FileDirectiveExtractionMode): {
|
|
351
|
+
present: boolean;
|
|
352
|
+
files: string[] | null;
|
|
353
|
+
};
|
|
349
354
|
/**
|
|
350
355
|
* Parses structured per-task verdict lines from agent dispatch output.
|
|
351
356
|
*
|
|
@@ -396,6 +401,7 @@ export declare const _internals: {
|
|
|
396
401
|
describeCoderScopeFailure: typeof describeCoderScopeFailure;
|
|
397
402
|
parsePerTaskVerdicts: typeof parsePerTaskVerdicts;
|
|
398
403
|
buildParallelExecutionGuidance: typeof buildParallelExecutionGuidance;
|
|
404
|
+
extractTaskFileDirectives: typeof extractTaskFileDirectives;
|
|
399
405
|
loadPlanJsonOnly: typeof loadPlanJsonOnly;
|
|
400
406
|
recordPendingDelegationForBackground: typeof import("../background/pending-delegations.js").recordPendingDelegationDetailed;
|
|
401
407
|
writeDelegationFallbackForBackground: typeof import("../background/pending-delegations.js").writeDelegationFallback;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* 1. `experimental.chat.messages.transform` — scans the latest
|
|
7
7
|
* architect-authored message for
|
|
8
|
-
* `KNOWLEDGE_APPLIED|IGNORED|CONTRADICTED|VIOLATED`
|
|
8
|
+
* `KNOWLEDGE_APPLIED|IGNORED|N_A|CONTRADICTED|VIOLATED`
|
|
9
9
|
* markers and records them via `recordAcknowledgmentDeduped`. This
|
|
10
10
|
* runs BEFORE the architect's next tool call so the toolBefore gate
|
|
11
11
|
* sees the ack.
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* from the process working directory.
|
|
23
23
|
*/
|
|
24
24
|
import { resolveHiveEventsPath as resolveHiveEventsPathImpl } from '../knowledge/hive-paths.js';
|
|
25
|
-
import { queryHistoricalOutcomes } from './knowledge-receipt-ledger.js';
|
|
25
|
+
import { queryHistoricalOutcomes, type ReceiptSourceCode } from './knowledge-receipt-ledger.js';
|
|
26
26
|
import type { ConfidenceFloorOptions } from './knowledge-store.js';
|
|
27
27
|
import type { KnowledgeApplicationRecord, RetrievalOutcome } from './knowledge-types.js';
|
|
28
28
|
/** Current event-log record schema version. Bump when the on-disk shape changes. */
|
|
@@ -111,8 +111,11 @@ export interface ReceiptEvent {
|
|
|
111
111
|
* (`'reviewer'`) from delegate self-acks (`'delegate'`) without changing the
|
|
112
112
|
* `type`, so existing counter rollups (which switch on `type`) stay intact.
|
|
113
113
|
* A reviewer VERIFIED maps to type:'applied' with source:'reviewer'.
|
|
114
|
+
* Canonical closed set: `ReceiptSourceCode` (issue #2032); the `| string`
|
|
115
|
+
* tail keeps legacy records with unrecognized source values loadable, and
|
|
116
|
+
* a MISSING legacy source is never inferred — it stays absent/`'unknown'`.
|
|
114
117
|
*/
|
|
115
|
-
source?:
|
|
118
|
+
source?: ReceiptSourceCode | (string & {});
|
|
116
119
|
/** Result of executing a directive's verification_predicate (Change 2). */
|
|
117
120
|
predicate_check?: {
|
|
118
121
|
predicate: string;
|
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
import { atomicWriteFsynced, type ReceiptLedgerPaths, type ReceiptStoreErrorCode } from './knowledge-receipt-ledger-storage.js';
|
|
2
2
|
import { type KnowledgeReceiptTransitionObservation } from './knowledge-receipt-observability.js';
|
|
3
|
+
/**
|
|
4
|
+
* Canonical terminal-outcome vocabulary for the authoritative receipt ledger
|
|
5
|
+
* (issue #2032). This is the single declaration the outcome-aware consumers
|
|
6
|
+
* import and derive from: the shared validator (`VALID_OUTCOMES`), the
|
|
7
|
+
* collectors, the application and phase gates, the counter rollups, the
|
|
8
|
+
* scoring signal, and the diagnostics. (The curator consumes outcomes only
|
|
9
|
+
* through the derived signal and counter rollups — it does not switch on
|
|
10
|
+
* this set directly.) Semantics: `applied` = followed (positive signal;
|
|
11
|
+
* reviewer VERIFIED maps here); `ignored` = judged relevant but deliberately
|
|
12
|
+
* not followed (negative signal, policy consequences retained);
|
|
13
|
+
* `contradicted` = current authority disproves (negative); `violated` =
|
|
14
|
+
* runtime violation (negative, blocks phase completion until remediated);
|
|
15
|
+
* `n_a` = not applicable to the current action (neutral — clears only the
|
|
16
|
+
* acknowledgement/applicability obligation, never proves application, never
|
|
17
|
+
* feeds promotion evidence).
|
|
18
|
+
*/
|
|
3
19
|
export type ReceiptOutcome = 'applied' | 'ignored' | 'contradicted' | 'violated' | 'n_a';
|
|
20
|
+
/** Runtime set form of {@link ReceiptOutcome} — derive, never redeclare. */
|
|
21
|
+
export declare const RECEIPT_TERMINAL_OUTCOMES: ReadonlySet<ReceiptOutcome>;
|
|
22
|
+
/**
|
|
23
|
+
* Canonical terminal-source taxonomy (issue #2032). `source` answers WHO
|
|
24
|
+
* produced the terminal as a provenance class, while the separate `agent`
|
|
25
|
+
* field records the agent identity. Storage stays permissive (`string`) for
|
|
26
|
+
* legacy tolerance: a legacy record with an absent or ambiguous source is
|
|
27
|
+
* preserved as `'unknown'` and is never coerced to delegate, ignored, or any
|
|
28
|
+
* other class. New producers must stamp one of the closed values below.
|
|
29
|
+
*/
|
|
30
|
+
export type ReceiptSourceCode = 'delegate' | 'reviewer' | 'architect' | 'architect_marker' | 'test_engineer' | 'phase_override' | 'application_gate_staleness_clear' | 'application_gate_denial_limit_clear' | 'manual' | 'migration' | 'unknown';
|
|
31
|
+
/** Closed set form of {@link ReceiptSourceCode}. */
|
|
32
|
+
export declare const CANONICAL_RECEIPT_SOURCES: ReadonlySet<string>;
|
|
33
|
+
/**
|
|
34
|
+
* Normalize a would-be terminal source to the canonical taxonomy (issue
|
|
35
|
+
* #2032 review F-001): a canonical value passes through verbatim; anything
|
|
36
|
+
* else (absent, whitespace, out-of-taxonomy string such as a legacy agent
|
|
37
|
+
* name) becomes the honest `'unknown'` class. Deliberately NOT a hard
|
|
38
|
+
* reject — storage stays permissive for legacy tolerance, and reads of the
|
|
39
|
+
* historical journal remain unchanged; only NEW commit boundaries normalize.
|
|
40
|
+
*/
|
|
41
|
+
export declare function normalizeReceiptSource(value: unknown): string;
|
|
4
42
|
export interface ReceiptPredicateCheck {
|
|
5
43
|
predicate: string;
|
|
6
44
|
result: 'pass' | 'fail' | 'error';
|
|
@@ -4,6 +4,23 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { emit } from '../telemetry.js';
|
|
6
6
|
import type { ReceiptOutcome } from './knowledge-receipt-validator.js';
|
|
7
|
+
/**
|
|
8
|
+
* Semantic version of the outcome/source MEANING contract (issue #2032).
|
|
9
|
+
* 1 = pre-#2032 producer semantics (outcome words meant different things per
|
|
10
|
+
* producer; delegate terminals carried no source). 2 = the #2032 atomic
|
|
11
|
+
* semantics: one typed outcome/source vocabulary, delegate terminals stamped
|
|
12
|
+
* `source: 'delegate'`, `n_a` neutral everywhere, legacy ambiguity `unknown`.
|
|
13
|
+
* Distinct from the journal `RECEIPT_SCHEMA_VERSION` (a hard format gate).
|
|
14
|
+
* Bump this whenever a producer or consumer changes what an outcome or source
|
|
15
|
+
* MEANS, so health/reports consumers can distinguish producer behavior and
|
|
16
|
+
* migration uncertainty.
|
|
17
|
+
*/
|
|
18
|
+
export declare const RECEIPT_SEMANTICS_VERSION = 2;
|
|
19
|
+
/**
|
|
20
|
+
* Outcomes observable on a transition. Terminal outcomes plus the trace-level
|
|
21
|
+
* `no_relevant` tombstone that closes an empty retrieval (not a terminal).
|
|
22
|
+
*/
|
|
23
|
+
export type ReceiptObservationOutcome = ReceiptOutcome | 'no_relevant';
|
|
7
24
|
export type KnowledgeReceiptObservedTransition = 'membership_committed' | 'empty_retrieval_committed' | 'terminal_committed' | 'terminal_attempt_rejected' | 'terminal_attempt_idempotent' | 'authorized_transition_committed' | 'application_marker_committed' | 'phase_close_intent' | 'phase_closed' | 'legacy_imported' | 'legacy_unverifiable' | 'cutover_completed' | 'checkpoint';
|
|
8
25
|
export type KnowledgeReceiptObservationReasonCode = 'committed' | 'idempotent' | 'trace_not_found' | 'id_not_in_trace' | 'wrong_session' | 'wrong_phase' | 'wrong_task' | 'duplicate_conflicting_terminal' | 'event_id_conflict' | 'invalid_outcome' | 'empty_receipt' | 'lock_timeout' | 'store_unavailable' | 'store_corrupt' | 'legacy_unverifiable' | 'unauthorized_transition';
|
|
9
26
|
export interface KnowledgeReceiptTransitionObservation {
|
|
@@ -16,9 +33,15 @@ export interface KnowledgeReceiptTransitionObservation {
|
|
|
16
33
|
taskId?: string;
|
|
17
34
|
phase?: string;
|
|
18
35
|
/** Domain value only; never projected to the generic observability outcome. */
|
|
19
|
-
receiptOutcome?:
|
|
36
|
+
receiptOutcome?: ReceiptObservationOutcome;
|
|
20
37
|
/** Bounded domain code only; arbitrary prose is deliberately rejected. */
|
|
21
38
|
receiptSource?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Outcome/source semantics contract version. Optional so existing ledger
|
|
41
|
+
* observation constructors need no churn; the emitter defaults it to
|
|
42
|
+
* {@link RECEIPT_SEMANTICS_VERSION}.
|
|
43
|
+
*/
|
|
44
|
+
receiptSemantics?: number;
|
|
22
45
|
}
|
|
23
46
|
/** Emit bounded diagnostics fail-open after an authoritative transition. */
|
|
24
47
|
export declare function emitKnowledgeReceiptTransition(observation: KnowledgeReceiptTransitionObservation): void;
|
|
@@ -7,10 +7,17 @@
|
|
|
7
7
|
* diagnostic or promotion projection is written.
|
|
8
8
|
*/
|
|
9
9
|
import type { KnowledgeEvent, RetrievedEvent } from './knowledge-events.js';
|
|
10
|
-
|
|
10
|
+
import { type ReceiptOutcome } from './knowledge-receipt-ledger.js';
|
|
11
|
+
/**
|
|
12
|
+
* Canonical terminal outcome — single declaration lives in the authoritative
|
|
13
|
+
* ledger (issue #2032). Re-exported here for existing import sites; do NOT
|
|
14
|
+
* redeclare. The trace-level `no_relevant` tombstone is NOT a terminal
|
|
15
|
+
* outcome and never appears on a `ReceiptItem`.
|
|
16
|
+
*/
|
|
17
|
+
export type { ReceiptOutcome };
|
|
11
18
|
export interface ReceiptItem {
|
|
12
19
|
id: string;
|
|
13
|
-
outcome:
|
|
20
|
+
outcome: ReceiptOutcome;
|
|
14
21
|
reason?: string;
|
|
15
22
|
}
|
|
16
23
|
export interface ReceiptValidationContext {
|
|
@@ -20,6 +27,16 @@ export interface ReceiptValidationContext {
|
|
|
20
27
|
task_id?: string;
|
|
21
28
|
phase?: string;
|
|
22
29
|
agent: string;
|
|
30
|
+
/**
|
|
31
|
+
* Provenance class for the committed terminals (issue #2032): who is
|
|
32
|
+
* reporting, e.g. 'delegate' for the delegate-ack collector or the
|
|
33
|
+
* agent-class value for the knowledge_receipt tool. This is deliberately
|
|
34
|
+
* NOT derived from `agent` — agent identity and source are different
|
|
35
|
+
* facts, and conflating them is how delegate terminals lost their
|
|
36
|
+
* provenance. Type-required, but fail-open at runtime: a falsy value
|
|
37
|
+
* stamps the honest 'unknown' class rather than rejecting the receipt.
|
|
38
|
+
*/
|
|
39
|
+
source: string;
|
|
23
40
|
cohort_id?: string;
|
|
24
41
|
source_link_id?: string;
|
|
25
42
|
grace_days?: number;
|
|
@@ -58,4 +75,3 @@ export declare const _internals: {
|
|
|
58
75
|
isTerminalReceipt: typeof isTerminalReceipt;
|
|
59
76
|
VALID_OUTCOMES: ReadonlySet<string>;
|
|
60
77
|
};
|
|
61
|
-
export {};
|
|
@@ -352,6 +352,15 @@ export interface PromotionEvidenceRecord {
|
|
|
352
352
|
retrieval_trace_id: string;
|
|
353
353
|
/** Terminal receipt outcome. */
|
|
354
354
|
receipt_outcome: 'applied' | 'violated' | 'contradicted';
|
|
355
|
+
/**
|
|
356
|
+
* Provenance class of the terminal this evidence was derived from
|
|
357
|
+
* (#2032 review F-003). `'delegate'` evidence is a self-report and stays
|
|
358
|
+
* non-independent: the promotion gate only counts evidence whose source is
|
|
359
|
+
* present and not `'delegate'` toward `promotion_min_terminal_applications`.
|
|
360
|
+
* Absent on records written before #2032 — such records fail closed (they
|
|
361
|
+
* do not count as independent).
|
|
362
|
+
*/
|
|
363
|
+
receipt_source?: string;
|
|
355
364
|
/** Id of the ReceiptEvent this evidence was derived from. */
|
|
356
365
|
receipt_event_id: string;
|
|
357
366
|
phase?: string;
|
|
@@ -555,6 +555,8 @@ export declare const _test_exports: {
|
|
|
555
555
|
extractCandidateIds: typeof extractCandidateIds;
|
|
556
556
|
parseCanonicalCandidateRows: typeof parseCanonicalCandidateRows;
|
|
557
557
|
resolvePrReviewRowFamily: typeof resolvePrReviewRowFamily;
|
|
558
|
+
pipeFieldsCapped: typeof pipeFieldsCapped;
|
|
559
|
+
reviewerVerdictRowDigest: typeof reviewerVerdictRowDigest;
|
|
558
560
|
workflowGateStateRelativePath: typeof workflowGateStateRelativePath;
|
|
559
561
|
workflowGateStateLockRelativePath: typeof workflowGateStateLockRelativePath;
|
|
560
562
|
workflowCheckoutMutationLockRelativePath: typeof workflowCheckoutMutationLockRelativePath;
|
|
@@ -843,10 +845,28 @@ declare function analyzePrReviewBatchRecordIntegrity(args: {
|
|
|
843
845
|
export declare function validatePrReviewDiscoveryLaneCompletion(input: PrReviewDiscoveryLaneValidationInput): PrReviewLaneValidationResult;
|
|
844
846
|
/** Require at least one semantically valid discovery row or CLEAN attestation. */
|
|
845
847
|
export declare function prReviewDiscoveryArtifactCoversLane(text: string, expectedWorkflowLane: string, ownedWorkflowLanes?: readonly string[], mode?: string): boolean;
|
|
848
|
+
/**
|
|
849
|
+
* Digest of the FULL canonical reviewer row, not the classification/severity
|
|
850
|
+
* pair a reviewer verdict projects to. Only 2 of the 10 required fields survive
|
|
851
|
+
* that projection, so a tuple binding would still match a row whose evidence,
|
|
852
|
+
* file:line and root cause all changed. Fields are joined on NUL, which
|
|
853
|
+
* `pipeFields` can never produce, so no field boundary is forgeable.
|
|
854
|
+
*/
|
|
855
|
+
declare function reviewerVerdictRowDigest(fields: readonly string[]): string;
|
|
846
856
|
declare function parseCriticVerdict(text: string, itemId: string, reviewerSeverity?: string): {
|
|
847
857
|
status: string;
|
|
848
858
|
severity: string;
|
|
849
859
|
} | null;
|
|
860
|
+
/**
|
|
861
|
+
* `pipeFields` capped at the row's canonical field count: separators beyond the
|
|
862
|
+
* expected count merge back into the trailing (free-text) field. Verdict rows
|
|
863
|
+
* ([REVIEWED], [CRITIC], [FEEDBACK-VERIFIED]) carry prose evidence in their
|
|
864
|
+
* last field, and prose containing literal pipes (regex text, `,;|`, shell
|
|
865
|
+
* snippets) otherwise splits the row past its strict field-count check and the
|
|
866
|
+
* whole verdict becomes unparseable. Deterministic: the enumerated leading
|
|
867
|
+
* fields are never merged.
|
|
868
|
+
*/
|
|
869
|
+
declare function pipeFieldsCapped(line: string, expectedFieldCount: number): string[];
|
|
850
870
|
declare function workflowCheckoutMutationLockRelativePath(): string;
|
|
851
871
|
declare function openCheckoutLockFile(lockPath: string): Promise<fsp.FileHandle>;
|
|
852
872
|
declare function removeCheckoutLockFile(lockPath: string): Promise<void>;
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* complete drift above the configured refresh cap are suppressed;
|
|
18
18
|
* inconclusive probes remain usable as freshness-unknown, without mutation.
|
|
19
19
|
*/
|
|
20
|
+
import { loadPluginConfigWithMetaAsync } from '../config/loader';
|
|
20
21
|
import { type FreshnessOptions, probeFreshness, type RepoGraph } from '../tools/repo-graph';
|
|
21
22
|
export interface RepoGraphInjectionOptions extends FreshnessOptions {
|
|
22
23
|
enabled?: boolean;
|
|
@@ -25,6 +26,9 @@ export interface RepoGraphInjectionOptions extends FreshnessOptions {
|
|
|
25
26
|
export declare const _internals: {
|
|
26
27
|
probeFreshness: typeof probeFreshness;
|
|
27
28
|
cacheSize: () => number;
|
|
29
|
+
renderLaneOrientationBlock: typeof renderLaneOrientationBlock;
|
|
30
|
+
orientationFreshnessLine: typeof orientationFreshnessLine;
|
|
31
|
+
loadPluginConfigWithMetaAsync: typeof loadPluginConfigWithMetaAsync;
|
|
28
32
|
};
|
|
29
33
|
/**
|
|
30
34
|
* Load the repo graph for `directory`, using a bounded per-directory cache that
|
|
@@ -54,3 +58,51 @@ export declare function buildCoderLocalizationBlock(directory: string, targetFil
|
|
|
54
58
|
* the per-block context budget.
|
|
55
59
|
*/
|
|
56
60
|
export declare function buildReviewerBlastRadiusBlock(directory: string, changedFiles: string[], options?: RepoGraphInjectionOptions): Promise<string | null>;
|
|
61
|
+
/**
|
|
62
|
+
* Options for {@link buildLaneOrientationBlock}.
|
|
63
|
+
*
|
|
64
|
+
* `sessionID` scopes the novelty dedupe so two controller sessions never
|
|
65
|
+
* suppress each other's orientation blocks (invariant 8).
|
|
66
|
+
*/
|
|
67
|
+
export interface LaneOrientationOptions extends RepoGraphInjectionOptions {
|
|
68
|
+
sessionID?: string;
|
|
69
|
+
}
|
|
70
|
+
/** Test-only: clear the per-session orientation dedupe state. */
|
|
71
|
+
export declare function resetLaneOrientationDedupe(): void;
|
|
72
|
+
interface OrientationAskFile {
|
|
73
|
+
file: string;
|
|
74
|
+
score: number;
|
|
75
|
+
exports: string[];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Pure render for the lane orientation block. Deterministic: a pure function
|
|
79
|
+
* of its arguments — no timestamps, no randomness, no probe timing fields.
|
|
80
|
+
* Exported only through {@link _internals} for tests.
|
|
81
|
+
*/
|
|
82
|
+
declare function renderLaneOrientationBlock(askFiles: OrientationAskFile[], hubFiles: string[], freshnessLine: string): string;
|
|
83
|
+
/**
|
|
84
|
+
* Deterministic freshness statement for the orientation block. Only probe
|
|
85
|
+
* state and drift counts feed the text — never elapsedMs, probedFiles, or
|
|
86
|
+
* truncated, which would break the block's determinism contract.
|
|
87
|
+
*/
|
|
88
|
+
declare function orientationFreshnessLine(state: string, changedCount: number, removedCount: number): string;
|
|
89
|
+
/**
|
|
90
|
+
* Build a bounded, relevance-gated repo-graph orientation block for a lane
|
|
91
|
+
* dispatch batch (issue #1988 C2/C6). The block is appended to the shared
|
|
92
|
+
* `common_prompt` prefix by the dispatch caller.
|
|
93
|
+
*
|
|
94
|
+
* Gating policy — the block is emitted only when ALL hold:
|
|
95
|
+
* - a usable graph exists (fresh, or drifted within the refresh cap);
|
|
96
|
+
* - the top `ask` hit for the concatenated mission texts clears
|
|
97
|
+
* LANE_ORIENTATION_SCORE_FLOOR;
|
|
98
|
+
* - at least one file pointer is novel for this session (per-session
|
|
99
|
+
* novelty dedupe, bounded FIFO — suppressed repeats emit NOTHING);
|
|
100
|
+
* - the rendered block fits LANE_ORIENTATION_MAX_TOKENS.
|
|
101
|
+
*
|
|
102
|
+
* Determinism contract: a pure function of (graph state, mission texts,
|
|
103
|
+
* empty dedupe state) — the same dispatch replayed from a reset dedupe
|
|
104
|
+
* state produces a byte-identical block. Returns null on every gate
|
|
105
|
+
* failure or error; never throws into the dispatch path.
|
|
106
|
+
*/
|
|
107
|
+
export declare function buildLaneOrientationBlock(directory: string, lanePrompts: string[], options?: LaneOrientationOptions): Promise<string | null>;
|
|
108
|
+
export {};
|