@telora/daemon 0.22.208 → 0.22.227
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 +4 -3
- package/dist/backends/index.d.ts.map +1 -1
- package/dist/backends/index.js +3 -1
- package/dist/backends/index.js.map +1 -1
- package/dist/completion/advancement-stall-watchdog.d.ts.map +1 -1
- package/dist/completion/advancement-stall-watchdog.js +6 -2
- package/dist/completion/advancement-stall-watchdog.js.map +1 -1
- package/dist/completion/completion-decision.d.ts +10 -1
- package/dist/completion/completion-decision.d.ts.map +1 -1
- package/dist/completion/completion-decision.js +1 -1
- package/dist/completion/completion-decision.js.map +1 -1
- package/dist/completion/delivery-advancement-guard.d.ts +31 -16
- package/dist/completion/delivery-advancement-guard.d.ts.map +1 -1
- package/dist/completion/delivery-advancement-guard.js +22 -37
- package/dist/completion/delivery-advancement-guard.js.map +1 -1
- package/dist/completion/detector.d.ts.map +1 -1
- package/dist/completion/detector.js +3 -1
- package/dist/completion/detector.js.map +1 -1
- package/dist/completion/event-phases.d.ts +19 -8
- package/dist/completion/event-phases.d.ts.map +1 -1
- package/dist/completion/event-phases.js +67 -88
- package/dist/completion/event-phases.js.map +1 -1
- package/dist/completion/event.d.ts +12 -9
- package/dist/completion/event.d.ts.map +1 -1
- package/dist/completion/event.js +6 -3
- package/dist/completion/event.js.map +1 -1
- package/dist/completion/index.js +1 -1
- package/dist/completion/progress-snapshot.d.ts +13 -9
- package/dist/completion/progress-snapshot.d.ts.map +1 -1
- package/dist/completion/progress-snapshot.js +16 -13
- package/dist/completion/progress-snapshot.js.map +1 -1
- package/dist/completion/reengagement-redrive.d.ts +8 -1
- package/dist/completion/reengagement-redrive.d.ts.map +1 -1
- package/dist/completion/reengagement-redrive.js +16 -2
- package/dist/completion/reengagement-redrive.js.map +1 -1
- package/dist/completion/review-defect-detector.d.ts +58 -18
- package/dist/completion/review-defect-detector.d.ts.map +1 -1
- package/dist/completion/review-defect-detector.js +62 -27
- package/dist/completion/review-defect-detector.js.map +1 -1
- package/dist/completion/review-exit-attribution.d.ts +6 -3
- package/dist/completion/review-exit-attribution.d.ts.map +1 -1
- package/dist/completion/review-exit-attribution.js +9 -7
- package/dist/completion/review-exit-attribution.js.map +1 -1
- package/dist/completion/review-exit-deps.d.ts +2 -0
- package/dist/completion/review-exit-deps.d.ts.map +1 -1
- package/dist/completion/review-exit-deps.js +3 -0
- package/dist/completion/review-exit-deps.js.map +1 -1
- package/dist/completion/review-exit-evidence.d.ts +8 -0
- package/dist/completion/review-exit-evidence.d.ts.map +1 -1
- package/dist/completion/review-exit-evidence.js +39 -27
- package/dist/completion/review-exit-evidence.js.map +1 -1
- package/dist/completion/review-exit-foreign-findings.d.ts +5 -1
- package/dist/completion/review-exit-foreign-findings.d.ts.map +1 -1
- package/dist/completion/review-exit-foreign-findings.js +4 -4
- package/dist/completion/review-exit-foreign-findings.js.map +1 -1
- package/dist/completion/review-exit-phase.js +4 -4
- package/dist/completion/review-exit-phase.js.map +1 -1
- package/dist/completion/state-cascade.d.ts.map +1 -1
- package/dist/completion/state-cascade.js +11 -19
- package/dist/completion/state-cascade.js.map +1 -1
- package/dist/completion/team-progress-measure.d.ts +70 -0
- package/dist/completion/team-progress-measure.d.ts.map +1 -0
- package/dist/completion/team-progress-measure.js +285 -0
- package/dist/completion/team-progress-measure.js.map +1 -0
- package/dist/completion/team-stillness.d.ts +76 -0
- package/dist/completion/team-stillness.d.ts.map +1 -0
- package/dist/completion/team-stillness.js +96 -0
- package/dist/completion/team-stillness.js.map +1 -0
- package/dist/completion/worker-wait.d.ts +84 -0
- package/dist/completion/worker-wait.d.ts.map +1 -0
- package/dist/completion/worker-wait.js +89 -0
- package/dist/completion/worker-wait.js.map +1 -0
- package/dist/delivery/delivery-advance-block.d.ts.map +1 -1
- package/dist/delivery/delivery-advance-block.js +1 -2
- package/dist/delivery/delivery-advance-block.js.map +1 -1
- package/dist/delivery/delivery-reconciler.d.ts +3 -3
- package/dist/focus/focus-lifecycle.d.ts.map +1 -1
- package/dist/focus/focus-lifecycle.js +7 -1
- package/dist/focus/focus-lifecycle.js.map +1 -1
- package/dist/focus/focus-team-state.js +1 -1
- package/dist/focus/focus-worktree-state.d.ts.map +1 -1
- package/dist/focus/focus-worktree-state.js +2 -1
- package/dist/focus/focus-worktree-state.js.map +1 -1
- package/dist/git/focus-integration-sync.d.ts +42 -4
- package/dist/git/focus-integration-sync.d.ts.map +1 -1
- package/dist/git/focus-integration-sync.js +53 -9
- package/dist/git/focus-integration-sync.js.map +1 -1
- package/dist/git/types.d.ts.map +1 -1
- package/dist/git/types.js +4 -2
- package/dist/git/types.js.map +1 -1
- package/dist/merge/merge-back-loop.d.ts.map +1 -1
- package/dist/merge/merge-back-loop.js +0 -1
- package/dist/merge/merge-back-loop.js.map +1 -1
- package/dist/prompt-sections/persona-sections.d.ts +14 -0
- package/dist/prompt-sections/persona-sections.d.ts.map +1 -1
- package/dist/prompt-sections/persona-sections.js +50 -19
- package/dist/prompt-sections/persona-sections.js.map +1 -1
- package/dist/prompt-sections/testing-standard.d.ts +4 -1
- package/dist/prompt-sections/testing-standard.d.ts.map +1 -1
- package/dist/prompt-sections/testing-standard.js +14 -4
- package/dist/prompt-sections/testing-standard.js.map +1 -1
- package/dist/queries/deliveries.d.ts.map +1 -1
- package/dist/queries/deliveries.js +3 -1
- package/dist/queries/deliveries.js.map +1 -1
- package/dist/queries/delivery-gate-state.js +1 -1
- package/dist/queries/escalation-suppression.js +1 -1
- package/dist/queries/escalations.js +1 -1
- package/dist/queries/focus-integration-conflict.d.ts +7 -4
- package/dist/queries/focus-integration-conflict.d.ts.map +1 -1
- package/dist/queries/focus-integration-conflict.js +6 -3
- package/dist/queries/focus-integration-conflict.js.map +1 -1
- package/dist/queries/review-finding-facts.d.ts +38 -0
- package/dist/queries/review-finding-facts.d.ts.map +1 -0
- package/dist/queries/review-finding-facts.js +43 -0
- package/dist/queries/review-finding-facts.js.map +1 -0
- package/dist/queries/schemas.d.ts +15 -0
- package/dist/queries/schemas.d.ts.map +1 -1
- package/dist/queries/schemas.js +12 -1
- package/dist/queries/schemas.js.map +1 -1
- package/dist/queries/shortfall-park-record.d.ts +6 -1
- package/dist/queries/shortfall-park-record.d.ts.map +1 -1
- package/dist/queries/shortfall-park-record.js.map +1 -1
- package/dist/queries/shortfall-rulings.d.ts +14 -2
- package/dist/queries/shortfall-rulings.d.ts.map +1 -1
- package/dist/queries/shortfall-rulings.js +17 -3
- package/dist/queries/shortfall-rulings.js.map +1 -1
- package/dist/queries/verification.js +1 -1
- package/dist/queries/verify-own-holds.d.ts.map +1 -1
- package/dist/queries/verify-own-holds.js +1 -0
- package/dist/queries/verify-own-holds.js.map +1 -1
- package/dist/spawn/helpers.d.ts.map +1 -1
- package/dist/spawn/helpers.js +9 -1
- package/dist/spawn/helpers.js.map +1 -1
- package/dist/spawn/lead-continuation.d.ts +10 -2
- package/dist/spawn/lead-continuation.d.ts.map +1 -1
- package/dist/spawn/lead-continuation.js +39 -22
- package/dist/spawn/lead-continuation.js.map +1 -1
- package/dist/spawn/one-shot-model.d.ts.map +1 -1
- package/dist/spawn/one-shot-model.js +1 -0
- package/dist/spawn/one-shot-model.js.map +1 -1
- package/dist/spawn/worktree-session.d.ts.map +1 -1
- package/dist/spawn/worktree-session.js +11 -1
- package/dist/spawn/worktree-session.js.map +1 -1
- package/dist/testing/fixtures/conflicting-repo.d.ts +17 -0
- package/dist/testing/fixtures/conflicting-repo.d.ts.map +1 -1
- package/dist/testing/fixtures/conflicting-repo.js +31 -0
- package/dist/testing/fixtures/conflicting-repo.js.map +1 -1
- package/dist/testing/fixtures/index.d.ts.map +1 -1
- package/dist/testing/fixtures/index.js +1 -2
- package/dist/testing/fixtures/index.js.map +1 -1
- package/dist/types/focus.d.ts +59 -26
- package/dist/types/focus.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/verify/commit-verdict-pull.d.ts +28 -3
- package/dist/verify/commit-verdict-pull.d.ts.map +1 -1
- package/dist/verify/commit-verdict-pull.js +160 -23
- package/dist/verify/commit-verdict-pull.js.map +1 -1
- package/dist/verify/credit-rearm.d.ts.map +1 -1
- package/dist/verify/credit-rearm.js +72 -17
- package/dist/verify/credit-rearm.js.map +1 -1
- package/dist/verify/default-on-guards.d.ts +54 -8
- package/dist/verify/default-on-guards.d.ts.map +1 -1
- package/dist/verify/default-on-guards.js +132 -17
- package/dist/verify/default-on-guards.js.map +1 -1
- package/dist/verify/explicit-rearm.d.ts.map +1 -1
- package/dist/verify/explicit-rearm.js +1 -0
- package/dist/verify/explicit-rearm.js.map +1 -1
- package/dist/verify/explicit-row-selection.d.ts +47 -0
- package/dist/verify/explicit-row-selection.d.ts.map +1 -0
- package/dist/verify/explicit-row-selection.js +37 -0
- package/dist/verify/explicit-row-selection.js.map +1 -0
- package/dist/verify/gate-run-registry.d.ts.map +1 -1
- package/dist/verify/gate-run-registry.js +2 -0
- package/dist/verify/gate-run-registry.js.map +1 -1
- package/dist/verify/parked-shortfall-reuse.d.ts +194 -0
- package/dist/verify/parked-shortfall-reuse.d.ts.map +1 -0
- package/dist/verify/parked-shortfall-reuse.js +310 -0
- package/dist/verify/parked-shortfall-reuse.js.map +1 -0
- package/dist/verify/reselection-log.d.ts +22 -0
- package/dist/verify/reselection-log.d.ts.map +1 -0
- package/dist/verify/reselection-log.js +87 -0
- package/dist/verify/reselection-log.js.map +1 -0
- package/dist/verify/shortfall-park.d.ts +8 -1
- package/dist/verify/shortfall-park.d.ts.map +1 -1
- package/dist/verify/shortfall-park.js +17 -3
- package/dist/verify/shortfall-park.js.map +1 -1
- package/dist/verify/shortfall-repeat.d.ts.map +1 -1
- package/dist/verify/shortfall-repeat.js +7 -2
- package/dist/verify/shortfall-repeat.js.map +1 -1
- package/dist/verify/shortfall-rulings.d.ts +93 -6
- package/dist/verify/shortfall-rulings.d.ts.map +1 -1
- package/dist/verify/shortfall-rulings.js +69 -12
- package/dist/verify/shortfall-rulings.js.map +1 -1
- package/dist/verify/stall-detector-config.d.ts.map +1 -1
- package/dist/verify/stall-detector-config.js +2 -1
- package/dist/verify/stall-detector-config.js.map +1 -1
- package/dist/verify/stall-detectors.d.ts +6 -4
- package/dist/verify/stall-detectors.d.ts.map +1 -1
- package/dist/verify/stall-detectors.js +9 -6
- package/dist/verify/stall-detectors.js.map +1 -1
- package/dist/verify/stalled-team-backstop.d.ts +8 -2
- package/dist/verify/stalled-team-backstop.d.ts.map +1 -1
- package/dist/verify/stalled-team-backstop.js +15 -11
- package/dist/verify/stalled-team-backstop.js.map +1 -1
- package/dist/verify/team-stall-reapers.d.ts +28 -0
- package/dist/verify/team-stall-reapers.d.ts.map +1 -0
- package/dist/verify/team-stall-reapers.js +23 -0
- package/dist/verify/team-stall-reapers.js.map +1 -0
- package/dist/verify/verification-attribution-deps.d.ts +1 -1
- package/dist/verify/verification-attribution-deps.d.ts.map +1 -1
- package/dist/verify/verification-attribution-deps.js +20 -1
- package/dist/verify/verification-attribution-deps.js.map +1 -1
- package/dist/verify/verification-boundary-env.d.ts.map +1 -1
- package/dist/verify/verification-boundary-env.js +23 -9
- package/dist/verify/verification-boundary-env.js.map +1 -1
- package/dist/verify/verification-checkout.d.ts +1 -1
- package/dist/verify/verification-checkout.d.ts.map +1 -1
- package/dist/verify/verification-checkout.js.map +1 -1
- package/dist/verify/verification-commit-sharing.d.ts.map +1 -1
- package/dist/verify/verification-commit-sharing.js +14 -3
- package/dist/verify/verification-commit-sharing.js.map +1 -1
- package/dist/verify/verification-config.d.ts.map +1 -1
- package/dist/verify/verification-config.js +1 -20
- package/dist/verify/verification-config.js.map +1 -1
- package/dist/verify/verification-default-on.d.ts +4 -1
- package/dist/verify/verification-default-on.d.ts.map +1 -1
- package/dist/verify/verification-default-on.js +29 -2
- package/dist/verify/verification-default-on.js.map +1 -1
- package/dist/verify/verification-deps-default.d.ts.map +1 -1
- package/dist/verify/verification-deps-default.js +13 -0
- package/dist/verify/verification-deps-default.js.map +1 -1
- package/dist/verify/verification-deps.d.ts +38 -0
- package/dist/verify/verification-deps.d.ts.map +1 -1
- package/dist/verify/verification-deps.js +2 -1
- package/dist/verify/verification-deps.js.map +1 -1
- package/dist/verify/verification-engine.d.ts.map +1 -1
- package/dist/verify/verification-engine.js +44 -15
- package/dist/verify/verification-engine.js.map +1 -1
- package/dist/verify/verification-feedback.d.ts.map +1 -1
- package/dist/verify/verification-feedback.js +1 -19
- package/dist/verify/verification-feedback.js.map +1 -1
- package/dist/verify/verify-restatement.d.ts.map +1 -1
- package/dist/verify/verify-restatement.js +5 -1
- package/dist/verify/verify-restatement.js.map +1 -1
- package/dist/worktree/provision.d.ts.map +1 -1
- package/dist/worktree/provision.js +3 -1
- package/dist/worktree/provision.js.map +1 -1
- package/package.json +2 -2
package/dist/types/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
|
|
2
|
-
// Pinned by:
|
|
2
|
+
// Pinned by: 231 tests -- run: npm run gen:pinned-by -- --list packages/daemon/src/types/index.ts
|
|
3
3
|
// PINNED-BY-END
|
|
4
4
|
/**
|
|
5
5
|
* Domain-specific type re-exports.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { getFocusDeliveries } from '../queries/focuses.js';
|
|
2
|
+
import { type ParkedShortfallReuseDeps } from './parked-shortfall-reuse.js';
|
|
3
|
+
import type { VerificationDeps } from './verification-deps.js';
|
|
2
4
|
/** The seams a pull takes; each defaults to the real implementation. */
|
|
3
5
|
export interface CommitVerdictPullDeps {
|
|
4
6
|
/** The commit a focus's deliveries are judged on (its worktree HEAD), or null when unreadable. */
|
|
@@ -11,7 +13,24 @@ export interface CommitVerdictPullDeps {
|
|
|
11
13
|
releaseRunMark: (deliveryId: string) => void;
|
|
12
14
|
/** Drop the delivery's recorded pass, so the pass guard does not suppress the pulled run. */
|
|
13
15
|
forgetRecordedPass: (deliveryId: string) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the delivery is PARKED on facts a pull cannot change (see "A parked
|
|
18
|
+
* delivery at the held commit" in the module header). Absent means the pull
|
|
19
|
+
* never declines -- the pre-park behaviour, and what a caller with no park
|
|
20
|
+
* reader gets.
|
|
21
|
+
*/
|
|
22
|
+
parkAnswersHeldCommit?: (focusId: string, d: PullCandidateDelivery, sha: string) => Promise<boolean>;
|
|
23
|
+
/**
|
|
24
|
+
* Whether a commit this process ALREADY pulled (or declined) for is still
|
|
25
|
+
* awaited: the attempt that answered it has settled -- judged that sha, or
|
|
26
|
+
* rendered nothing -- yet the release pass's own read still finds no verdict
|
|
27
|
+
* ("A pull is not spent until its verdict reads back" in the module header). Absent means a pull is spent once
|
|
28
|
+
* per (delivery, sha), as before.
|
|
29
|
+
*/
|
|
30
|
+
heldVerdictStillAwaited?: (focusId: string, d: PullCandidateDelivery, sha: string) => Promise<boolean>;
|
|
14
31
|
}
|
|
32
|
+
/** The scan deps a real park answer reads through (the dispatch's own seams). */
|
|
33
|
+
type ParkAnswerDeps = ParkedShortfallReuseDeps & Pick<VerificationDeps, 'readHeldCommitVerdictState'>;
|
|
15
34
|
/** Test-only: forget every pull this process made. */
|
|
16
35
|
export declare function __resetCommitVerdictPullForTests(): void;
|
|
17
36
|
/** The slice of a delivery row a pull reads. */
|
|
@@ -20,6 +39,9 @@ export interface PullCandidateDelivery {
|
|
|
20
39
|
name?: string;
|
|
21
40
|
executionStatus: string | null;
|
|
22
41
|
gateState?: unknown;
|
|
42
|
+
injectionId?: string | null;
|
|
43
|
+
gitState?: string | null;
|
|
44
|
+
mergeCommitSha?: string | null;
|
|
23
45
|
}
|
|
24
46
|
/**
|
|
25
47
|
* Re-arm the focus's held deliveries for the commit their route awaits (see the
|
|
@@ -28,7 +50,7 @@ export interface PullCandidateDelivery {
|
|
|
28
50
|
* selects the delivery, and the ordinary dispatch runs the gate under the same
|
|
29
51
|
* semaphore and cap and records the verdict under the same per-commit record.
|
|
30
52
|
*/
|
|
31
|
-
export declare function pullHeldCommitVerdicts(focusId: string, deliveries: readonly PullCandidateDelivery[], deps?: CommitVerdictPullDeps): string[]
|
|
53
|
+
export declare function pullHeldCommitVerdicts(focusId: string, deliveries: readonly PullCandidateDelivery[], deps?: CommitVerdictPullDeps): Promise<string[]>;
|
|
32
54
|
/**
|
|
33
55
|
* Wrap a deps object's focus-deliveries read so every read also pulls the focus's
|
|
34
56
|
* held commit verdicts. Never throws on the pull: a failure leaves the scan's
|
|
@@ -41,8 +63,11 @@ export declare function pullHeldCommitVerdicts(focusId: string, deliveries: read
|
|
|
41
63
|
* only when the hold names HEAD -- is only as sound as its agreeing with the
|
|
42
64
|
* selection that follows it.
|
|
43
65
|
*/
|
|
44
|
-
export declare function withCommitVerdictPull<D extends {
|
|
66
|
+
export declare function withCommitVerdictPull<D extends ParkAnswerDeps & {
|
|
45
67
|
getFocusDeliveries: typeof getFocusDeliveries;
|
|
46
68
|
resolveFocusHeadSha?: (focusId: string) => string | null;
|
|
47
|
-
}>(deps: D,
|
|
69
|
+
}>(deps: D, explicitPullDeps?: CommitVerdictPullDeps,
|
|
70
|
+
/** The product the scan runs over; the held verdict is keyed by it. Absent: the pull never declines. */
|
|
71
|
+
productId?: string): D;
|
|
72
|
+
export {};
|
|
48
73
|
//# sourceMappingURL=commit-verdict-pull.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commit-verdict-pull.d.ts","sourceRoot":"","sources":["../../src/verify/commit-verdict-pull.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commit-verdict-pull.d.ts","sourceRoot":"","sources":["../../src/verify/commit-verdict-pull.ts"],"names":[],"mappings":"AAwHA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAKhE,OAAO,EAA6B,KAAK,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAM/D,wEAAwE;AACxE,MAAM,WA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G,IAAI,CAAC;CAChC;AAED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,SAAS,qBAAqB,EAAE,EAC5C,IAAI,GAAE,qBAAuC,GAC5C,OAAO,CAAC,MAAM,EAAE,CAAC,CA6CnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,cAAc,GAAG;IAC/D,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAC1D,EACC,IAAI,EAAE,CAAC,EACP,gBAAgB,CAAC,EAAE,qBAAqB;AACxC,wGAAwG;AACxG,SAAS,CAAC,EAAE,MAAM,GACjB,CAAC,CAkBH"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
|
|
2
2
|
// Pinned by: packages/daemon/src/integration/held-route-pull-dispatch.test.ts,
|
|
3
|
-
// packages/daemon/src/verify/commit-verdict-pull.test.ts
|
|
3
|
+
// packages/daemon/src/verify/commit-verdict-pull.test.ts,
|
|
4
|
+
// packages/daemon/src/verify/reselection-log.test.ts,
|
|
5
|
+
// packages/daemon/src/verify/verification-default-on.test.ts
|
|
4
6
|
// PINNED-BY-END
|
|
5
7
|
/**
|
|
6
8
|
* A held route PULLS the gate run for the commit it awaits.
|
|
@@ -39,22 +41,72 @@
|
|
|
39
41
|
* asks again next poll. Pulling a run for an unknown commit would judge
|
|
40
42
|
* whatever HEAD happens to be.
|
|
41
43
|
* - **No second run.** Not while a run that may judge the commit is selected or
|
|
42
|
-
* in flight (verify/gate-run-registry.ts), and
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
44
|
+
* in flight (verify/gate-run-registry.ts), and once per (delivery, sha) in
|
|
45
|
+
* this process until the verdict reads back (next rule). A dispatch that
|
|
46
|
+
* renders nothing records no pass, and ordinarily releases its own run mark,
|
|
47
|
+
* so the scan selects the delivery again on its own -- the pull mark
|
|
48
|
+
* suppresses nothing that would otherwise run. The exception is a
|
|
49
|
+
* checkout- or model-unavailable attempt on a STANDING park: it keeps a run
|
|
50
|
+
* mark naming no commit (verify/default-on-guards.ts noteDefaultOnResult
|
|
51
|
+
* declines that un-mark), so nothing else re-selects it -- and the next rule
|
|
52
|
+
* is what recognises that settled attempt and pulls again.
|
|
53
|
+
* - **A pull is not spent until its verdict reads back.** The per-commit record
|
|
54
|
+
* write is BEST-EFFORT (verify/commit-verdict-record.ts writeCommitVerdict
|
|
55
|
+
* returns false and the recorder discards it), so the run a pull caused can
|
|
56
|
+
* render on the held sha and still leave the release reading 'pending'. A
|
|
57
|
+
* commit already pulled for is pulled AGAIN once the attempt it caused has
|
|
58
|
+
* SETTLED -- a run mark exists again (a dispatch was attempted) and the
|
|
59
|
+
* gate-run registry holds no run selected or in flight -- and the release
|
|
60
|
+
* pass's own read (below) still returns a readable 'pending'. Two settled
|
|
61
|
+
* outcomes qualify, and the re-pull's log line names which one it saw: a
|
|
62
|
+
* run that JUDGED the held sha (its mark names it) whose write did not land,
|
|
63
|
+
* and an attempt that RENDERED NOTHING (its mark names no commit) -- a
|
|
64
|
+
* checkout-less retry on a standing park, whose preserved mark is the only
|
|
65
|
+
* trace it ran; requiring the mark to name the sha would strand the route
|
|
66
|
+
* there. 'passed' is answered;
|
|
67
|
+
* 'failed' is the gate's answer; an unreadable read waits for the next scan
|
|
68
|
+
* rather than paying a run on an unknown. Each re-pull costs one run and
|
|
69
|
+
* only after the previous one ended, so a store that stays down costs one
|
|
70
|
+
* run per scan, and a store that recovers is written by the next one.
|
|
46
71
|
* - **The failure guard stays authoritative.** Only the run mark and the
|
|
47
72
|
* recorded PASS are dropped. A recorded failure at the held commit means the
|
|
48
73
|
* gate already answered; verification feedback routes the delivery to
|
|
49
74
|
* verify_failed, and re-running the same commit would answer the same way.
|
|
50
75
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
76
|
+
* - **A parked delivery at the held commit is not pulled -- when the verdict
|
|
77
|
+
* is READABLE.** The pull DECLINES, and says so, only when all three hold:
|
|
78
|
+
* this process already judged the delivery ON the held sha (its run mark
|
|
79
|
+
* names it); the shortfall park that judgement left stands on an unchanged
|
|
80
|
+
* commit set and unchanged rulings (verify/parked-shortfall-reuse.ts
|
|
81
|
+
* parkHoldsOnUnchangedFacts); and the release pass's OWN verdict read
|
|
82
|
+
* (readHeldCommitVerdictState -- completion/review-exit-verdict-gate.ts
|
|
83
|
+
* readGateVerdictState, the read completion/commit-verdict-release.ts
|
|
84
|
+
* releases on) returns 'passed' for that sha. Then a re-selection is neither
|
|
85
|
+
* a new ruling nor a new commit and is not needed: the release replays from
|
|
86
|
+
* the record with no run.
|
|
87
|
+
*
|
|
88
|
+
* The third condition is not implied by the first two. The per-commit
|
|
89
|
+
* record write is BEST-EFFORT (verify/commit-verdict-record.ts
|
|
90
|
+
* writeCommitVerdict returns false and the recorder discards it), so a
|
|
91
|
+
* passing run can park a delivery while leaving no verdict behind. Declining
|
|
92
|
+
* there would leave the release reading 'pending' forever -- a wedge. So the
|
|
93
|
+
* pull asks the reader the release asks, and anything but 'passed' pulls:
|
|
94
|
+
* the run it causes writes the record again. A mark on another commit, no
|
|
95
|
+
* mark (a restart), no product id, no reader, or any unknown fact pulls as
|
|
96
|
+
* before -- this may only remove a pull it can prove is pointless.
|
|
97
|
+
*
|
|
98
|
+
* THE VERDICT READ, and what it is not. Two rules above -- the park decline and
|
|
99
|
+
* the re-pull -- ask the release pass's OWN verdict reader
|
|
100
|
+
* (readHeldCommitVerdictState: completion/review-exit-verdict-gate.ts
|
|
101
|
+
* readGateVerdictState over the delivery's resolved CommitVerdictGate,
|
|
102
|
+
* verify/commit-gate-configured.ts), and they ask it only for a delivery this
|
|
103
|
+
* process already dispatched for the held sha. They ask whether the route's wait is
|
|
104
|
+
* OVER, never whether a run may be skipped: a first pull on a commit is not
|
|
105
|
+
* declined because a verdict exists -- only where the park ALSO stands on
|
|
106
|
+
* unchanged facts, so a re-selection could change nothing. Reusing a recorded verdict instead
|
|
107
|
+
* of running the gate has one home -- verify/verification-commit-sharing.ts --
|
|
108
|
+
* so a pull whose commit is already judged costs one dispatch that reuses and
|
|
109
|
+
* routes, not a suite. Same shape as credit-rearm.ts.
|
|
58
110
|
*
|
|
59
111
|
* Wrapper shape follows the two existing re-arm seams (verify/credit-rearm.ts
|
|
60
112
|
* withCreditRearm, verify/shortfall-rulings.ts withShortfallRulingRearm): wrap the
|
|
@@ -67,16 +119,80 @@ import { DELIVERY_STATUS } from '@telora/daemon-core';
|
|
|
67
119
|
import { readCommitVerdictHold } from '../delivery/commit-verdict-hold.js';
|
|
68
120
|
import { hasPendingGateRun, isGateRunSelected } from './gate-run-registry.js';
|
|
69
121
|
import { defaultResolveFocusHeadSha } from './verification-default-on.js';
|
|
70
|
-
import { forgetRecordedPass, releaseDefaultOnMark } from './default-on-guards.js';
|
|
122
|
+
import { forgetRecordedPass, hasDefaultOnRunMark, judgedShaOfRunMark, releaseDefaultOnMark } from './default-on-guards.js';
|
|
123
|
+
import { parkHoldsOnUnchangedFacts } from './parked-shortfall-reuse.js';
|
|
124
|
+
import { logReselection } from './reselection-log.js';
|
|
71
125
|
import { createLogger } from '../shell/log.js';
|
|
72
126
|
const log = createLogger({ module: 'verification' });
|
|
73
127
|
const defaultPullDeps = {
|
|
74
128
|
resolveFocusHeadSha: defaultResolveFocusHeadSha,
|
|
75
129
|
hasPendingGateRun,
|
|
76
130
|
isGateRunSelected,
|
|
77
|
-
|
|
131
|
+
// Names itself, so the guard's fallback line does not also speak: the pull's own
|
|
132
|
+
// line below is the one that says why (verify/reselection-log.ts).
|
|
133
|
+
releaseRunMark: (deliveryId) => releaseDefaultOnMark(deliveryId, 'commit-verdict-pull'),
|
|
78
134
|
forgetRecordedPass,
|
|
79
135
|
};
|
|
136
|
+
/**
|
|
137
|
+
* The two answers that read the held verdict through the release pass's own
|
|
138
|
+
* reader, when the caller can supply it and the product to key it by.
|
|
139
|
+
*
|
|
140
|
+
* parkAnswersHeldCommit is TRUE only where this process already judged the
|
|
141
|
+
* delivery ON the held commit (its run mark names it), the park the judgement
|
|
142
|
+
* left stands on unchanged facts, and the held verdict reads 'passed'. Every
|
|
143
|
+
* other case -- no mark (a restart), a mark on another commit, no injection, a
|
|
144
|
+
* verdict that did not persist, any unknown -- answers false, and the pull fires.
|
|
145
|
+
*
|
|
146
|
+
* heldVerdictStillAwaited is TRUE only where the attempt the pull caused has
|
|
147
|
+
* SETTLED (a run mark exists again, and no run is selected or in flight -- the
|
|
148
|
+
* caller asks the gate-run registry first) and the held verdict reads a
|
|
149
|
+
* readable 'pending': the write that run owed did not land, or the attempt
|
|
150
|
+
* rendered nothing (no checkout). 'passed' is
|
|
151
|
+
* answered, 'failed' is the gate's answer (re-running would repeat it), and an
|
|
152
|
+
* unreadable read waits for the next scan rather than paying a run on an unknown.
|
|
153
|
+
*/
|
|
154
|
+
function heldAnswersFrom(deps, productId) {
|
|
155
|
+
const readHeld = deps.readHeldCommitVerdictState;
|
|
156
|
+
if (!readHeld || !productId)
|
|
157
|
+
return {};
|
|
158
|
+
const heldState = async (focusId, d, sha) => {
|
|
159
|
+
try {
|
|
160
|
+
return await readHeld({
|
|
161
|
+
productId, focusId, focusReadOnly: false, deliveryId: d.id, injectionId: d.injectionId ?? null, gateState: d.gateState,
|
|
162
|
+
}, sha);
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
return null; // unreadable: an unknown, never a decline and never a paid run
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
return {
|
|
169
|
+
// A mark means a dispatch was attempted since the pull dropped it; the caller
|
|
170
|
+
// has already refused a run that is selected or in flight (the gate-run
|
|
171
|
+
// registry), so the attempt SETTLED -- whether it judged the sha, or named no
|
|
172
|
+
// commit at all (a checkout-less retry the park declined to un-mark).
|
|
173
|
+
heldVerdictStillAwaited: async (focusId, d, sha) => hasDefaultOnRunMark(d.id) && await heldState(focusId, d, sha) === 'pending',
|
|
174
|
+
...(deps.readDeliveryGateRecord ? {
|
|
175
|
+
parkAnswersHeldCommit: async (focusId, d, sha) => {
|
|
176
|
+
if (judgedShaOfRunMark(d.id) !== sha || !d.injectionId)
|
|
177
|
+
return false;
|
|
178
|
+
const parked = await parkHoldsOnUnchangedFacts({
|
|
179
|
+
deliveryId: d.id,
|
|
180
|
+
deliveryName: d.name ?? d.id,
|
|
181
|
+
productId: null,
|
|
182
|
+
focusId,
|
|
183
|
+
injectionNodeId: d.injectionId,
|
|
184
|
+
verificationMethod: 'deterministic',
|
|
185
|
+
verificationConfig: null,
|
|
186
|
+
verificationOutcome: null,
|
|
187
|
+
verificationLastRunAt: null,
|
|
188
|
+
gitState: d.gitState ?? null,
|
|
189
|
+
mergeCommitSha: d.mergeCommitSha ?? null,
|
|
190
|
+
}, sha, deps);
|
|
191
|
+
return parked && await heldState(focusId, d, sha) === 'passed';
|
|
192
|
+
},
|
|
193
|
+
} : {}),
|
|
194
|
+
};
|
|
195
|
+
}
|
|
80
196
|
/** The commit each delivery was last pulled for in this process. */
|
|
81
197
|
const pulledAt = new Map();
|
|
82
198
|
/** Test-only: forget every pull this process made. */
|
|
@@ -90,7 +206,7 @@ export function __resetCommitVerdictPullForTests() {
|
|
|
90
206
|
* selects the delivery, and the ordinary dispatch runs the gate under the same
|
|
91
207
|
* semaphore and cap and records the verdict under the same per-commit record.
|
|
92
208
|
*/
|
|
93
|
-
export function pullHeldCommitVerdicts(focusId, deliveries, deps = defaultPullDeps) {
|
|
209
|
+
export async function pullHeldCommitVerdicts(focusId, deliveries, deps = defaultPullDeps) {
|
|
94
210
|
const pulled = [];
|
|
95
211
|
let head;
|
|
96
212
|
const readHead = () => (head ??= { sha: deps.resolveFocusHeadSha(focusId) }).sha;
|
|
@@ -101,20 +217,34 @@ export function pullHeldCommitVerdicts(focusId, deliveries, deps = defaultPullDe
|
|
|
101
217
|
// No hold, or a hold whose judged commit was unreadable: nothing to aim a run at.
|
|
102
218
|
if (hold === null || hold.sha === null)
|
|
103
219
|
continue;
|
|
104
|
-
if (pulledAt.get(d.id) === hold.sha)
|
|
105
|
-
continue;
|
|
106
220
|
// A run that may judge the commit is already coming; a second would answer the same question.
|
|
107
221
|
if (deps.isGateRunSelected(d.id) || deps.hasPendingGateRun(focusId, hold.sha))
|
|
108
222
|
continue;
|
|
109
223
|
// A run judges the worktree HEAD, so a hold naming another commit cannot be served by one.
|
|
110
224
|
if (readHead() !== hold.sha)
|
|
111
225
|
continue;
|
|
226
|
+
const again = pulledAt.get(d.id) === hold.sha;
|
|
227
|
+
// Asked for this sha already: spent only once the verdict reads back, never before.
|
|
228
|
+
if (again && !(deps.heldVerdictStillAwaited && await deps.heldVerdictStillAwaited(focusId, d, hold.sha)))
|
|
229
|
+
continue;
|
|
230
|
+
if (!again && deps.parkAnswersHeldCommit && await deps.parkAnswersHeldCommit(focusId, d, hold.sha)) {
|
|
231
|
+
pulledAt.set(d.id, hold.sha); // answered for this sha; asked once, like a pull
|
|
232
|
+
logReselection('commit-verdict-pull', d.id, `DECLINED for ${hold.sha.slice(0, 8)}: its dispatch already judged that commit, its shortfall park stands on ` +
|
|
233
|
+
'an unchanged commit set and unchanged rulings, and the passing verdict the held route awaits reads back; ' +
|
|
234
|
+
'only a new ruling or a new commit re-selects it', `park-declined@${hold.sha}`);
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
// Read before the release below drops it: which settled outcome this re-pull answers.
|
|
238
|
+
const priorJudged = again ? judgedShaOfRunMark(d.id) : null;
|
|
112
239
|
pulledAt.set(d.id, hold.sha);
|
|
113
240
|
deps.releaseRunMark(d.id);
|
|
114
241
|
deps.forgetRecordedPass(d.id);
|
|
115
242
|
pulled.push(d.id);
|
|
116
|
-
|
|
117
|
-
`
|
|
243
|
+
logReselection('commit-verdict-pull', d.id, `re-armed for ${hold.sha.slice(0, 8)} -- delivery "${d.name ?? d.id}"'s ${hold.route ?? 'done'} route has been ` +
|
|
244
|
+
`held since ${hold.heldAt} for a verdict on that commit` +
|
|
245
|
+
(!again ? '' : priorJudged === hold.sha
|
|
246
|
+
? '; the run that answered the last pull judged it, but its verdict does not read back'
|
|
247
|
+
: '; the attempt the last pull caused rendered nothing (no checkout or no verdict), and no verdict reads back'));
|
|
118
248
|
}
|
|
119
249
|
return pulled;
|
|
120
250
|
}
|
|
@@ -130,13 +260,20 @@ export function pullHeldCommitVerdicts(focusId, deliveries, deps = defaultPullDe
|
|
|
130
260
|
* only when the hold names HEAD -- is only as sound as its agreeing with the
|
|
131
261
|
* selection that follows it.
|
|
132
262
|
*/
|
|
133
|
-
export function withCommitVerdictPull(deps,
|
|
134
|
-
|
|
135
|
-
|
|
263
|
+
export function withCommitVerdictPull(deps, explicitPullDeps,
|
|
264
|
+
/** The product the scan runs over; the held verdict is keyed by it. Absent: the pull never declines. */
|
|
265
|
+
productId) {
|
|
266
|
+
const pullDeps = explicitPullDeps ?? {
|
|
267
|
+
...defaultPullDeps,
|
|
268
|
+
...(deps.resolveFocusHeadSha ? { resolveFocusHeadSha: deps.resolveFocusHeadSha } : {}),
|
|
269
|
+
// The park is asked through the SAME deps the dispatch reads it with, so the
|
|
270
|
+
// pull and the dispatch cannot answer differently about one park.
|
|
271
|
+
...heldAnswersFrom(deps, productId),
|
|
272
|
+
};
|
|
136
273
|
const getFocusDeliveriesPulling = async (focusId) => {
|
|
137
274
|
const deliveries = await deps.getFocusDeliveries(focusId);
|
|
138
275
|
try {
|
|
139
|
-
pullHeldCommitVerdicts(focusId, deliveries, pullDeps);
|
|
276
|
+
await pullHeldCommitVerdicts(focusId, deliveries, pullDeps);
|
|
140
277
|
}
|
|
141
278
|
catch (err) {
|
|
142
279
|
log.debug(`[verification] commit-verdict pull check failed for focus ${focusId.slice(0, 8)}:`, err.message);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commit-verdict-pull.js","sourceRoot":"","sources":["../../src/verify/commit-verdict-pull.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,+EAA+E;AAC/E,
|
|
1
|
+
{"version":3,"file":"commit-verdict-pull.js","sourceRoot":"","sources":["../../src/verify/commit-verdict-pull.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,+EAA+E;AAC/E,4DAA4D;AAC5D,wDAAwD;AACxD,+DAA+D;AAC/D,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8GG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC3H,OAAO,EAAE,yBAAyB,EAAiC,MAAM,6BAA6B,CAAC;AAEvG,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;AAkCrD,MAAM,eAAe,GAA0B;IAC7C,mBAAmB,EAAE,0BAA0B;IAC/C,iBAAiB;IACjB,iBAAiB;IACjB,iFAAiF;IACjF,mEAAmE;IACnE,cAAc,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,oBAAoB,CAAC,UAA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,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC1D,IAAI,CAAC;YACH,MAAM,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC9D,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,GAAG,CAAC,KAAK,CAAC,6DAA6D,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,EAAG,GAAa,CAAC,OAAO,CAAC,CAAC;QACzH,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;IACF,OAAO,EAAE,GAAG,IAAI,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,CAAC;AACpE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit-rearm.d.ts","sourceRoot":"","sources":["../../src/verify/credit-rearm.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"credit-rearm.d.ts","sourceRoot":"","sources":["../../src/verify/credit-rearm.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AA+B/D,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACvF,OAAO,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AASD,4DAA4D;AAC5D,wBAAgB,0BAA0B,IAAI,IAAI,CAEjD;AAED,6FAA6F;AAC7F,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EAAE,EACrE,IAAI,GAAE,eAAkC,GACvC,OAAO,CAAC,IAAI,CAAC,CAgCf;AAED,6GAA6G;AAC7G,wBAAgB,eAAe,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EACtF,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,EACvC,IAAI,GAAE,eAAkC,GACvC,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,CAUnC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
|
|
2
|
-
// Pinned by: packages/daemon/src/verify/credit-rearm.test.ts
|
|
2
|
+
// Pinned by: packages/daemon/src/verify/credit-rearm.test.ts,
|
|
3
|
+
// packages/daemon/src/verify/reselection-log.test.ts,
|
|
4
|
+
// packages/daemon/src/verify/verification-default-on.test.ts
|
|
3
5
|
// PINNED-BY-END
|
|
4
6
|
/**
|
|
5
7
|
* A new commit credit re-arms the focus's deliveries sitting in verify.
|
|
@@ -11,23 +13,62 @@
|
|
|
11
13
|
* diagnosis, which stops re-queuing -- would never be re-judged with the credit.
|
|
12
14
|
*
|
|
13
15
|
* This watches each focus's credit set as the verification scan reads the
|
|
14
|
-
* focus's deliveries.
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* focus's deliveries. The run mark is released for a delivery whose OWN credited
|
|
17
|
+
* commits changed, so the next scan judges it again at the same commit (the
|
|
18
|
+
* per-commit gate verdict is reused, so no suite re-runs; only the evidence and
|
|
19
|
+
* reconciliation are re-read). The first sighting of a focus only records the
|
|
20
|
+
* set: after a restart nothing is marked. An unreadable credit read changes
|
|
21
|
+
* nothing.
|
|
22
|
+
*
|
|
23
|
+
* PER DELIVERY, NOT PER FOCUS -- and that distinction is the whole correctness
|
|
24
|
+
* of this module. It used to compare one fingerprint of the focus's WHOLE credit
|
|
25
|
+
* set and then release EVERY in-verify delivery when it moved, so attributing a
|
|
26
|
+
* commit to delivery A re-armed parked sibling B, whose own evidence had not
|
|
27
|
+
* changed at all. On 2026-09-24 that was one of the paths re-selecting a parked
|
|
28
|
+
* delivery at an unchanged HEAD: the declared rule is that only a new ruling or
|
|
29
|
+
* a new commit re-selects it, and a SIBLING's new commit is neither. A credit
|
|
30
|
+
* set is per-delivery data; reading it as a focus-wide scalar threw away exactly
|
|
31
|
+
* the attribution that makes it answerable.
|
|
32
|
+
*
|
|
33
|
+
* So the question asked here is "did THIS delivery's evidence change", which
|
|
34
|
+
* needs no park read and no extra IO: the credit map already carries the
|
|
35
|
+
* attribution, and a delivery whose own credits are unchanged is left alone.
|
|
20
36
|
*/
|
|
21
37
|
import { DELIVERY_STATUS } from '@telora/daemon-core';
|
|
22
38
|
import { getCommitAttributionsForFocus } from '../queries/commit-attributions.js';
|
|
23
39
|
import { releaseDefaultOnMark } from './default-on-guards.js';
|
|
40
|
+
import { logReselection } from './reselection-log.js';
|
|
24
41
|
import { createLogger } from '../shell/log.js';
|
|
25
42
|
const log = createLogger({ module: 'verification' });
|
|
26
|
-
/** Focus id ->
|
|
43
|
+
/** Focus id -> each of its deliveries' own credit fingerprint, as last seen. */
|
|
27
44
|
const seenCredits = new Map();
|
|
45
|
+
/**
|
|
46
|
+
* Each delivery's OWN credited commits, fingerprinted. The credit map is keyed by
|
|
47
|
+
* sha and VALUED by delivery, so the attribution is already there to be read --
|
|
48
|
+
* this only groups it the way the question is asked. Pure.
|
|
49
|
+
*
|
|
50
|
+
* A delivery credited nothing has no entry, which compares equal to '' below, so
|
|
51
|
+
* "no credits" and "no entry" are one state rather than a spurious change.
|
|
52
|
+
*/
|
|
53
|
+
function creditsByDelivery(credits) {
|
|
54
|
+
const shas = new Map();
|
|
55
|
+
for (const [sha, deliveryId] of credits) {
|
|
56
|
+
const list = shas.get(deliveryId);
|
|
57
|
+
if (list)
|
|
58
|
+
list.push(sha);
|
|
59
|
+
else
|
|
60
|
+
shas.set(deliveryId, [sha]);
|
|
61
|
+
}
|
|
62
|
+
const out = new Map();
|
|
63
|
+
for (const [deliveryId, list] of shas)
|
|
64
|
+
out.set(deliveryId, list.sort().join(','));
|
|
65
|
+
return out;
|
|
66
|
+
}
|
|
28
67
|
const defaultRearmDeps = {
|
|
29
68
|
readCredits: getCommitAttributionsForFocus,
|
|
30
|
-
|
|
69
|
+
// Names itself, so the guard's own fallback line does not also speak: the
|
|
70
|
+
// per-delivery line below is the one that says why (verify/reselection-log.ts).
|
|
71
|
+
release: (deliveryId) => releaseDefaultOnMark(deliveryId, 'credit-rearm'),
|
|
31
72
|
};
|
|
32
73
|
/** Test-only: forget every focus's last-seen credit set. */
|
|
33
74
|
export function __resetCreditRearmForTests() {
|
|
@@ -41,17 +82,31 @@ export async function rearmOnCreditChange(focusId, deliveries, deps = defaultRea
|
|
|
41
82
|
const lookup = await deps.readCredits(focusId);
|
|
42
83
|
if (lookup.state === 'undetermined')
|
|
43
84
|
return;
|
|
44
|
-
const
|
|
45
|
-
? [...lookup.value].map(([sha, deliveryId]) => `${sha}:${deliveryId}`).sort().join(',')
|
|
46
|
-
: '';
|
|
85
|
+
const current = creditsByDelivery(lookup.state === 'found' ? lookup.value : new Map());
|
|
47
86
|
const previous = seenCredits.get(focusId);
|
|
48
|
-
seenCredits.set(focusId,
|
|
49
|
-
if (previous === undefined
|
|
50
|
-
return;
|
|
51
|
-
|
|
87
|
+
seenCredits.set(focusId, current);
|
|
88
|
+
if (previous === undefined)
|
|
89
|
+
return; // first sighting records only
|
|
90
|
+
const rearmed = [];
|
|
91
|
+
for (const d of inVerify) {
|
|
92
|
+
const before = previous.get(d.id) ?? '';
|
|
93
|
+
const now = current.get(d.id) ?? '';
|
|
94
|
+
// A SIBLING's credit is not this delivery's evidence, so it does not re-arm it.
|
|
95
|
+
if (before === now)
|
|
96
|
+
continue;
|
|
52
97
|
deps.release(d.id);
|
|
98
|
+
rearmed.push(d.id);
|
|
99
|
+
// PER DELIVERY, not only per focus: the focus line below cannot be matched to
|
|
100
|
+
// the delivery a later dispatch names, which is exactly what the 2026-09-24
|
|
101
|
+
// re-dispatch investigation needed (verify/reselection-log.ts).
|
|
102
|
+
logReselection('credit-rearm', d.id, `its OWN commit credits on focus ${focusId} changed (${before === '' ? 'none' : before} -> `
|
|
103
|
+
+ `${now === '' ? 'none' : now}), so its evidence is re-read at the same commit`);
|
|
104
|
+
}
|
|
105
|
+
if (rearmed.length === 0)
|
|
106
|
+
return;
|
|
53
107
|
log.info(`[verification] commit credits changed on focus ${focusId.slice(0, 8)}: re-judging ` +
|
|
54
|
-
`${inVerify.length} delivery(ies) in verify at the current commit`
|
|
108
|
+
`${rearmed.length} of ${inVerify.length} delivery(ies) in verify at the current commit ` +
|
|
109
|
+
'(only those whose own credits moved)');
|
|
55
110
|
}
|
|
56
111
|
/** Wrap a focus-deliveries read so every read also checks the focus's credits. Never throws on the check. */
|
|
57
112
|
export function withCreditRearm(read, deps = defaultRearmDeps) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit-rearm.js","sourceRoot":"","sources":["../../src/verify/credit-rearm.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,
|
|
1
|
+
{"version":3,"file":"credit-rearm.js","sourceRoot":"","sources":["../../src/verify/credit-rearm.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,8DAA8D;AAC9D,wDAAwD;AACxD,+DAA+D;AAC/D,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CA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C1F,GAAG,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,kDAAkD,CACjF,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IACjC,GAAG,CAAC,IAAI,CACN,kDAAkD,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,eAAe;QACpF,GAAG,OAAO,CAAC,MAAM,OAAO,QAAQ,CAAC,MAAM,iDAAiD;QACxF,sCAAsC,CACvC,CAAC;AACJ,CAAC;AAED,6GAA6G;AAC7G,MAAM,UAAU,eAAe,CAC7B,IAAuC,EACvC,OAAwB,gBAAgB;IAExC,OAAO,KAAK,EAAE,OAAO,EAAE,EAAE;QACvB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC;YACH,MAAM,mBAAmB,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;QACvD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,GAAG,CAAC,KAAK,CAAC,uDAAuD,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,EAAG,GAAa,CAAC,OAAO,CAAC,CAAC;QACnH,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,13 +1,33 @@
|
|
|
1
|
+
import { type ReselectionPath } from './reselection-log.js';
|
|
1
2
|
/** Test-only: reset the default-on re-run guards (status- and HEAD-keyed). */
|
|
2
3
|
export declare function __resetDefaultOnGuardForTests(): void;
|
|
3
4
|
/** Test-only: snapshot of the default-on re-run guard (delivery id -> the commit its dispatch judged). */
|
|
4
5
|
export declare function __getDefaultOnGuardForTests(): ReadonlyMap<string, string | null>;
|
|
5
6
|
/** Mark a delivery as already run this verify-entry (dispatch-time bookkeeping; the judged commit is noted after). */
|
|
6
7
|
export declare function markDefaultOnRan(deliveryId: string): void;
|
|
8
|
+
/**
|
|
9
|
+
* The commit the delivery's run mark says its dispatch judged; null when there is
|
|
10
|
+
* no mark, the dispatch is in flight, or it named no commit -- all "unknown".
|
|
11
|
+
*/
|
|
12
|
+
export declare function judgedShaOfRunMark(deliveryId: string): string | null;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the delivery carries a run mark at all -- a dispatch was attempted
|
|
15
|
+
* since the mark was last dropped -- whatever commit (if any) it names.
|
|
16
|
+
*/
|
|
17
|
+
export declare function hasDefaultOnRunMark(deliveryId: string): boolean;
|
|
7
18
|
/** Test-only alias for markDefaultOnRan. */
|
|
8
19
|
export declare function __markDefaultOnRanForTests(deliveryId: string): void;
|
|
9
|
-
/**
|
|
10
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Drop a delivery's run mark so the next tick selects it again (its dispatch
|
|
22
|
+
* rendered nothing it may keep).
|
|
23
|
+
*
|
|
24
|
+
* `releasedBy` names the re-selection path for the log. A caller that passes one
|
|
25
|
+
* logs its OWN line at its own call site (where the reason is known), so this
|
|
26
|
+
* stays silent for it; a caller that names none gets the fallback
|
|
27
|
+
* 'run-mark-release' line. Either way nothing is logged when there was no mark to
|
|
28
|
+
* drop: a release that suppressed nothing re-selected nothing.
|
|
29
|
+
*/
|
|
30
|
+
export declare function releaseDefaultOnMark(deliveryId: string, releasedBy?: ReselectionPath): void;
|
|
11
31
|
/**
|
|
12
32
|
* Drop a delivery's recorded pass, so the pass guard no longer suppresses it.
|
|
13
33
|
* The demand pull (verify/commit-verdict-pull.ts) calls this for a delivery whose
|
|
@@ -24,6 +44,13 @@ export interface DefaultOnResultFacts {
|
|
|
24
44
|
checkoutUnavailable?: boolean;
|
|
25
45
|
/** The reconciliation could not run (model unavailable): no verdict exists to guard. */
|
|
26
46
|
modelUnavailable?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* A shortfall park stands on this delivery and EVERY fact behind it is
|
|
49
|
+
* unchanged (verify/parked-shortfall-reuse.ts parkHoldsOnUnchangedFacts).
|
|
50
|
+
* Absent/false means no park, moved facts, or an unknown -- all of which
|
|
51
|
+
* re-select. Read only on the two un-marks (checkout- and model-unavailable).
|
|
52
|
+
*/
|
|
53
|
+
parkHolds?: boolean;
|
|
27
54
|
}
|
|
28
55
|
/**
|
|
29
56
|
* Dispatch-result bookkeeping for a default-on run:
|
|
@@ -38,6 +65,17 @@ export interface DefaultOnResultFacts {
|
|
|
38
65
|
* forget any recorded pass;
|
|
39
66
|
* - a pass -> forget any recorded failure and, at a known judged sha, remember
|
|
40
67
|
* the pass so that commit is not re-verified either.
|
|
68
|
+
*
|
|
69
|
+
* A PASS DEMOTED TO 'failed' BY THE RECONCILIATION records neither: judgedFailedSha
|
|
70
|
+
* requires a non-zero gate exit and the gate exited 0, and the outcome is no longer
|
|
71
|
+
* 'passed'. That is deliberate and it is NOT a hole -- the run mark still carries
|
|
72
|
+
* the commit the run judged (the line above keeps it), so the delivery is not
|
|
73
|
+
* re-selected while a readable focus HEAD equals it, and a new commit re-arms it
|
|
74
|
+
* exactly once. Recording it as a failed sha instead would be wrong twice over: the
|
|
75
|
+
* gate did not fail, and failedAtSha is DURABLE (gate_state), so it would suppress
|
|
76
|
+
* the commit across a restart while the shortfall park -- which owns this state and
|
|
77
|
+
* is released by an operator ruling -- would have nothing to release. Pinned by
|
|
78
|
+
* verification-default-on.test.ts ("a pass demoted by a shortfall ...").
|
|
41
79
|
*/
|
|
42
80
|
export declare function noteDefaultOnResult(deliveryId: string, result: DefaultOnResultFacts): void;
|
|
43
81
|
/**
|
|
@@ -64,14 +102,22 @@ export declare function failedOnCurrentHead(delivery: {
|
|
|
64
102
|
*/
|
|
65
103
|
export declare function ranOnCurrentHead(deliveryId: string, readHead: () => string | null): boolean;
|
|
66
104
|
/**
|
|
67
|
-
* Prune the guards of every delivery no longer observed in
|
|
68
|
-
* and the recorded PASS both go: a genuine verify_failed ->
|
|
69
|
-
* re-entry is the ONLY thing that re-arms a passed delivery, so
|
|
70
|
-
* that rule -- without it a delivery would keep a pass earned on the
|
|
71
|
-
* its fix commits, which is the one way the narrowed rule could lower
|
|
105
|
+
* Prune the guards of every delivery THIS PRODUCT'S scan no longer observed in
|
|
106
|
+
* verify. The run mark and the recorded PASS both go: a genuine verify_failed ->
|
|
107
|
+
* coding -> verify re-entry is the ONLY thing that re-arms a passed delivery, so
|
|
108
|
+
* this sweep IS that rule -- without it a delivery would keep a pass earned on the
|
|
109
|
+
* code before its fix commits, which is the one way the narrowed rule could lower
|
|
110
|
+
* the bar.
|
|
111
|
+
*
|
|
112
|
+
* `productId` is the product the observation was taken over (config.productId of
|
|
113
|
+
* the scan's product-scoped config), and it BOUNDS the conclusion: an entry
|
|
114
|
+
* claimed by another product is left alone, because this scan never looked for it
|
|
115
|
+
* (module header, incident 2026-09-24). Pass `undefined` only from a caller whose
|
|
116
|
+
* single observation IS the whole view. Every observed id is claimed for
|
|
117
|
+
* `productId` here, so the claim and the prune come from one read.
|
|
72
118
|
*
|
|
73
119
|
* failedAtSha is deliberately NOT pruned: a recorded failure is durable in
|
|
74
120
|
* gate_state and survives the round trip on purpose, unchanged.
|
|
75
121
|
*/
|
|
76
|
-
export declare function pruneGuardsOutsideVerify(observedInVerify: ReadonlySet<string
|
|
122
|
+
export declare function pruneGuardsOutsideVerify(observedInVerify: ReadonlySet<string>, productId?: string): void;
|
|
77
123
|
//# sourceMappingURL=default-on-guards.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-on-guards.d.ts","sourceRoot":"","sources":["../../src/verify/default-on-guards.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default-on-guards.d.ts","sourceRoot":"","sources":["../../src/verify/default-on-guards.ts"],"names":[],"mappings":"AAsDA,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAqJ5E,8EAA8E;AAC9E,wBAAgB,6BAA6B,IAAI,IAAI,CAMpD;AAED,0GAA0G;AAC1G,wBAAgB,2BAA2B,IAAI,WAA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