@telora/daemon 0.18.55 → 0.18.61
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/build-info.json +6 -3
- package/dist/ai-inspection-context.d.ts.map +1 -1
- package/dist/ai-inspection-context.js +11 -1
- package/dist/ai-inspection-context.js.map +1 -1
- package/dist/ai-inspection-runner.d.ts.map +1 -1
- package/dist/ai-inspection-runner.js +0 -1
- package/dist/ai-inspection-runner.js.map +1 -1
- package/dist/audit-phase.d.ts.map +1 -1
- package/dist/audit-phase.js +4 -0
- package/dist/audit-phase.js.map +1 -1
- package/dist/cascade-restatement.d.ts +14 -5
- package/dist/cascade-restatement.d.ts.map +1 -1
- package/dist/cascade-restatement.js +35 -6
- package/dist/cascade-restatement.js.map +1 -1
- package/dist/cli/connect.d.ts +15 -11
- package/dist/cli/connect.d.ts.map +1 -1
- package/dist/cli/connect.js +20 -24
- package/dist/cli/connect.js.map +1 -1
- package/dist/completion/review-exit-phase.d.ts.map +1 -1
- package/dist/completion/review-exit-phase.js +37 -10
- package/dist/completion/review-exit-phase.js.map +1 -1
- package/dist/de-restatement.d.ts.map +1 -1
- package/dist/de-restatement.js +0 -1
- package/dist/de-restatement.js.map +1 -1
- package/dist/delivery-reconciler.d.ts +21 -1
- package/dist/delivery-reconciler.d.ts.map +1 -1
- package/dist/delivery-reconciler.js +21 -3
- package/dist/delivery-reconciler.js.map +1 -1
- package/dist/directive/close-loop-stage.d.ts.map +1 -1
- package/dist/directive/close-loop-stage.js +10 -2
- package/dist/directive/close-loop-stage.js.map +1 -1
- package/dist/focus-executor.d.ts +6 -0
- package/dist/focus-executor.d.ts.map +1 -1
- package/dist/focus-executor.js +10 -2
- package/dist/focus-executor.js.map +1 -1
- package/dist/focus-lifecycle.js +1 -1
- package/dist/focus-lifecycle.js.map +1 -1
- package/dist/focus-provisioning.js +1 -1
- package/dist/focus-provisioning.js.map +1 -1
- package/dist/negative-branch.d.ts +32 -1
- package/dist/negative-branch.d.ts.map +1 -1
- package/dist/negative-branch.js +55 -9
- package/dist/negative-branch.js.map +1 -1
- package/dist/prompt-sections/persona-sections.d.ts +19 -0
- package/dist/prompt-sections/persona-sections.d.ts.map +1 -1
- package/dist/prompt-sections/persona-sections.js +55 -0
- package/dist/prompt-sections/persona-sections.js.map +1 -1
- package/dist/queries/verification.d.ts +132 -0
- package/dist/queries/verification.d.ts.map +1 -1
- package/dist/queries/verification.js +271 -0
- package/dist/queries/verification.js.map +1 -1
- package/dist/reality-writeback.d.ts +257 -0
- package/dist/reality-writeback.d.ts.map +1 -0
- package/dist/reality-writeback.js +179 -0
- package/dist/reality-writeback.js.map +1 -0
- package/dist/resolvers/shared/reality-tree.d.ts +39 -1
- package/dist/resolvers/shared/reality-tree.d.ts.map +1 -1
- package/dist/resolvers/shared/reality-tree.js +51 -1
- package/dist/resolvers/shared/reality-tree.js.map +1 -1
- package/dist/review-defect-detector.d.ts +33 -0
- package/dist/review-defect-detector.d.ts.map +1 -1
- package/dist/review-defect-detector.js +53 -0
- package/dist/review-defect-detector.js.map +1 -1
- package/dist/team-prompt-base.d.ts +1 -1
- package/dist/team-prompt-base.d.ts.map +1 -1
- package/dist/team-prompt-base.js +1 -1
- package/dist/team-prompt-base.js.map +1 -1
- package/dist/unified-init.d.ts.map +1 -1
- package/dist/unified-init.js +0 -2
- package/dist/unified-init.js.map +1 -1
- package/dist/unified-shell.d.ts.map +1 -1
- package/dist/unified-shell.js +0 -2
- package/dist/unified-shell.js.map +1 -1
- package/dist/verification-engine.d.ts +10 -0
- package/dist/verification-engine.d.ts.map +1 -1
- package/dist/verification-engine.js +32 -1
- package/dist/verification-engine.js.map +1 -1
- package/dist/verify-restatement.d.ts +16 -0
- package/dist/verify-restatement.d.ts.map +1 -1
- package/dist/verify-restatement.js +7 -0
- package/dist/verify-restatement.js.map +1 -1
- package/dist/worktree.d.ts +5 -2
- package/dist/worktree.d.ts.map +1 -1
- package/dist/worktree.js +6 -5
- package/dist/worktree.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persona-sections.d.ts","sourceRoot":"","sources":["../../src/prompt-sections/persona-sections.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,CAC9C,oBAAoB,EAAE,MAAM,GAC3B,MAAM,EAAE,CAqBV;AAED;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,0BAA0B,CAAC;AAElE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,8BAA8B,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,EAAE,CAQjF;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,IAAI,MAAM,EAAE,CA8BtD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,+BAA+B,IAAI,MAAM,CAuDxD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,+BAA+B,CAC7C,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC1C,MAAM,EAAE,CAqCV;AAMD,uDAAuD;AACvD,MAAM,WAAW,kBAAkB;IACjC,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,aAAa,EAAE,cAAc,EAAE,CAAC;CACjC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"persona-sections.d.ts","sourceRoot":"","sources":["../../src/prompt-sections/persona-sections.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,CAC9C,oBAAoB,EAAE,MAAM,GAC3B,MAAM,EAAE,CAqBV;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iCAAiC,IAAI,MAAM,EAAE,CA8B5D;AAED;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,0BAA0B,CAAC;AAElE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,8BAA8B,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,EAAE,CAQjF;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,IAAI,MAAM,EAAE,CA8BtD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,+BAA+B,IAAI,MAAM,CAuDxD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,+BAA+B,CAC7C,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC1C,MAAM,EAAE,CAqCV;AAMD,uDAAuD;AACvD,MAAM,WAAW,kBAAkB;IACjC,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,aAAa,EAAE,cAAc,EAAE,CAAC;CACjC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAsDvE"}
|
|
@@ -38,6 +38,55 @@ export function buildRemediationDirectiveSection(reviewFiledOpenCount) {
|
|
|
38
38
|
'',
|
|
39
39
|
];
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Build the review-outcome-stamping obligation.
|
|
43
|
+
*
|
|
44
|
+
* A review pass MUST converge to an explicit, machine-readable outcome. The
|
|
45
|
+
* differential signal the verify gate consumes is `approved` / `gaps_found`;
|
|
46
|
+
* a review that exits WITHOUT stamping one is reality moving with nothing to
|
|
47
|
+
* measure it against -- a clean-but-unstamped review is then indistinguishable
|
|
48
|
+
* from a gaps-found review and the loop cannot converge cleanly (it falls back
|
|
49
|
+
* to issue-evidence routing and can burn a re-code cycle on a deferrable note).
|
|
50
|
+
*
|
|
51
|
+
* This section makes calling `focus_review_complete` a HARD, REQUIRED, terminal
|
|
52
|
+
* obligation rather than an optional courtesy. It is emitted on the review
|
|
53
|
+
* lineage ONLY -- a coding team has nothing to stamp -- so the caller includes
|
|
54
|
+
* it only for a reviewing-stage spawn (and the review branch of the resume
|
|
55
|
+
* delta). The literal tokens `focus_review_complete`, `approved`, `gaps_found`,
|
|
56
|
+
* `summary`, `references`, `REQUIRED`, and `terminal` all appear verbatim so the
|
|
57
|
+
* obligation is grep-verifiable by the enforcement tests and reviewers.
|
|
58
|
+
*/
|
|
59
|
+
export function buildReviewOutcomeStampingSection() {
|
|
60
|
+
return [
|
|
61
|
+
'## REQUIRED: Stamp the Review Outcome Before You Exit',
|
|
62
|
+
'',
|
|
63
|
+
'Your review is NOT complete until you stamp an explicit, machine-readable',
|
|
64
|
+
'outcome. This is a hard, terminal obligation -- not an optional courtesy.',
|
|
65
|
+
'Filing issues (or finding nothing to file) and then exiting is INCOMPLETE.',
|
|
66
|
+
'',
|
|
67
|
+
'As the FINAL step of your review pass you MUST call `focus_review_complete`',
|
|
68
|
+
'(the `telora_product_focus` tool with `action: "review_complete"`) with:',
|
|
69
|
+
'',
|
|
70
|
+
'- `outcome`: exactly one of `approved` or `gaps_found`.',
|
|
71
|
+
' - `approved` -- the diff meets the acceptance criteria for every delivery.',
|
|
72
|
+
' A non-blocking, deferrable triage note (low priority, explicitly safe to',
|
|
73
|
+
' defer) does NOT make a pass `gaps_found`: file it, then still stamp',
|
|
74
|
+
' `approved`. Only a genuinely blocking gap is `gaps_found`.',
|
|
75
|
+
' - `gaps_found` -- at least one blocking gap exists; you filed an issue for',
|
|
76
|
+
' each. The delivery re-enters the coding cycle to close them.',
|
|
77
|
+
'- `summary`: a short prose summary of what passed and what (if anything) was',
|
|
78
|
+
' filed.',
|
|
79
|
+
'- `references`: the file/section references your verdict rests on.',
|
|
80
|
+
'',
|
|
81
|
+
'Why this is required: `approved` / `gaps_found` is the differential signal',
|
|
82
|
+
'the verify gate consumes. An exited-without-stamping review is ambiguous --',
|
|
83
|
+
'the daemon cannot tell a clean review from a gaps-found one, so it falls back',
|
|
84
|
+
'to inferring an outcome from any open issues and may burn a re-code cycle on',
|
|
85
|
+
'a note you meant to defer. Stamping the outcome is what lets the loop',
|
|
86
|
+
'converge. Do NOT exit the review pass without this terminal call.',
|
|
87
|
+
'',
|
|
88
|
+
];
|
|
89
|
+
}
|
|
41
90
|
/**
|
|
42
91
|
* The marker we look for in the assembled stage-directive context to know a
|
|
43
92
|
* review report is being rendered into the prompt. The focus.last_review_report
|
|
@@ -312,6 +361,12 @@ export function buildResumeDeltaMessage(ctx) {
|
|
|
312
361
|
lines.push('integration base yourself to see the current state of the worktree._');
|
|
313
362
|
}
|
|
314
363
|
lines.push('');
|
|
364
|
+
// A resumed review session must still converge to a stamped outcome -- the
|
|
365
|
+
// obligation is carried on the delta too, not just the fresh prompt, so a
|
|
366
|
+
// review that runs entirely across resumes cannot exit unstamped.
|
|
367
|
+
if (isReview) {
|
|
368
|
+
lines.push(...buildReviewOutcomeStampingSection());
|
|
369
|
+
}
|
|
315
370
|
return lines.join('\n');
|
|
316
371
|
}
|
|
317
372
|
//# sourceMappingURL=persona-sections.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persona-sections.js","sourceRoot":"","sources":["../../src/prompt-sections/persona-sections.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gCAAgC,CAC9C,oBAA4B;IAE5B,IAAI,oBAAoB,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IACzC,OAAO;QACL,+BAA+B;QAC/B,EAAE;QACF,4BAA4B,oBAAo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AAI,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACjC,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,IAAI,CAAC,oEAAoE,CAAC,CAAC;QACjF,KAAK,CAAC,IAAI,CAAC,sEAAsE,CAAC,CAAC;IACrF,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,2EAA2E;IAC3E,0EAA0E;IAC1E,kEAAkE;IAClE,IAAI,QAAQ,EAAE,CAAC;QACb,KAAK,CAAC,IAAI,CAAC,GAAG,iCAAiC,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* - Record the outcome of a verification attempt.
|
|
6
6
|
* - Trigger the existing reality_tree_verify_injection compound op on pass.
|
|
7
7
|
*/
|
|
8
|
+
import { type NodeWriteback, type WritebackClassification } from '../reality-writeback.js';
|
|
8
9
|
export type VerificationMethod = 'deterministic' | 'behavioral' | 'ai_inspection';
|
|
9
10
|
export type VerificationOutcome = 'pending' | 'passed' | 'failed' | 'escalated';
|
|
10
11
|
export interface PendingVerification {
|
|
@@ -56,4 +57,135 @@ export declare function verifyInjectionOnPass(injectionNodeId: string, restateme
|
|
|
56
57
|
* the verify decision.
|
|
57
58
|
*/
|
|
58
59
|
export declare function verifyInjectionWithEvidence(injectionNodeId: string, evidence: string): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Translate the pure `decideNodeWriteback` output into the verify call's
|
|
62
|
+
* `restatements` payload.
|
|
63
|
+
*
|
|
64
|
+
* The flip endpoint (`reality_tree_verify_injection`) is the only seam that
|
|
65
|
+
* persists a node's `verify_classification` / `verify_divergence_reason`, and
|
|
66
|
+
* it does so per-restatement -- but ONLY when the restatement carries a
|
|
67
|
+
* non-empty `statement` (an empty statement is dropped whole, classification
|
|
68
|
+
* included). So a writeback can be applied iff it carries achieved prose.
|
|
69
|
+
*
|
|
70
|
+
* Mapping:
|
|
71
|
+
* - match | legitimate_divergence WITH a non-empty statement -> a
|
|
72
|
+
* VerifyRestatement carried into the flip so classification (+ reason)
|
|
73
|
+
* lands atomically with the promotion. The achieved statement is the prose
|
|
74
|
+
* written as the targeted UDE's new base statement (for a match this equals
|
|
75
|
+
* the declared desired effect carried forward unchanged).
|
|
76
|
+
* - any writeback WITHOUT achieved prose, or a `shortfall` -> NOT emitted as
|
|
77
|
+
* a restatement (there is no edge path that stamps classification without
|
|
78
|
+
* prose, and a shortfall must not flip the node). Reported back via
|
|
79
|
+
* `skipped` so the caller can see what was not stamped.
|
|
80
|
+
*
|
|
81
|
+
* Pure (no I/O); exported for unit testing the mapping.
|
|
82
|
+
*/
|
|
83
|
+
export declare function planNodeWritebackApply(writebacks: readonly NodeWriteback[]): {
|
|
84
|
+
restatements: VerifyRestatement[];
|
|
85
|
+
skipped: Array<{
|
|
86
|
+
nodeId: string;
|
|
87
|
+
reason: string;
|
|
88
|
+
}>;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Same as `verifyInjectionWithEvidence` but additionally stamps the per-node
|
|
92
|
+
* realized/diverged writeback computed by `decideNodeWriteback`. Closes the
|
|
93
|
+
* reality-tree writeback loop: as a delivery lands, the nodes its injection
|
|
94
|
+
* targeted carry an explicit match / legitimate_divergence status legible to a
|
|
95
|
+
* later reader.
|
|
96
|
+
*
|
|
97
|
+
* Order of operations:
|
|
98
|
+
* 1. `reality_tree_node_update` on the injection node -> persist evidence.
|
|
99
|
+
* 2. `reality_tree_verify_injection` with the per-node restatements -> flips
|
|
100
|
+
* the injection and promotes overlays, applying the classification (+
|
|
101
|
+
* reason) to each targeted UDE atomically. Writebacks with no achieved
|
|
102
|
+
* prose, and shortfalls, are skipped (logged) -- there is no edge path
|
|
103
|
+
* that persists a classification without prose / a flip.
|
|
104
|
+
*
|
|
105
|
+
* Non-destructive: only stamps status + evidence/reason on nodes the injection
|
|
106
|
+
* owns; a match carries the declared desired effect forward unchanged. When
|
|
107
|
+
* `writebacks` is empty this is byte-equivalent to `verifyInjectionWithEvidence`.
|
|
108
|
+
*/
|
|
109
|
+
export declare function verifyInjectionWithWriteback(injectionNodeId: string, evidence: string, writebacks: readonly NodeWriteback[], realityTreeId?: string): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Surface inward drift proposals for the contradicted nodes in a writeback.
|
|
112
|
+
*
|
|
113
|
+
* For each writeback the pure `detectInwardDrift` deems a contradicted claim
|
|
114
|
+
* (`legitimate_divergence` / `shortfall`), create one `update_statement`
|
|
115
|
+
* crt_drift_proposal flagged `inward:true` via the EXISTING
|
|
116
|
+
* `crt_drift_proposal_create` pipeline. A `match` (or unstamped) node yields
|
|
117
|
+
* nothing, so a clean landing emits no proposals.
|
|
118
|
+
*
|
|
119
|
+
* Requires the reality tree id (the create action keys off it). When the tree
|
|
120
|
+
* id is unknown, the proposals cannot be created -- we log and skip, leaving
|
|
121
|
+
* the per-node stamps in place (a later reader still sees the divergence).
|
|
122
|
+
*
|
|
123
|
+
* Non-fatal: each create is independently try/caught so one failure neither
|
|
124
|
+
* blocks the others nor unwinds the already-applied verify flip.
|
|
125
|
+
*/
|
|
126
|
+
export declare function emitInwardDriftProposals(injectionNodeId: string, writebacks: readonly NodeWriteback[], realityTreeId?: string): Promise<void>;
|
|
127
|
+
/**
|
|
128
|
+
* One targeted UDE node resolved at landing: its id plus its declared
|
|
129
|
+
* desired-effect prose, used as the achieved statement on a clean match (the
|
|
130
|
+
* achieved effect equals the declared one, carried forward unchanged).
|
|
131
|
+
*/
|
|
132
|
+
export interface ResolvedTargetedNode {
|
|
133
|
+
nodeId: string;
|
|
134
|
+
/** The declared desired-effect prose (frt_statement, else statement). */
|
|
135
|
+
achievedStatement: string;
|
|
136
|
+
/**
|
|
137
|
+
* The node's ORIGINAL claim prose (frt_statement, else statement) AS IT
|
|
138
|
+
* STANDS NOW. For a close-loop clean landing the achieved effect equals the
|
|
139
|
+
* declared one, so this equals `achievedStatement`; it is carried separately
|
|
140
|
+
* so a divergent landing (where achieved != claim) can frame the inward drift
|
|
141
|
+
* proposal against the tree's claim rather than the achieved reality.
|
|
142
|
+
*/
|
|
143
|
+
originalClaim: string;
|
|
144
|
+
/**
|
|
145
|
+
* The node's EXISTING stamped verify_classification, if any (e.g. stamped
|
|
146
|
+
* `legitimate_divergence`/`shortfall` by the per-delivery verify path before
|
|
147
|
+
* the focus reached close_loop). Used so the close-loop sweep does NOT
|
|
148
|
+
* clobber an already-diverged stamp back to `match` (TEL-3). `null`/absent =>
|
|
149
|
+
* unstamped, the sweep stamps a clean match.
|
|
150
|
+
*/
|
|
151
|
+
existingClassification?: WritebackClassification | null;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Resolve the targeted UDE nodes of an injection via the existing
|
|
155
|
+
* `reality_tree_edge_list` ('targets' edges out of the injection) joined to
|
|
156
|
+
* `reality_tree_node_list` for each target's declared prose. Returns [] when
|
|
157
|
+
* the tree id is unknown or a lookup fails -- the writeback then degrades to a
|
|
158
|
+
* plain injection verify (no per-node stamping), which is non-destructive and
|
|
159
|
+
* matches prior behavior.
|
|
160
|
+
*/
|
|
161
|
+
export declare function resolveTargetedNodes(injectionId: string, treeId: string | undefined): Promise<ResolvedTargetedNode[]>;
|
|
162
|
+
/**
|
|
163
|
+
* Build the writeback-applying verify callback used by the close-loop sweep.
|
|
164
|
+
*
|
|
165
|
+
* For each injection the sweep verifies, this closure:
|
|
166
|
+
* 1. Resolves the injection's targeted UDE node ids (edge-list) + each node's
|
|
167
|
+
* EXISTING verify_classification.
|
|
168
|
+
* 2. Models the landing as a CLEAN realization for the still-unstamped (or
|
|
169
|
+
* already-match) targets -- the anchoring delivery closed successfully, so
|
|
170
|
+
* the cascade is treated as flipped and the injection as delivered. A
|
|
171
|
+
* target the per-delivery verify path ALREADY stamped as a contradiction
|
|
172
|
+
* (legitimate_divergence / shortfall) is EXCLUDED from the landing so the
|
|
173
|
+
* close-loop sweep never clobbers a diverged stamp back to 'match' (TEL-3).
|
|
174
|
+
* 3. Computes the per-node writeback and applies it via
|
|
175
|
+
* `verifyInjectionWithWriteback`, stamping match/evidence on each targeted
|
|
176
|
+
* UDE so a later reader sees which claims actually held.
|
|
177
|
+
*
|
|
178
|
+
* No targeted nodes -> the writeback is empty and the call is byte-equivalent
|
|
179
|
+
* to the plain `verifyInjectionWithEvidence`.
|
|
180
|
+
*
|
|
181
|
+
* `treeIdByInjection` maps an injection node id to its reality_tree id, captured
|
|
182
|
+
* by the dispatcher from the focus-injections snapshot. The returned callback
|
|
183
|
+
* matches the `(injectionId, evidence) => Promise<void>` shape the close-loop
|
|
184
|
+
* sweep expects, so it drops into `advanceFocusToDoneWithSweep` unchanged.
|
|
185
|
+
*
|
|
186
|
+
* Exported here (rather than in the dispatcher) so the wiring is unit-testable
|
|
187
|
+
* against the callApi mock seam without dragging the dispatcher's heavy import
|
|
188
|
+
* graph.
|
|
189
|
+
*/
|
|
190
|
+
export declare function buildWritebackVerify(treeIdByInjection: ReadonlyMap<string, string>): (injectionId: string, evidence: string) => Promise<void>;
|
|
59
191
|
//# sourceMappingURL=verification.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification.d.ts","sourceRoot":"","sources":["../../src/queries/verification.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"verification.d.ts","sourceRoot":"","sources":["../../src/queries/verification.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAGL,KAAK,aAAa,EAGlB,KAAK,uBAAuB,EAC7B,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG,YAAY,GAAG,eAAe,CAAC;AAClF,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,CA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import { decideNodeWriteback, detectInwardDrift, } from '../reality-writeback.js';
|
|
9
10
|
export async function getPendingVerifications(productId) {
|
|
10
11
|
const response = await callApi('daemon_get_pending_verifications', productId ? { productId } : {});
|
|
11
12
|
return response.items ?? [];
|
|
@@ -46,4 +47,274 @@ export async function verifyInjectionWithEvidence(injectionNodeId, evidence) {
|
|
|
46
47
|
});
|
|
47
48
|
await callApi('reality_tree_verify_injection', { injectionNodeId });
|
|
48
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Translate the pure `decideNodeWriteback` output into the verify call's
|
|
52
|
+
* `restatements` payload.
|
|
53
|
+
*
|
|
54
|
+
* The flip endpoint (`reality_tree_verify_injection`) is the only seam that
|
|
55
|
+
* persists a node's `verify_classification` / `verify_divergence_reason`, and
|
|
56
|
+
* it does so per-restatement -- but ONLY when the restatement carries a
|
|
57
|
+
* non-empty `statement` (an empty statement is dropped whole, classification
|
|
58
|
+
* included). So a writeback can be applied iff it carries achieved prose.
|
|
59
|
+
*
|
|
60
|
+
* Mapping:
|
|
61
|
+
* - match | legitimate_divergence WITH a non-empty statement -> a
|
|
62
|
+
* VerifyRestatement carried into the flip so classification (+ reason)
|
|
63
|
+
* lands atomically with the promotion. The achieved statement is the prose
|
|
64
|
+
* written as the targeted UDE's new base statement (for a match this equals
|
|
65
|
+
* the declared desired effect carried forward unchanged).
|
|
66
|
+
* - any writeback WITHOUT achieved prose, or a `shortfall` -> NOT emitted as
|
|
67
|
+
* a restatement (there is no edge path that stamps classification without
|
|
68
|
+
* prose, and a shortfall must not flip the node). Reported back via
|
|
69
|
+
* `skipped` so the caller can see what was not stamped.
|
|
70
|
+
*
|
|
71
|
+
* Pure (no I/O); exported for unit testing the mapping.
|
|
72
|
+
*/
|
|
73
|
+
export function planNodeWritebackApply(writebacks) {
|
|
74
|
+
const restatements = [];
|
|
75
|
+
const skipped = [];
|
|
76
|
+
for (const wb of writebacks) {
|
|
77
|
+
if (wb.classification === 'shortfall') {
|
|
78
|
+
skipped.push({
|
|
79
|
+
nodeId: wb.nodeId,
|
|
80
|
+
reason: 'shortfall: no flip; classification not persisted (claim did not hold)',
|
|
81
|
+
});
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
// TEL-6: an `assumed` match carries no evidence. Persisting a
|
|
85
|
+
// verify_classification='match' for it would record an UNEARNED "verified"
|
|
86
|
+
// claim, so skip it -- the node stays unstamped until grounded by evidence.
|
|
87
|
+
if (wb.classification === 'match' && wb.assumed === true) {
|
|
88
|
+
skipped.push({
|
|
89
|
+
nodeId: wb.nodeId,
|
|
90
|
+
reason: 'assumed match: no evidence; not stamped verified (unearned certainty)',
|
|
91
|
+
});
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
const statement = wb.statement;
|
|
95
|
+
if (typeof statement !== 'string' || statement.trim().length === 0) {
|
|
96
|
+
skipped.push({
|
|
97
|
+
nodeId: wb.nodeId,
|
|
98
|
+
reason: 'no achieved statement: verify edge drops a restatement with empty prose',
|
|
99
|
+
});
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
// match | legitimate_divergence WITH prose -> restatement.
|
|
103
|
+
const entry = {
|
|
104
|
+
nodeId: wb.nodeId,
|
|
105
|
+
statement,
|
|
106
|
+
classification: wb.classification,
|
|
107
|
+
};
|
|
108
|
+
if (wb.classification === 'legitimate_divergence' && wb.verifyDivergenceReason) {
|
|
109
|
+
entry.divergenceReason = wb.verifyDivergenceReason;
|
|
110
|
+
}
|
|
111
|
+
restatements.push(entry);
|
|
112
|
+
}
|
|
113
|
+
return { restatements, skipped };
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Same as `verifyInjectionWithEvidence` but additionally stamps the per-node
|
|
117
|
+
* realized/diverged writeback computed by `decideNodeWriteback`. Closes the
|
|
118
|
+
* reality-tree writeback loop: as a delivery lands, the nodes its injection
|
|
119
|
+
* targeted carry an explicit match / legitimate_divergence status legible to a
|
|
120
|
+
* later reader.
|
|
121
|
+
*
|
|
122
|
+
* Order of operations:
|
|
123
|
+
* 1. `reality_tree_node_update` on the injection node -> persist evidence.
|
|
124
|
+
* 2. `reality_tree_verify_injection` with the per-node restatements -> flips
|
|
125
|
+
* the injection and promotes overlays, applying the classification (+
|
|
126
|
+
* reason) to each targeted UDE atomically. Writebacks with no achieved
|
|
127
|
+
* prose, and shortfalls, are skipped (logged) -- there is no edge path
|
|
128
|
+
* that persists a classification without prose / a flip.
|
|
129
|
+
*
|
|
130
|
+
* Non-destructive: only stamps status + evidence/reason on nodes the injection
|
|
131
|
+
* owns; a match carries the declared desired effect forward unchanged. When
|
|
132
|
+
* `writebacks` is empty this is byte-equivalent to `verifyInjectionWithEvidence`.
|
|
133
|
+
*/
|
|
134
|
+
export async function verifyInjectionWithWriteback(injectionNodeId, evidence, writebacks, realityTreeId) {
|
|
135
|
+
await callApi('reality_tree_node_update', {
|
|
136
|
+
nodeId: injectionNodeId,
|
|
137
|
+
evidence,
|
|
138
|
+
});
|
|
139
|
+
const { restatements, skipped } = planNodeWritebackApply(writebacks);
|
|
140
|
+
if (skipped.length > 0) {
|
|
141
|
+
console.warn(`[reality-writeback] injection ${injectionNodeId.slice(0, 8)}: ` +
|
|
142
|
+
`${skipped.length} targeted node writeback(s) not stamped -- ` +
|
|
143
|
+
skipped.map((s) => `${s.nodeId.slice(0, 8)} (${s.reason})`).join('; '));
|
|
144
|
+
}
|
|
145
|
+
const verifyBody = { injectionNodeId };
|
|
146
|
+
if (restatements.length > 0)
|
|
147
|
+
verifyBody.restatements = restatements;
|
|
148
|
+
await callApi('reality_tree_verify_injection', verifyBody);
|
|
149
|
+
// Inward drift: any node reality CONTRADICTED (legitimate_divergence /
|
|
150
|
+
// shortfall) is a claim the tree got wrong. Turn each one into an inward
|
|
151
|
+
// crt_drift_proposal so the tree-owner can correct the asserting claim,
|
|
152
|
+
// instead of leaving a mistaken assertion frozen. Surfaced for human ratify;
|
|
153
|
+
// never auto-applied. Best-effort + non-fatal: a proposal-emit failure must
|
|
154
|
+
// not undo the verify/flip that already landed.
|
|
155
|
+
await emitInwardDriftProposals(injectionNodeId, writebacks, realityTreeId);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Surface inward drift proposals for the contradicted nodes in a writeback.
|
|
159
|
+
*
|
|
160
|
+
* For each writeback the pure `detectInwardDrift` deems a contradicted claim
|
|
161
|
+
* (`legitimate_divergence` / `shortfall`), create one `update_statement`
|
|
162
|
+
* crt_drift_proposal flagged `inward:true` via the EXISTING
|
|
163
|
+
* `crt_drift_proposal_create` pipeline. A `match` (or unstamped) node yields
|
|
164
|
+
* nothing, so a clean landing emits no proposals.
|
|
165
|
+
*
|
|
166
|
+
* Requires the reality tree id (the create action keys off it). When the tree
|
|
167
|
+
* id is unknown, the proposals cannot be created -- we log and skip, leaving
|
|
168
|
+
* the per-node stamps in place (a later reader still sees the divergence).
|
|
169
|
+
*
|
|
170
|
+
* Non-fatal: each create is independently try/caught so one failure neither
|
|
171
|
+
* blocks the others nor unwinds the already-applied verify flip.
|
|
172
|
+
*/
|
|
173
|
+
export async function emitInwardDriftProposals(injectionNodeId, writebacks, realityTreeId) {
|
|
174
|
+
const proposals = writebacks
|
|
175
|
+
.map((wb) => {
|
|
176
|
+
const stamped = {
|
|
177
|
+
nodeId: wb.nodeId,
|
|
178
|
+
verifyClassification: wb.classification,
|
|
179
|
+
verifyDivergenceReason: wb.verifyDivergenceReason ?? null,
|
|
180
|
+
// TEL-5: the claim a human ratifier must reconsider is the tree's
|
|
181
|
+
// ORIGINAL assertion (the claim reality CONTRADICTED), NOT the achieved
|
|
182
|
+
// reality prose. Carry `originalClaim`; the detector falls back to a
|
|
183
|
+
// placeholder when it is absent. (`wb.statement` is the achieved prose
|
|
184
|
+
// -- it belongs in proposedCorrection / the divergence reason, never in
|
|
185
|
+
// observedState.)
|
|
186
|
+
claimStatement: wb.originalClaim ?? null,
|
|
187
|
+
};
|
|
188
|
+
return detectInwardDrift(stamped);
|
|
189
|
+
})
|
|
190
|
+
.filter((p) => p !== null);
|
|
191
|
+
if (proposals.length === 0)
|
|
192
|
+
return;
|
|
193
|
+
if (!realityTreeId) {
|
|
194
|
+
console.warn(`[reality-writeback] injection ${injectionNodeId.slice(0, 8)}: ` +
|
|
195
|
+
`${proposals.length} contradicted node(s) detected but no realityTreeId -- ` +
|
|
196
|
+
`inward drift proposals NOT created (per-node stamps retained).`);
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
for (const proposal of proposals) {
|
|
200
|
+
try {
|
|
201
|
+
await callApi('crt_drift_proposal_create', {
|
|
202
|
+
realityTreeId,
|
|
203
|
+
proposalKind: proposal.proposalKind,
|
|
204
|
+
observedState: proposal.observedState,
|
|
205
|
+
proposedCorrection: proposal.proposedCorrection,
|
|
206
|
+
nodeId: proposal.nodeId,
|
|
207
|
+
proposedMetadata: proposal.proposedMetadata,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
catch (err) {
|
|
211
|
+
console.warn(`[reality-writeback] Failed to create inward drift proposal for node ` +
|
|
212
|
+
`${proposal.nodeId.slice(0, 8)} (tree ${realityTreeId.slice(0, 8)}): ` +
|
|
213
|
+
`${err.message}. Stamp retained; proposal not surfaced.`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Resolve the targeted UDE nodes of an injection via the existing
|
|
219
|
+
* `reality_tree_edge_list` ('targets' edges out of the injection) joined to
|
|
220
|
+
* `reality_tree_node_list` for each target's declared prose. Returns [] when
|
|
221
|
+
* the tree id is unknown or a lookup fails -- the writeback then degrades to a
|
|
222
|
+
* plain injection verify (no per-node stamping), which is non-destructive and
|
|
223
|
+
* matches prior behavior.
|
|
224
|
+
*/
|
|
225
|
+
export async function resolveTargetedNodes(injectionId, treeId) {
|
|
226
|
+
if (!treeId)
|
|
227
|
+
return [];
|
|
228
|
+
try {
|
|
229
|
+
const [edgesResp, nodesResp] = await Promise.all([
|
|
230
|
+
callApi('reality_tree_edge_list', { treeId }),
|
|
231
|
+
callApi('reality_tree_node_list', { treeId }),
|
|
232
|
+
]);
|
|
233
|
+
const targetIds = (edgesResp.items ?? [])
|
|
234
|
+
.filter((e) => e.edgeType === 'targets' && e.fromNodeId === injectionId)
|
|
235
|
+
.map((e) => e.toNodeId);
|
|
236
|
+
if (targetIds.length === 0)
|
|
237
|
+
return [];
|
|
238
|
+
const nodeById = new Map();
|
|
239
|
+
for (const n of nodesResp.items ?? [])
|
|
240
|
+
nodeById.set(n.id, n);
|
|
241
|
+
const isClassification = (v) => v === 'match' || v === 'legitimate_divergence' || v === 'shortfall';
|
|
242
|
+
return targetIds.map((nodeId) => {
|
|
243
|
+
const node = nodeById.get(nodeId);
|
|
244
|
+
const declared = node?.frtStatement ?? node?.statement ?? '';
|
|
245
|
+
const existing = node?.verifyClassification;
|
|
246
|
+
return {
|
|
247
|
+
nodeId,
|
|
248
|
+
achievedStatement: declared,
|
|
249
|
+
originalClaim: declared,
|
|
250
|
+
existingClassification: isClassification(existing) ? existing : null,
|
|
251
|
+
};
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
catch (err) {
|
|
255
|
+
console.warn(`[reality-writeback] Failed to resolve targeted nodes for injection ` +
|
|
256
|
+
`${injectionId.slice(0, 8)} (tree ${treeId.slice(0, 8)}): ${err.message}. ` +
|
|
257
|
+
`Falling back to plain verify (no per-node writeback).`);
|
|
258
|
+
return [];
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Build the writeback-applying verify callback used by the close-loop sweep.
|
|
263
|
+
*
|
|
264
|
+
* For each injection the sweep verifies, this closure:
|
|
265
|
+
* 1. Resolves the injection's targeted UDE node ids (edge-list) + each node's
|
|
266
|
+
* EXISTING verify_classification.
|
|
267
|
+
* 2. Models the landing as a CLEAN realization for the still-unstamped (or
|
|
268
|
+
* already-match) targets -- the anchoring delivery closed successfully, so
|
|
269
|
+
* the cascade is treated as flipped and the injection as delivered. A
|
|
270
|
+
* target the per-delivery verify path ALREADY stamped as a contradiction
|
|
271
|
+
* (legitimate_divergence / shortfall) is EXCLUDED from the landing so the
|
|
272
|
+
* close-loop sweep never clobbers a diverged stamp back to 'match' (TEL-3).
|
|
273
|
+
* 3. Computes the per-node writeback and applies it via
|
|
274
|
+
* `verifyInjectionWithWriteback`, stamping match/evidence on each targeted
|
|
275
|
+
* UDE so a later reader sees which claims actually held.
|
|
276
|
+
*
|
|
277
|
+
* No targeted nodes -> the writeback is empty and the call is byte-equivalent
|
|
278
|
+
* to the plain `verifyInjectionWithEvidence`.
|
|
279
|
+
*
|
|
280
|
+
* `treeIdByInjection` maps an injection node id to its reality_tree id, captured
|
|
281
|
+
* by the dispatcher from the focus-injections snapshot. The returned callback
|
|
282
|
+
* matches the `(injectionId, evidence) => Promise<void>` shape the close-loop
|
|
283
|
+
* sweep expects, so it drops into `advanceFocusToDoneWithSweep` unchanged.
|
|
284
|
+
*
|
|
285
|
+
* Exported here (rather than in the dispatcher) so the wiring is unit-testable
|
|
286
|
+
* against the callApi mock seam without dragging the dispatcher's heavy import
|
|
287
|
+
* graph.
|
|
288
|
+
*/
|
|
289
|
+
export function buildWritebackVerify(treeIdByInjection) {
|
|
290
|
+
return async (injectionId, evidence) => {
|
|
291
|
+
const treeId = treeIdByInjection.get(injectionId);
|
|
292
|
+
const resolved = await resolveTargetedNodes(injectionId, treeId);
|
|
293
|
+
// TEL-3: a node the per-delivery verify path ALREADY stamped as a
|
|
294
|
+
// contradiction (legitimate_divergence / shortfall) must NOT be clobbered
|
|
295
|
+
// back to 'match' at close-loop. Exclude it from the clean-match landing --
|
|
296
|
+
// its stamp (and its inward drift proposal) already landed at verify time.
|
|
297
|
+
// Only un-stamped (or already-match) nodes get a fresh close-loop match.
|
|
298
|
+
const targetedNodes = resolved
|
|
299
|
+
.filter((n) => n.existingClassification !== 'legitimate_divergence' &&
|
|
300
|
+
n.existingClassification !== 'shortfall')
|
|
301
|
+
.map((n) => ({
|
|
302
|
+
nodeId: n.nodeId,
|
|
303
|
+
achievedStatement: n.achievedStatement,
|
|
304
|
+
originalClaim: n.originalClaim,
|
|
305
|
+
}));
|
|
306
|
+
const writebacks = decideNodeWriteback({
|
|
307
|
+
injectionId,
|
|
308
|
+
targetedNodes,
|
|
309
|
+
cascadeFlipped: true,
|
|
310
|
+
delivered: true,
|
|
311
|
+
evidence,
|
|
312
|
+
});
|
|
313
|
+
// Pass the tree id so any contradicted node (divergence/shortfall) can be
|
|
314
|
+
// surfaced as an inward drift proposal. The close-loop sweep models a clean
|
|
315
|
+
// landing (all 'match'), so this emits nothing here today -- but the seam is
|
|
316
|
+
// wired so a divergent landing routed through this path corrects the tree.
|
|
317
|
+
await verifyInjectionWithWriteback(injectionId, evidence, writebacks, treeId);
|
|
318
|
+
};
|
|
319
|
+
}
|
|
49
320
|
//# sourceMappingURL=verification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification.js","sourceRoot":"","sources":["../../src/queries/verification.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"verification.js","sourceRoot":"","sources":["../../src/queries/verification.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EACL,mBAAmB,EACnB,iBAAiB,GAKlB,MAAM,yBAAyB,CAAC;AAiBjC,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,SAAkB;IAElB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAC5B,kCAAkC,EAClC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAC/B,CAAC;IACF,OAAO,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC;AAC9B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACrD,UAAkB,EAClB,OAA4B;IAE5B,MAAM,OAA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