@telora/daemon 0.22.169 → 0.22.187
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 +9 -3
- package/dist/audit/audit-floor-policy.d.ts +188 -0
- package/dist/audit/audit-floor-policy.d.ts.map +1 -0
- package/dist/audit/audit-floor-policy.js +353 -0
- package/dist/audit/audit-floor-policy.js.map +1 -0
- package/dist/audit/audit-prompt.d.ts +4 -177
- package/dist/audit/audit-prompt.d.ts.map +1 -1
- package/dist/audit/audit-prompt.js +6 -329
- package/dist/audit/audit-prompt.js.map +1 -1
- package/dist/completion/commit-verdict-release.d.ts +37 -1
- package/dist/completion/commit-verdict-release.d.ts.map +1 -1
- package/dist/completion/commit-verdict-release.js +90 -15
- package/dist/completion/commit-verdict-release.js.map +1 -1
- package/dist/completion/escalations.d.ts.map +1 -1
- package/dist/completion/escalations.js +3 -1
- package/dist/completion/escalations.js.map +1 -1
- package/dist/completion/review-exit-verdict-gate.d.ts +11 -5
- package/dist/completion/review-exit-verdict-gate.d.ts.map +1 -1
- package/dist/completion/review-exit-verdict-gate.js +6 -3
- package/dist/completion/review-exit-verdict-gate.js.map +1 -1
- package/dist/delivery/commit-verdict-hold.d.ts.map +1 -1
- package/dist/delivery/commit-verdict-hold.js +2 -1
- package/dist/delivery/commit-verdict-hold.js.map +1 -1
- package/dist/directive/stranded-review-reroute.js +1 -1
- package/dist/directive/stranded-review-reroute.js.map +1 -1
- package/dist/focus/focus-executor.d.ts.map +1 -1
- package/dist/focus/focus-executor.js +2 -0
- package/dist/focus/focus-executor.js.map +1 -1
- package/dist/focus/pending-review-approved-head.d.ts +1 -1
- package/dist/focus/pending-review-approved-head.d.ts.map +1 -1
- package/dist/focus/pending-review-approved-head.js +4 -3
- package/dist/focus/pending-review-approved-head.js.map +1 -1
- package/dist/focus/session-health.d.ts.map +1 -1
- package/dist/focus/session-health.js +2 -1
- package/dist/focus/session-health.js.map +1 -1
- package/dist/focus-stage-lifecycle/planning-release.d.ts +52 -17
- package/dist/focus-stage-lifecycle/planning-release.d.ts.map +1 -1
- package/dist/focus-stage-lifecycle/planning-release.js +58 -70
- package/dist/focus-stage-lifecycle/planning-release.js.map +1 -1
- package/dist/focus-stage-lifecycle/ratify-bar-gate.d.ts +108 -0
- package/dist/focus-stage-lifecycle/ratify-bar-gate.d.ts.map +1 -0
- package/dist/focus-stage-lifecycle/ratify-bar-gate.js +174 -0
- package/dist/focus-stage-lifecycle/ratify-bar-gate.js.map +1 -0
- package/dist/git/merge-to-main.d.ts.map +1 -1
- package/dist/git/merge-to-main.js.map +1 -1
- package/dist/nexus/index.d.ts.map +1 -1
- package/dist/nexus/index.js +2 -1
- package/dist/nexus/index.js.map +1 -1
- package/dist/nexus/intake-prompt-sections.d.ts +70 -0
- package/dist/nexus/intake-prompt-sections.d.ts.map +1 -0
- package/dist/nexus/intake-prompt-sections.js +145 -0
- package/dist/nexus/intake-prompt-sections.js.map +1 -0
- package/dist/nexus/intake-spawn.d.ts +49 -13
- package/dist/nexus/intake-spawn.d.ts.map +1 -1
- package/dist/nexus/intake-spawn.js +45 -122
- package/dist/nexus/intake-spawn.js.map +1 -1
- package/dist/nexus/intake.d.ts +55 -0
- package/dist/nexus/intake.d.ts.map +1 -1
- package/dist/nexus/intake.js +62 -1
- package/dist/nexus/intake.js.map +1 -1
- package/dist/prd/arm-readiness.d.ts +93 -0
- package/dist/prd/arm-readiness.d.ts.map +1 -0
- package/dist/prd/arm-readiness.js +254 -0
- package/dist/prd/arm-readiness.js.map +1 -0
- package/dist/prd/arm-refusal.d.ts +149 -0
- package/dist/prd/arm-refusal.d.ts.map +1 -0
- package/dist/prd/arm-refusal.js +219 -0
- package/dist/prd/arm-refusal.js.map +1 -0
- package/dist/prd/controller-shared.d.ts +111 -0
- package/dist/prd/controller-shared.d.ts.map +1 -1
- package/dist/prd/controller-shared.js +3 -1
- package/dist/prd/controller-shared.js.map +1 -1
- package/dist/prd/controller.d.ts +16 -10
- package/dist/prd/controller.d.ts.map +1 -1
- package/dist/prd/controller.js +28 -35
- package/dist/prd/controller.js.map +1 -1
- package/dist/prd/frontier-arming.d.ts +151 -0
- package/dist/prd/frontier-arming.d.ts.map +1 -0
- package/dist/prd/frontier-arming.js +315 -0
- package/dist/prd/frontier-arming.js.map +1 -0
- package/dist/prd/index.d.ts +10 -1
- package/dist/prd/index.d.ts.map +1 -1
- package/dist/prd/index.js +9 -1
- package/dist/prd/index.js.map +1 -1
- package/dist/prd/scoping-prompt.d.ts +68 -0
- package/dist/prd/scoping-prompt.d.ts.map +1 -0
- package/dist/prd/scoping-prompt.js +86 -0
- package/dist/prd/scoping-prompt.js.map +1 -0
- package/dist/prompt/prompt-contradictions.d.ts +20 -1
- package/dist/prompt/prompt-contradictions.d.ts.map +1 -1
- package/dist/prompt/prompt-contradictions.js +35 -0
- package/dist/prompt/prompt-contradictions.js.map +1 -1
- package/dist/prompt/team-prompt-base.d.ts +18 -0
- package/dist/prompt/team-prompt-base.d.ts.map +1 -1
- package/dist/prompt/team-prompt-base.js +56 -11
- package/dist/prompt/team-prompt-base.js.map +1 -1
- package/dist/prompt-sections/persona-sections.d.ts +36 -13
- package/dist/prompt-sections/persona-sections.d.ts.map +1 -1
- package/dist/prompt-sections/persona-sections.js +93 -16
- package/dist/prompt-sections/persona-sections.js.map +1 -1
- package/dist/prompt-sections/scoping-sections.d.ts +19 -5
- package/dist/prompt-sections/scoping-sections.d.ts.map +1 -1
- package/dist/prompt-sections/scoping-sections.js +45 -38
- package/dist/prompt-sections/scoping-sections.js.map +1 -1
- package/dist/prompt-sections/shared.d.ts +8 -0
- package/dist/prompt-sections/shared.d.ts.map +1 -1
- package/dist/prompt-sections/shared.js.map +1 -1
- package/dist/queries/delivery-gate-state.js +1 -1
- package/dist/queries/focus-criteria-standing.d.ts +170 -7
- package/dist/queries/focus-criteria-standing.d.ts.map +1 -1
- package/dist/queries/focus-criteria-standing.js +143 -8
- package/dist/queries/focus-criteria-standing.js.map +1 -1
- package/dist/queries/focus-ratify-release.d.ts +43 -0
- package/dist/queries/focus-ratify-release.d.ts.map +1 -0
- package/dist/queries/focus-ratify-release.js +45 -0
- package/dist/queries/focus-ratify-release.js.map +1 -0
- package/dist/queries/focuses.d.ts +0 -10
- package/dist/queries/focuses.d.ts.map +1 -1
- package/dist/queries/focuses.js +2 -15
- package/dist/queries/focuses.js.map +1 -1
- package/dist/queries/prd.d.ts +31 -0
- package/dist/queries/prd.d.ts.map +1 -1
- package/dist/queries/prd.js +26 -1
- package/dist/queries/prd.js.map +1 -1
- package/dist/queries/shared.js +1 -1
- package/dist/resolvers/focus-criteria-standing.d.ts.map +1 -1
- package/dist/resolvers/focus-criteria-standing.js +324 -25
- package/dist/resolvers/focus-criteria-standing.js.map +1 -1
- package/dist/resolvers/shared/review-window-commits.d.ts.map +1 -1
- package/dist/resolvers/shared/review-window-commits.js +2 -1
- package/dist/resolvers/shared/review-window-commits.js.map +1 -1
- package/dist/security/security-auto-inject.d.ts +51 -0
- package/dist/security/security-auto-inject.d.ts.map +1 -1
- package/dist/security/security-auto-inject.js +101 -11
- package/dist/security/security-auto-inject.js.map +1 -1
- package/dist/security/security-scan-engine.d.ts +4 -4
- package/dist/security/security-scan-engine.d.ts.map +1 -1
- package/dist/security/security-scan-engine.js +6 -0
- package/dist/security/security-scan-engine.js.map +1 -1
- package/dist/session/session-lineage.d.ts.map +1 -1
- package/dist/session/session-lineage.js +2 -0
- package/dist/session/session-lineage.js.map +1 -1
- package/dist/shell/constants.d.ts +5 -0
- package/dist/shell/constants.d.ts.map +1 -1
- package/dist/shell/constants.js +5 -0
- package/dist/shell/constants.js.map +1 -1
- package/dist/shell/daemon-instance.d.ts +74 -64
- package/dist/shell/daemon-instance.d.ts.map +1 -1
- package/dist/shell/daemon-instance.js +16 -121
- package/dist/shell/daemon-instance.js.map +1 -1
- package/dist/shell/health-events.js +1 -1
- package/dist/shell/health-events.js.map +1 -1
- package/dist/shell/instance-liveness.d.ts +112 -0
- package/dist/shell/instance-liveness.d.ts.map +1 -0
- package/dist/shell/instance-liveness.js +205 -0
- package/dist/shell/instance-liveness.js.map +1 -0
- package/dist/shell/schema-version-gate.d.ts +22 -0
- package/dist/shell/schema-version-gate.d.ts.map +1 -1
- package/dist/shell/schema-version-gate.js +116 -6
- package/dist/shell/schema-version-gate.js.map +1 -1
- package/dist/shell/worker-pidfile.d.ts +21 -8
- package/dist/shell/worker-pidfile.d.ts.map +1 -1
- package/dist/shell/worker-pidfile.js +38 -9
- package/dist/shell/worker-pidfile.js.map +1 -1
- package/dist/spawn/lead-launch.d.ts.map +1 -1
- package/dist/spawn/lead-launch.js +2 -1
- package/dist/spawn/lead-launch.js.map +1 -1
- package/dist/spawn/one-shot-scoping-spawn.d.ts +51 -0
- package/dist/spawn/one-shot-scoping-spawn.d.ts.map +1 -0
- package/dist/spawn/one-shot-scoping-spawn.js +156 -0
- package/dist/spawn/one-shot-scoping-spawn.js.map +1 -0
- package/dist/spawn/process-spawn.d.ts +12 -0
- package/dist/spawn/process-spawn.d.ts.map +1 -1
- package/dist/spawn/process-spawn.js +1 -1
- package/dist/spawn/process-spawn.js.map +1 -1
- package/dist/spawn/prompt-assembly.d.ts +8 -0
- package/dist/spawn/prompt-assembly.d.ts.map +1 -1
- package/dist/spawn/prompt-assembly.js +15 -3
- package/dist/spawn/prompt-assembly.js.map +1 -1
- package/dist/spawn/worktree-session.d.ts +24 -6
- package/dist/spawn/worktree-session.d.ts.map +1 -1
- package/dist/spawn/worktree-session.js +37 -14
- package/dist/spawn/worktree-session.js.map +1 -1
- package/dist/testing/arm-coverage-model.d.ts +75 -0
- package/dist/testing/arm-coverage-model.d.ts.map +1 -0
- package/dist/testing/arm-coverage-model.js +114 -0
- package/dist/testing/arm-coverage-model.js.map +1 -0
- package/dist/testing/fixtures/index.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/verify/commit-gate-configured.d.ts.map +1 -1
- package/dist/verify/commit-gate-configured.js +1 -1
- package/dist/verify/commit-gate-configured.js.map +1 -1
- package/dist/verify/commit-verdict-pull.d.ts +48 -0
- package/dist/verify/commit-verdict-pull.d.ts.map +1 -0
- package/dist/verify/commit-verdict-pull.js +148 -0
- package/dist/verify/commit-verdict-pull.js.map +1 -0
- package/dist/verify/commit-verdict-record.js +1 -1
- package/dist/verify/credit-rearm.js +1 -1
- package/dist/verify/credit-rearm.js.map +1 -1
- package/dist/verify/default-on-guards.d.ts +74 -0
- package/dist/verify/default-on-guards.d.ts.map +1 -0
- package/dist/verify/default-on-guards.js +305 -0
- package/dist/verify/default-on-guards.js.map +1 -0
- 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/gate-run-registry.d.ts.map +1 -1
- package/dist/verify/gate-run-registry.js +1 -0
- package/dist/verify/gate-run-registry.js.map +1 -1
- package/dist/verify/judged-ancestor.d.ts +41 -0
- package/dist/verify/judged-ancestor.d.ts.map +1 -0
- package/dist/verify/judged-ancestor.js +101 -0
- package/dist/verify/judged-ancestor.js.map +1 -0
- package/dist/verify/no-own-delta-verdict.d.ts +7 -2
- package/dist/verify/no-own-delta-verdict.d.ts.map +1 -1
- package/dist/verify/no-own-delta-verdict.js +14 -17
- package/dist/verify/no-own-delta-verdict.js.map +1 -1
- package/dist/verify/rework-attribution.d.ts +71 -0
- package/dist/verify/rework-attribution.d.ts.map +1 -0
- package/dist/verify/rework-attribution.js +263 -0
- package/dist/verify/rework-attribution.js.map +1 -0
- package/dist/verify/shortfall-rulings.d.ts.map +1 -1
- package/dist/verify/shortfall-rulings.js +3 -2
- package/dist/verify/shortfall-rulings.js.map +1 -1
- package/dist/verify/verification-boundary-env.d.ts +70 -17
- package/dist/verify/verification-boundary-env.d.ts.map +1 -1
- package/dist/verify/verification-boundary-env.js +88 -14
- package/dist/verify/verification-boundary-env.js.map +1 -1
- package/dist/verify/verification-commit-sharing.d.ts.map +1 -1
- package/dist/verify/verification-commit-sharing.js +2 -1
- 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 -0
- package/dist/verify/verification-config.js.map +1 -1
- package/dist/verify/verification-default-on.d.ts +0 -32
- package/dist/verify/verification-default-on.d.ts.map +1 -1
- package/dist/verify/verification-default-on.js +10 -234
- 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 +9 -0
- package/dist/verify/verification-deps-default.js.map +1 -1
- package/dist/verify/verification-engine.d.ts +2 -1
- package/dist/verify/verification-engine.d.ts.map +1 -1
- package/dist/verify/verification-engine.js +12 -4
- package/dist/verify/verification-engine.js.map +1 -1
- package/dist/verify/verification-feedback.d.ts +1 -1
- package/dist/verify/verification-feedback.d.ts.map +1 -1
- package/dist/verify/verification-feedback.js +5 -0
- package/dist/verify/verification-feedback.js.map +1 -1
- package/dist/verify/verification-rework-issue.d.ts +48 -7
- package/dist/verify/verification-rework-issue.d.ts.map +1 -1
- package/dist/verify/verification-rework-issue.js +111 -9
- package/dist/verify/verification-rework-issue.js.map +1 -1
- package/package.json +2 -2
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Split out of audit-phase.ts (which owns the phase's orchestration: spawn,
|
|
5
5
|
* session lineage, audit_runs persistence, summary parsing). This module is the
|
|
6
|
-
* prompt half
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* prompt half -- string constants and composition -- so the phase logic and the
|
|
7
|
+
* prompt text can be read and changed independently. Its ONE import is the
|
|
8
|
+
* rendered round-5 floor section (`audit-floor-policy.ts`), which carries the
|
|
9
|
+
* floor's normative content as typed data rather than as prose here.
|
|
9
10
|
*
|
|
10
11
|
* The posture-neutral discipline block below is kept BYTE-IDENTICAL to the MCP
|
|
11
12
|
* package's copy and is gated by audit-guide-sync.test.ts (which reads THIS
|
|
@@ -26,180 +27,6 @@
|
|
|
26
27
|
* (Bell CSN 2026-07-27).
|
|
27
28
|
*/
|
|
28
29
|
export type AuditPosture = 'read_only' | 'live';
|
|
29
|
-
/**
|
|
30
|
-
* Round-5 pre-condition: the focus's own declared floor.
|
|
31
|
-
*
|
|
32
|
-
* Deliberately OUTSIDE the SHARED-AUDIT-GUIDE sentinels, for the same reason
|
|
33
|
-
* the residue hold below is: it states a precondition that only a pass holding
|
|
34
|
-
* the daemon's `focus.criteria_standing` section can satisfy, and the MCP
|
|
35
|
-
* guide's readers have no such section.
|
|
36
|
-
*
|
|
37
|
-
* WHY IT EXISTS. Round 5 anchors one remediation delivery per injection, and
|
|
38
|
-
* nothing in that loop ever asked what the focus SAID IT WAS FOR. An
|
|
39
|
-
* elaboration loop with no stated stopping condition does not stop -- it runs
|
|
40
|
-
* until someone gets tired -- so a focus grows deliveries while its declared
|
|
41
|
-
* criteria sit close to met. The standing section is the stated condition; this
|
|
42
|
-
* text is what makes the pass CONSULT it before it anchors, rather than after.
|
|
43
|
-
*
|
|
44
|
-
* The bases are given distinct instructions on purpose. The one that must not
|
|
45
|
-
* collapse into the others is `no_criteria_declared`: an empty criteria set is
|
|
46
|
-
* UNMEASURED, not arrived, and a pass that read it as a floor would stop
|
|
47
|
-
* hardest on exactly the focuses that declared nothing to be measured against.
|
|
48
|
-
*
|
|
49
|
-
* WHAT THE FLOOR IS NOT (round-5 correction, 2026-09-18). An earlier wording
|
|
50
|
-
* made CRITERION COVERAGE the test for whether a new root cause could be
|
|
51
|
-
* anchored, which converts the floor into the freeze the request rules out: a
|
|
52
|
-
* genuinely new root cause is perfectly capable of sitting inside an
|
|
53
|
-
* already-addressed criterion, and suppressing it there loses real signal to a
|
|
54
|
-
* bookkeeping fact about which criteria have deliveries pointing at them. The
|
|
55
|
-
* floor turns on RESIDUE (or restatement) vs GENUINELY NEW ROOT CAUSE, which
|
|
56
|
-
* is orthogonal to coverage: coverage answers "is there open declared work?",
|
|
57
|
-
* never "is this cause new?".
|
|
58
|
-
*
|
|
59
|
-
* WHY THE FLOOR IS DATA (rounds 6-7, 2026-09-19). Two earlier guards READ the
|
|
60
|
-
* hand-written floor prose looking for a restriction -- one sentence at a time,
|
|
61
|
-
* then across a wider window -- and both lost the same way: the restriction
|
|
62
|
-
* moved to a sentence the reading missed, or a wording its vocabulary lacked.
|
|
63
|
-
* So the normative content became the structure below, the prose became its
|
|
64
|
-
* rendering, and no rule carries a sentence of its own. The normative sentence
|
|
65
|
-
* is COMPOSED from the rule's typed fields against a CLOSED lexicon
|
|
66
|
-
* (`CANDIDATE_SUBJECT`, `DISPOSITION_VERB`, `UNCONDITIONAL_SCOPE`): subject
|
|
67
|
-
* from `candidate`, verb from `disposition`, scope from `conditions`, where an
|
|
68
|
-
* empty `conditions` renders an explicit "in every case this basis can present"
|
|
69
|
-
* rather than a silence a reader fills with the old freeze. Keep that: it makes
|
|
70
|
-
* a CONDITION countable instead of something to read prose for.
|
|
71
|
-
*
|
|
72
|
-
* WHY THE REMAINING PROSE IS PINNED BY EQUALITY (round-8 correction,
|
|
73
|
-
* 2026-09-19). Round 7 left the context prose -- leads, situations, caveats,
|
|
74
|
-
* obligations, and the two paragraphs `renderFloorSection` writes directly --
|
|
75
|
-
* guarded by `findFloorProseViolations`, and the commit that shipped it called
|
|
76
|
-
* that "a whitelist of CHANNEL, not an enumeration of wording". THAT CLAIM WAS
|
|
77
|
-
* FALSE, and review demonstrated it. `CANDIDATE_NOUN` and
|
|
78
|
-
* `DISPOSITION_VERB_IN_PROSE` are finite regex vocabularies, so the guard only
|
|
79
|
-
* recognised a normative claim written in words it already knew: appending
|
|
80
|
-
* "Fresh findings wait for review." or "A genuinely new root cause proceeds
|
|
81
|
-
* after every existing delivery is reviewed." draws NO violation and renders a
|
|
82
|
-
* contradictory restriction. Fourth iteration of one lesson, now unmistakable:
|
|
83
|
-
* ANY guard asking "does this text MEAN something normative?" loses, because
|
|
84
|
-
* meaning is open-ended.
|
|
85
|
-
*
|
|
86
|
-
* So the floor stops asking. This policy is a static constant, so the strings
|
|
87
|
-
* it can put in front of an assessor are a fixed, finite set, and the PRIMARY
|
|
88
|
-
* GUARANTEE is an equality pin on the whole rendered section:
|
|
89
|
-
* `FLOOR_SECTION_PIN` in audit-phase.test.ts holds an independent copy and the
|
|
90
|
-
* suite asserts `renderFloorSection()` equals it line for line. A synonym, an
|
|
91
|
-
* unlisted vocabulary and a wording nobody imagined then fail identically --
|
|
92
|
-
* not because a rule recognises them, but because none of them are the pinned
|
|
93
|
-
* string. It covers EVERY string the assessor reads here, the two paragraphs
|
|
94
|
-
* `renderFloorSection` writes among them, which no field-level guard ever saw.
|
|
95
|
-
*
|
|
96
|
-
* The cost is the intended one: editing floor prose is a TWO-PLACE, VISIBLE act
|
|
97
|
-
* -- the author updates the pin in the same change and a reviewer reads both
|
|
98
|
-
* halves. The pin is literal text rather than a checksum precisely so that
|
|
99
|
-
* second half stays readable. Its LIMIT, plainly: the pin is scoped to this
|
|
100
|
-
* floor section. It does not cover `AUDIT_UNREVIEWED_RESIDUE`, the posture
|
|
101
|
-
* sections, or `AUDIT_GUIDE_SHARED` (which carries its own byte pin against the
|
|
102
|
-
* MCP copy, in audit-guide-sync.test.ts).
|
|
103
|
-
*/
|
|
104
|
-
/** A candidate for anchoring, in the floor's own terms. */
|
|
105
|
-
export type AnchorCandidate = 'residue_or_restatement' | 'new_root_cause';
|
|
106
|
-
/** What the floor does with a candidate. */
|
|
107
|
-
export type AnchorDisposition = 'withhold' | 'anchor';
|
|
108
|
-
/**
|
|
109
|
-
* A fact a pass could mistake for the test. A factor named here is rendered as
|
|
110
|
-
* explicitly NOT deciding; it may never appear as a condition (tests pin that).
|
|
111
|
-
*/
|
|
112
|
-
export type NonDecidingFactor = 'criterion_coverage';
|
|
113
|
-
/**
|
|
114
|
-
* One normative rule of the floor: what happens to a candidate, and on what.
|
|
115
|
-
*
|
|
116
|
-
* Every field is a typed enum or a DECLARED list. There is deliberately no
|
|
117
|
-
* sentence field: the rule's sentence is composed from these fields, because a
|
|
118
|
-
* hand-written sentence is the one place a restriction can sit where no
|
|
119
|
-
* structural channel sees it.
|
|
120
|
-
*/
|
|
121
|
-
export interface AnchoringRule {
|
|
122
|
-
readonly candidate: AnchorCandidate;
|
|
123
|
-
readonly disposition: AnchorDisposition;
|
|
124
|
-
/**
|
|
125
|
-
* Conditions the disposition genuinely depends on. EMPTY means
|
|
126
|
-
* UNCONDITIONAL. This is the ONLY door through which a condition on
|
|
127
|
-
* anchoring can reach the rendered prompt.
|
|
128
|
-
*/
|
|
129
|
-
readonly conditions: readonly string[];
|
|
130
|
-
/** Facts that never decide this disposition; rendered as "not the test". */
|
|
131
|
-
readonly nonDeciding: readonly NonDecidingFactor[];
|
|
132
|
-
/** What is OWED when the disposition is exercised. An obligation is not a gate. */
|
|
133
|
-
readonly obligations: readonly string[];
|
|
134
|
-
}
|
|
135
|
-
/** One basis the criteria-standing section can report, with its own rules. */
|
|
136
|
-
export interface FloorBasis {
|
|
137
|
-
/** Machine token the standing section reports (or `read_failed`). */
|
|
138
|
-
readonly basis: string;
|
|
139
|
-
/** Whether this basis IS a floor. `no_criteria_declared` is NOT one. */
|
|
140
|
-
readonly isFloor: boolean;
|
|
141
|
-
/** Bolded opening of the rendered bullet. Context, never a disposition. */
|
|
142
|
-
readonly lead: string;
|
|
143
|
-
/** What the basis means, before any rule applies. Context, never a disposition. */
|
|
144
|
-
readonly situation: string;
|
|
145
|
-
readonly rules: readonly AnchoringRule[];
|
|
146
|
-
/** Closing clarification for the basis. Context, never a disposition. */
|
|
147
|
-
readonly caveat?: string;
|
|
148
|
-
}
|
|
149
|
-
/** The floor's whole normative content, in one declarable structure. */
|
|
150
|
-
export interface FloorPolicy {
|
|
151
|
-
/** Bolded opening of the universal paragraph. */
|
|
152
|
-
readonly universalLead: string;
|
|
153
|
-
/** Rules that hold at EVERY basis. */
|
|
154
|
-
readonly universal: readonly AnchoringRule[];
|
|
155
|
-
/** Closing prose of the universal paragraph. Context, never a disposition. */
|
|
156
|
-
readonly universalClosing: readonly string[];
|
|
157
|
-
readonly bases: readonly FloorBasis[];
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* The declared floor. Everything normative the floor says about what may be
|
|
161
|
-
* anchored is in the TYPED fields here; the prose below is generated from
|
|
162
|
-
* them, and the free-text fields carry context only.
|
|
163
|
-
*/
|
|
164
|
-
export declare const AUDIT_FLOOR_POLICY: FloorPolicy;
|
|
165
|
-
/** Where a rule is being stated: the universal paragraph, or one basis. */
|
|
166
|
-
export type RuleScope = 'universal' | 'basis';
|
|
167
|
-
/** A free-text field of the policy, with the path it sits at. */
|
|
168
|
-
export interface ProseField {
|
|
169
|
-
readonly path: string;
|
|
170
|
-
readonly text: string;
|
|
171
|
-
}
|
|
172
|
-
/** A prose field that has strayed into stating the floor's normative content. */
|
|
173
|
-
export interface FloorProseViolation {
|
|
174
|
-
readonly path: string;
|
|
175
|
-
readonly text: string;
|
|
176
|
-
readonly reason: string;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Every free-text field of the policy. `conditions` is deliberately absent: it
|
|
180
|
-
* IS the declared channel for a scope, and it is counted rather than banned.
|
|
181
|
-
*
|
|
182
|
-
* Exported so the suite can prove the equality pin COVERS this set (every
|
|
183
|
-
* field's exact text appears verbatim inside the pinned render) rather than
|
|
184
|
-
* trusting a hand-maintained field list that goes stale on the next addition.
|
|
185
|
-
*/
|
|
186
|
-
export declare function floorProseFields(policy?: FloorPolicy): readonly ProseField[];
|
|
187
|
-
/**
|
|
188
|
-
* Prose fields that state normative content IN A WORDING THESE LISTS KNOW. An
|
|
189
|
-
* empty result means "nothing recognised", NEVER "nothing normative" -- see the
|
|
190
|
-
* BACKSTOP note above for why no wording list can mean the latter. The
|
|
191
|
-
* completeness guarantee is the equality pin in audit-phase.test.ts; this only
|
|
192
|
-
* makes the recognised cases fail earlier, at load, with a named path. Exported
|
|
193
|
-
* so a test can demonstrate rejection on a mutated policy.
|
|
194
|
-
*/
|
|
195
|
-
export declare function findFloorProseViolations(policy?: FloorPolicy): readonly FloorProseViolation[];
|
|
196
|
-
/** Render the policy: the universal paragraph, then one bullet per basis. */
|
|
197
|
-
export declare function renderFloorPolicy(policy?: FloorPolicy): readonly string[];
|
|
198
|
-
/**
|
|
199
|
-
* The composed floor section: the pointer at the standing section (which
|
|
200
|
-
* states no rule about what may be anchored), then the rendered policy.
|
|
201
|
-
*/
|
|
202
|
-
export declare function renderFloorSection(policy?: FloorPolicy): readonly string[];
|
|
203
30
|
/**
|
|
204
31
|
* Compose the audit assessor prompt for a given posture. The read-only and live
|
|
205
32
|
* postures differ ONLY in the posture section; the discipline (AUDIT_GUIDE_SHARED)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-prompt.d.ts","sourceRoot":"","sources":["../../src/audit/audit-prompt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"audit-prompt.d.ts","sourceRoot":"","sources":["../../src/audit/audit-prompt.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,MAAM,CAAC;AAmOhD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAU9D;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,QAAgC,CAAC"}
|
|
@@ -1,8 +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/audit/audit-guide-sync.test.ts,
|
|
3
|
-
// packages/daemon/src/audit/audit-phase.test.ts,
|
|
4
3
|
// packages/daemon/src/prompt/decision-rule-replaces-escalation.test.ts
|
|
5
4
|
// PINNED-BY-END
|
|
5
|
+
import { renderFloorSection } from './audit-floor-policy.js';
|
|
6
6
|
/**
|
|
7
7
|
* Posture-independent intro. The first line is stable across postures (a spawn
|
|
8
8
|
* test asserts the composed prompt begins with it). "READ-ONLY with respect to
|
|
@@ -183,336 +183,13 @@ injection-anchored plan inverts that: remediation is scoped one root cause at a
|
|
|
183
183
|
time from an injection, with acceptance pinned to a desired effect, so there is
|
|
184
184
|
nothing to over-complete. The structured CRT + FRT make a wrong root cause
|
|
185
185
|
legible as a plan -- catchable up front rather than only after code has moved.`;
|
|
186
|
+
// SHARED-AUDIT-GUIDE:END
|
|
186
187
|
/**
|
|
187
|
-
* The
|
|
188
|
-
*
|
|
188
|
+
* The round-5 floor section, rendered from the declared policy. The policy, its
|
|
189
|
+
* closed lexicon and its renderers live in `audit-floor-policy.ts`; this file
|
|
190
|
+
* only embeds the rendered lines, so the floor's normative content stays one
|
|
191
|
+
* structure with one pin.
|
|
189
192
|
*/
|
|
190
|
-
const WITHHOLD_RESIDUE = {
|
|
191
|
-
candidate: 'residue_or_restatement',
|
|
192
|
-
disposition: 'withhold',
|
|
193
|
-
conditions: [],
|
|
194
|
-
nonDeciding: [],
|
|
195
|
-
obligations: [],
|
|
196
|
-
};
|
|
197
|
-
/**
|
|
198
|
-
* The declared floor. Everything normative the floor says about what may be
|
|
199
|
-
* anchored is in the TYPED fields here; the prose below is generated from
|
|
200
|
-
* them, and the free-text fields carry context only.
|
|
201
|
-
*/
|
|
202
|
-
export const AUDIT_FLOOR_POLICY = {
|
|
203
|
-
universalLead: 'The floor stops ELABORATION, not new work.',
|
|
204
|
-
universal: [
|
|
205
|
-
WITHHOLD_RESIDUE,
|
|
206
|
-
{
|
|
207
|
-
candidate: 'new_root_cause',
|
|
208
|
-
disposition: 'anchor',
|
|
209
|
-
conditions: [],
|
|
210
|
-
nonDeciding: ['criterion_coverage'],
|
|
211
|
-
obligations: ['why the cause is new rather than residue or a restatement'],
|
|
212
|
-
},
|
|
213
|
-
],
|
|
214
|
-
universalClosing: [
|
|
215
|
-
'Anchoring past a reached floor is a DECLARED act, never a silent one -- but it is declared by what you DRAW, not by what you write. On an armed focus a delivery that serves no effect the arm covers is recorded and waits for the next arm; to have it run now, draw the causal edge that makes it means. There is no reason field that substitutes for the edge.',
|
|
216
|
-
],
|
|
217
|
-
bases: [
|
|
218
|
-
{
|
|
219
|
-
basis: 'all_criteria_addressed',
|
|
220
|
-
isFloor: true,
|
|
221
|
-
lead: 'Basis `all_criteria_addressed` -- the floor is REACHED.',
|
|
222
|
-
situation: 'Every criterion the focus declared already has a delivery pointing at it, so there is no OPEN declared work to elaborate against.',
|
|
223
|
-
rules: [
|
|
224
|
-
WITHHOLD_RESIDUE,
|
|
225
|
-
{
|
|
226
|
-
candidate: 'new_root_cause',
|
|
227
|
-
disposition: 'anchor',
|
|
228
|
-
conditions: [],
|
|
229
|
-
nonDeciding: ['criterion_coverage'],
|
|
230
|
-
obligations: [
|
|
231
|
-
'why the cause is new rather than residue or a restatement',
|
|
232
|
-
'which criterion it touches',
|
|
233
|
-
],
|
|
234
|
-
},
|
|
235
|
-
],
|
|
236
|
-
caveat: 'Note what the basis does NOT mean: addressed is not MET. Whether the work satisfies a criterion is the focus review\'s judgement, not yours, so "the floor is reached" is never "the focus is done" -- it is "there is nothing further for THIS pass to ELABORATE".',
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
basis: 'open_criteria_remain',
|
|
240
|
-
isFloor: false,
|
|
241
|
-
lead: 'Basis `open_criteria_remain` -- the open criteria ARE the remaining work.',
|
|
242
|
-
situation: 'Work against them by name: each injection you author should trace to an OPEN criterion, and your audit summary should say which.',
|
|
243
|
-
rules: [
|
|
244
|
-
{
|
|
245
|
-
candidate: 'new_root_cause',
|
|
246
|
-
disposition: 'anchor',
|
|
247
|
-
conditions: [],
|
|
248
|
-
nonDeciding: [],
|
|
249
|
-
obligations: [],
|
|
250
|
-
},
|
|
251
|
-
],
|
|
252
|
-
caveat: 'A new delivery that addresses no open criterion needs an explicit reason for existing, stated in the summary.',
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
basis: 'no_criteria_declared',
|
|
256
|
-
isFloor: false,
|
|
257
|
-
lead: 'Basis `no_criteria_declared` -- this is NOT a floor.',
|
|
258
|
-
situation: 'A focus that declared no acceptance criteria has gone UNMEASURED, not arrived.',
|
|
259
|
-
rules: [
|
|
260
|
-
WITHHOLD_RESIDUE,
|
|
261
|
-
{
|
|
262
|
-
candidate: 'new_root_cause',
|
|
263
|
-
disposition: 'anchor',
|
|
264
|
-
conditions: [],
|
|
265
|
-
nonDeciding: [],
|
|
266
|
-
obligations: [
|
|
267
|
-
'that this focus declares no criteria, so no floor could be computed for it',
|
|
268
|
-
],
|
|
269
|
-
},
|
|
270
|
-
],
|
|
271
|
-
caveat: 'Do not read the empty set as "everything is addressed", and do not read it as licence to elaborate without limit: judge each candidate on the tree\'s own evidence.',
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
basis: 'read_failed',
|
|
275
|
-
isFloor: false,
|
|
276
|
-
lead: 'If that section says READ FAILED, you have NO floor.',
|
|
277
|
-
situation: 'An unreadable standing is not evidence that every criterion is addressed.',
|
|
278
|
-
rules: [
|
|
279
|
-
WITHHOLD_RESIDUE,
|
|
280
|
-
{
|
|
281
|
-
candidate: 'new_root_cause',
|
|
282
|
-
disposition: 'anchor',
|
|
283
|
-
conditions: [],
|
|
284
|
-
nonDeciding: [],
|
|
285
|
-
obligations: ['that the standing was unreadable on this pass'],
|
|
286
|
-
},
|
|
287
|
-
],
|
|
288
|
-
},
|
|
289
|
-
],
|
|
290
|
-
};
|
|
291
|
-
/**
|
|
292
|
-
* CLOSED LEXICON (1/4): the subject of the normative sentence, chosen by the
|
|
293
|
-
* rule's `candidate`. Stated in full where the test is introduced, and short
|
|
294
|
-
* at each basis so the definition is given once rather than four times.
|
|
295
|
-
*/
|
|
296
|
-
const CANDIDATE_SUBJECT = {
|
|
297
|
-
universal: {
|
|
298
|
-
new_root_cause: 'A GENUINELY NEW ROOT CAUSE -- one no existing delivery already covers --',
|
|
299
|
-
residue_or_restatement: 'RESIDUE of work still in flight -- or a RESTATEMENT or refinement of a cause an existing delivery already covers --',
|
|
300
|
-
},
|
|
301
|
-
basis: {
|
|
302
|
-
new_root_cause: 'A genuinely new root cause',
|
|
303
|
-
residue_or_restatement: 'Residue, or a restatement or refinement of a cause already covered,',
|
|
304
|
-
},
|
|
305
|
-
};
|
|
306
|
-
/** CLOSED LEXICON (2/4): the same candidate named as the side of the test. */
|
|
307
|
-
const CANDIDATE_LABEL = {
|
|
308
|
-
new_root_cause: 'NEW ROOT CAUSE',
|
|
309
|
-
residue_or_restatement: 'RESIDUE OR RESTATEMENT',
|
|
310
|
-
};
|
|
311
|
-
/** CLOSED LEXICON (3/4): what the floor DOES, chosen by `disposition`. */
|
|
312
|
-
const DISPOSITION_VERB = {
|
|
313
|
-
anchor: 'is ANCHORED',
|
|
314
|
-
withhold: 'is WITHHELD',
|
|
315
|
-
};
|
|
316
|
-
/**
|
|
317
|
-
* CLOSED LEXICON (4/4): how a disposition with NO declared conditions states
|
|
318
|
-
* its own scope. An unconditional rule must SAY it is unconditional: a
|
|
319
|
-
* sentence that merely omits the scope is one a reader fills with the last
|
|
320
|
-
* rule they were taught.
|
|
321
|
-
*/
|
|
322
|
-
const UNCONDITIONAL_SCOPE = {
|
|
323
|
-
universal: {
|
|
324
|
-
anchor: 'at every basis below, in every case those bases can present, with nothing further to satisfy first',
|
|
325
|
-
withhold: 'at every basis below, in every case those bases can present',
|
|
326
|
-
},
|
|
327
|
-
basis: {
|
|
328
|
-
anchor: 'here, in every case this basis can present, with nothing further to satisfy first',
|
|
329
|
-
withhold: 'here, in every case this basis can present',
|
|
330
|
-
},
|
|
331
|
-
};
|
|
332
|
-
/**
|
|
333
|
-
* Prose for each non-deciding factor. One sentence per factor, stated once
|
|
334
|
-
* here, so "coverage is not the test" cannot drift from rule to rule.
|
|
335
|
-
*/
|
|
336
|
-
const NON_DECIDING_PROSE = {
|
|
337
|
-
criterion_coverage: 'Whether a declared criterion already covers the ground a cause sits on is NOT the test and never decides it: coverage tells you whether declared work remains OPEN, it cannot tell you whether a cause is NEW.',
|
|
338
|
-
};
|
|
339
|
-
/** How an obligation sentence opens, per disposition. */
|
|
340
|
-
const OBLIGATION_LEAD = {
|
|
341
|
-
anchor: 'When you anchor, say in your audit summary',
|
|
342
|
-
withhold: 'When you withhold, say in your audit summary',
|
|
343
|
-
};
|
|
344
|
-
// ---- BACKSTOP: a fast, INCOMPLETE check on the policy's remaining prose ----
|
|
345
|
-
//
|
|
346
|
-
// Read this before trusting the rules below. They are an ENUMERATION of
|
|
347
|
-
// wordings, NOT the guarantee that context prose carries no restriction -- the
|
|
348
|
-
// equality pin on the rendered section is (round-8 note above). What they buy
|
|
349
|
-
// is EARLINESS and a NAMED reason: a claim in vocabulary they happen to know
|
|
350
|
-
// fails at module load with the offending path, instead of surfacing later as
|
|
351
|
-
// an unexplained diff against the pin. Stated limits:
|
|
352
|
-
// - the lists are finite, and no list can be complete. The two escapes review
|
|
353
|
-
// filed -- "Fresh findings wait for review." and "A genuinely new root
|
|
354
|
-
// cause proceeds after every existing delivery is reviewed." -- carry no
|
|
355
|
-
// listed noun/verb pair and no scope marker, so these rules PASS them. The
|
|
356
|
-
// pin rejects them.
|
|
357
|
-
// - they can only ADD rejections. Nothing reads a green result as evidence
|
|
358
|
-
// that prose is clean: a green backstop over a changed render is still RED.
|
|
359
|
-
// Widening the lists is allowed and harmless. It is not progress, and it must
|
|
360
|
-
// never be written up as closing the class.
|
|
361
|
-
/** Nouns that name one of the floor's candidates. Finite; not exhaustive. */
|
|
362
|
-
const CANDIDATE_NOUN = /\b(root causes?|residue|restatements?|refinements?)\b/i;
|
|
363
|
-
/** Verbs that state what the floor DOES with a candidate. Finite; not exhaustive. */
|
|
364
|
-
const DISPOSITION_VERB_IN_PROSE = /\b(anchors?|anchored|anchoring|withholds?|withheld|suppress(?:es|ed)?|defers?|deferred|skips?|skipped|omits?|omitted|excludes?|excluded)\b/i;
|
|
365
|
-
/** Markers that narrow a claim's scope. A scope is declared, never written. */
|
|
366
|
-
const SCOPE_MARKER = /\b(only|unless|except|solely|provided that|so long as|as long as|conditional on|contingent on)\b/i;
|
|
367
|
-
/**
|
|
368
|
-
* Every free-text field of the policy. `conditions` is deliberately absent: it
|
|
369
|
-
* IS the declared channel for a scope, and it is counted rather than banned.
|
|
370
|
-
*
|
|
371
|
-
* Exported so the suite can prove the equality pin COVERS this set (every
|
|
372
|
-
* field's exact text appears verbatim inside the pinned render) rather than
|
|
373
|
-
* trusting a hand-maintained field list that goes stale on the next addition.
|
|
374
|
-
*/
|
|
375
|
-
export function floorProseFields(policy = AUDIT_FLOOR_POLICY) {
|
|
376
|
-
const obligationsOf = (at, rules) => rules.flatMap((rule, j) => rule.obligations.map((text, k) => ({ path: `${at}.rules[${j}].obligations[${k}]`, text })));
|
|
377
|
-
const fields = [
|
|
378
|
-
{ path: 'universalLead', text: policy.universalLead },
|
|
379
|
-
...policy.universalClosing.map((text, i) => ({ path: `universalClosing[${i}]`, text })),
|
|
380
|
-
...obligationsOf('universal', policy.universal),
|
|
381
|
-
];
|
|
382
|
-
policy.bases.forEach((basis, i) => {
|
|
383
|
-
const at = `bases[${i}]`;
|
|
384
|
-
fields.push({ path: `${at}.lead`, text: basis.lead });
|
|
385
|
-
fields.push({ path: `${at}.situation`, text: basis.situation });
|
|
386
|
-
if (basis.caveat !== undefined)
|
|
387
|
-
fields.push({ path: `${at}.caveat`, text: basis.caveat });
|
|
388
|
-
fields.push(...obligationsOf(at, basis.rules));
|
|
389
|
-
});
|
|
390
|
-
return fields;
|
|
391
|
-
}
|
|
392
|
-
/**
|
|
393
|
-
* Prose fields that state normative content IN A WORDING THESE LISTS KNOW. An
|
|
394
|
-
* empty result means "nothing recognised", NEVER "nothing normative" -- see the
|
|
395
|
-
* BACKSTOP note above for why no wording list can mean the latter. The
|
|
396
|
-
* completeness guarantee is the equality pin in audit-phase.test.ts; this only
|
|
397
|
-
* makes the recognised cases fail earlier, at load, with a named path. Exported
|
|
398
|
-
* so a test can demonstrate rejection on a mutated policy.
|
|
399
|
-
*/
|
|
400
|
-
export function findFloorProseViolations(policy = AUDIT_FLOOR_POLICY) {
|
|
401
|
-
const violations = [];
|
|
402
|
-
for (const field of floorProseFields(policy)) {
|
|
403
|
-
if (CANDIDATE_NOUN.test(field.text) && DISPOSITION_VERB_IN_PROSE.test(field.text)) {
|
|
404
|
-
violations.push({
|
|
405
|
-
path: field.path,
|
|
406
|
-
text: field.text,
|
|
407
|
-
reason: 'states a DISPOSITION for a CANDIDATE in prose. That claim is composed from '
|
|
408
|
-
+ '`candidate` + `disposition` + `conditions`; written by hand it is the one place a '
|
|
409
|
-
+ 'restriction sits where no structural channel sees it.',
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
|
-
if (SCOPE_MARKER.test(field.text)) {
|
|
413
|
-
violations.push({
|
|
414
|
-
path: field.path,
|
|
415
|
-
text: field.text,
|
|
416
|
-
reason: 'narrows a claim with a scope marker. A scope on the floor is declared in a rule\'s '
|
|
417
|
-
+ '`conditions`, where it is rendered as one clause and counted; context prose states none.',
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
return violations;
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Fail LOUDLY rather than compose a prompt that contradicts its own structure.
|
|
425
|
-
* The policy is a static constant, so a green test run is proof this can never
|
|
426
|
-
* throw at runtime; it throws at module load if someone edits prose into a
|
|
427
|
-
* normative claim THE BACKSTOP RECOGNISES. Prose it does not recognise composes
|
|
428
|
-
* fine here and is caught by the equality pin instead.
|
|
429
|
-
*/
|
|
430
|
-
function assertFloorProseIsContextOnly(policy) {
|
|
431
|
-
const violations = findFloorProseViolations(policy);
|
|
432
|
-
if (violations.length === 0)
|
|
433
|
-
return;
|
|
434
|
-
const detail = violations
|
|
435
|
-
.map((v) => ` ${v.path}: ${v.reason}\n text: ${v.text}`)
|
|
436
|
-
.join('\n');
|
|
437
|
-
throw new Error('audit floor policy: free-text field(s) carry normative content. The floor\'s normative '
|
|
438
|
-
+ 'claims are composed from the typed fields (candidate, disposition, conditions, '
|
|
439
|
-
+ 'nonDeciding); prose carries context only.\n' + detail);
|
|
440
|
-
}
|
|
441
|
-
/** Join clauses into one readable list ("a, b, and c"). */
|
|
442
|
-
function joinClauses(items) {
|
|
443
|
-
if (items.length < 2)
|
|
444
|
-
return items[0] ?? '';
|
|
445
|
-
return `${items.slice(0, -1).join(', ')}, and ${items[items.length - 1] ?? ''}`;
|
|
446
|
-
}
|
|
447
|
-
/**
|
|
448
|
-
* Render one rule as prose, entirely from its typed fields. A CONDITIONAL
|
|
449
|
-
* clause is emitted if and only if the rule declares conditions -- that
|
|
450
|
-
* one-to-one correspondence is what the tests count, so a freeze cannot be
|
|
451
|
-
* smuggled in as an extra sentence, and there is no sentence to write it in.
|
|
452
|
-
*/
|
|
453
|
-
function renderRule(rule, scope) {
|
|
454
|
-
const dispositionScope = rule.conditions.length > 0
|
|
455
|
-
? `only where ${joinClauses(rule.conditions)}`
|
|
456
|
-
: UNCONDITIONAL_SCOPE[scope][rule.disposition];
|
|
457
|
-
const parts = [
|
|
458
|
-
`${CANDIDATE_SUBJECT[scope][rule.candidate]} ${DISPOSITION_VERB[rule.disposition]} ${dispositionScope}.`,
|
|
459
|
-
];
|
|
460
|
-
for (const factor of rule.nonDeciding)
|
|
461
|
-
parts.push(NON_DECIDING_PROSE[factor]);
|
|
462
|
-
if (rule.obligations.length > 0) {
|
|
463
|
-
parts.push(`${OBLIGATION_LEAD[rule.disposition]} ${joinClauses(rule.obligations)}.`);
|
|
464
|
-
}
|
|
465
|
-
return parts.join(' ');
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* Name the test, and state whether it holds everywhere. The "same test at
|
|
469
|
-
* every basis" half is COMPUTED against the bases rather than asserted, so a
|
|
470
|
-
* basis that departed from the universal rule would change this sentence
|
|
471
|
-
* instead of being contradicted by it.
|
|
472
|
-
*/
|
|
473
|
-
function renderTestSentence(policy) {
|
|
474
|
-
const universalDisposition = new Map(policy.universal.map((rule) => [rule.candidate, rule.disposition]));
|
|
475
|
-
const uniform = policy.bases.every((basis) => basis.rules.every((rule) => {
|
|
476
|
-
const declared = universalDisposition.get(rule.candidate);
|
|
477
|
-
return declared === undefined || (declared === rule.disposition && rule.conditions.length === 0);
|
|
478
|
-
}));
|
|
479
|
-
const sameness = uniform
|
|
480
|
-
? 'and it is the SAME test at every basis below'
|
|
481
|
-
: 'and the bases below depart from it -- read each one on its own terms';
|
|
482
|
-
return `The test is ${CANDIDATE_LABEL.residue_or_restatement} vs ${CANDIDATE_LABEL.new_root_cause}, ${sameness}.`;
|
|
483
|
-
}
|
|
484
|
-
/** Render one basis as a markdown bullet. */
|
|
485
|
-
function renderBasis(basis) {
|
|
486
|
-
const body = [basis.situation, ...basis.rules.map((rule) => renderRule(rule, 'basis'))];
|
|
487
|
-
if (basis.caveat !== undefined)
|
|
488
|
-
body.push(basis.caveat);
|
|
489
|
-
return `- **${basis.lead}** ${body.join(' ')}`;
|
|
490
|
-
}
|
|
491
|
-
/** Render the policy: the universal paragraph, then one bullet per basis. */
|
|
492
|
-
export function renderFloorPolicy(policy = AUDIT_FLOOR_POLICY) {
|
|
493
|
-
assertFloorProseIsContextOnly(policy);
|
|
494
|
-
const universal = [
|
|
495
|
-
`**${policy.universalLead}**`,
|
|
496
|
-
renderTestSentence(policy),
|
|
497
|
-
...policy.universal.map((rule) => renderRule(rule, 'universal')),
|
|
498
|
-
...policy.universalClosing,
|
|
499
|
-
].join(' ');
|
|
500
|
-
return [universal, '', ...policy.bases.map(renderBasis)];
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* The composed floor section: the pointer at the standing section (which
|
|
504
|
-
* states no rule about what may be anchored), then the rendered policy.
|
|
505
|
-
*/
|
|
506
|
-
export function renderFloorSection(policy = AUDIT_FLOOR_POLICY) {
|
|
507
|
-
return [
|
|
508
|
-
'',
|
|
509
|
-
'## Before you anchor (round 5): has this focus reached its declared floor?',
|
|
510
|
-
'',
|
|
511
|
-
'The "Focus acceptance criteria standing" section of your context lists this focus\'s OWN declared acceptance criteria, states for each whether a current delivery addresses it, and states the FLOOR with the basis it rests on. READ IT BEFORE YOU ANCHOR ANYTHING. It is the only thing in your context that says what this focus was for, and therefore the only thing that can tell you there is nothing left to anchor.',
|
|
512
|
-
'',
|
|
513
|
-
...renderFloorPolicy(policy),
|
|
514
|
-
];
|
|
515
|
-
}
|
|
516
193
|
const AUDIT_CRITERIA_FLOOR = renderFloorSection();
|
|
517
194
|
/**
|
|
518
195
|
* Round-5 pre-condition: attribute the fact, then let the structure decide.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-prompt.js","sourceRoot":"","sources":["../../src/audit/audit-prompt.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,iEAAiE;AACjE,
|
|
1
|
+
{"version":3,"file":"audit-prompt.js","sourceRoot":"","sources":["../../src/audit/audit-prompt.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,iEAAiE;AACjE,yEAAyE;AACzE,gBAAgB;AAEhB,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAiC7D;;;;;GAKG;AACH,MAAM,WAAW,GAAsB;IACrC,uEAAuE;IACvE,EAAE;IACF,ujBAAujB;CACxjB,CAAC;AAEF,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,4EAA4E;AAC5E,6CAA6C;AAC7C,kCAAkC;AAClC,MAAM,yBAAyB,GAAG,0/BAA0/B,CAAC;AAC7hC,gCAAgC;AAEhC;;;;;;GAMG;AACH,SAAS,mBAAmB,CAAC,OAAqB;IAChD,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;QAC5B,OAAO;YACL,EAAE;YACF,6RAA6R;SAC9R,CAAC;IACJ,CAAC;IACD,OAAO;QACL,EAAE;QACF,6DAA6D,GAAG,yBAAyB,GAAG,2TAA2T;KACxZ,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,kBAAkB,GAAsB;IAC5C,EAAE;IACF,yIAAyI;IACzI,EAAE;IACF,kBAAkB;IAClB,0BAA0B;IAC1B,0BAA0B;IAC1B,YAAY;IACZ,4IAA4I;IAC5I,KAAK;IACL,EAAE;IACF,6LAA6L;CAC9L,CAAC;AAEF,+EAA+E;AAC/E,uEAAuE;AACvE,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,oCAAoC;AACpC,2BAA2B;AAC3B,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+EAgHoD,CAAC;AAChF,yBAAyB;AAEzB;;;;;GAKG;AACH,MAAM,oBAAoB,GAAsB,kBAAkB,EAAE,CAAC;AAErE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,wBAAwB,GAAsB;IAClD,EAAE;IACF,qFAAqF;IACrF,EAAE;IACF,wVAAwV;IACxV,EAAE;IACF,qyBAAqyB;IACryB,wjBAAwjB;IACxjB,4oBAA4oB;IAC5oB,gMAAgM;IAChM,+MAA+M;CAChN,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAqB;IACpD,OAAO;QACL,GAAG,WAAW;QACd,GAAG,mBAAmB,CAAC,OAAO,CAAC;QAC/B,EAAE;QACF,kBAAkB;QAClB,GAAG,oBAAoB;QACvB,GAAG,wBAAwB;QAC3B,GAAG,kBAAkB;KACtB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -28,22 +28,58 @@ export interface CommitVerdictReleaseDeps extends Required<Pick<CommitVerdictGat
|
|
|
28
28
|
createEscalation: typeof createEscalation;
|
|
29
29
|
hasOpenFocusEscalation: (focusId: string, escalationKind: string) => Promise<boolean>;
|
|
30
30
|
now: () => number;
|
|
31
|
+
/**
|
|
32
|
+
* Whether `head` adds nothing of the focus's OWN work on top of the held commit
|
|
33
|
+
* `anchor` (git/focus-own-delta.ts isForeignOnlyExtension) -- the one advance a
|
|
34
|
+
* held review survives (module doc). Every unreadable input answers false, so the
|
|
35
|
+
* review re-fires; a deps object omitting it carries nothing forward.
|
|
36
|
+
*/
|
|
37
|
+
headAddsNoOwnWork?: (args: CarryForwardQuestion) => boolean;
|
|
31
38
|
}
|
|
39
|
+
/** What the carry-forward proof is asked about. */
|
|
40
|
+
export interface CarryForwardQuestion {
|
|
41
|
+
focusId: string;
|
|
42
|
+
/** Pinned focus branch identity (product_focuses.branch_name), or null. */
|
|
43
|
+
branchName: string | null;
|
|
44
|
+
integrationBranch: string;
|
|
45
|
+
/** The commit the held review judged. */
|
|
46
|
+
anchor: string;
|
|
47
|
+
/** The focus worktree HEAD now. */
|
|
48
|
+
head: string;
|
|
49
|
+
/** The focus's delivery ids: what "the focus's own work" means to the trailer read. */
|
|
50
|
+
ownDeliveryIds: ReadonlySet<string>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The production proof: provenance is read from the focus WORKTREE, where the focus
|
|
54
|
+
* branch is checked out and the gate ran. A focus with no live worktree entry
|
|
55
|
+
* (a restart before the focus was spawned) answers false -- carry nothing.
|
|
56
|
+
*/
|
|
57
|
+
export declare function headAddsNoOwnWork(q: CarryForwardQuestion): boolean;
|
|
32
58
|
/** What one pass did. */
|
|
33
59
|
export interface CommitVerdictReleaseCounts {
|
|
34
60
|
/** Held deliveries whose review exit was replayed. */
|
|
35
61
|
released: number;
|
|
36
62
|
/** Held deliveries whose held commit is no longer the focus HEAD (evidence dropped). */
|
|
37
63
|
superseded: number;
|
|
64
|
+
/** Held deliveries whose held review was carried to a HEAD that added no work of the focus's own. */
|
|
65
|
+
carried: number;
|
|
38
66
|
/** Held deliveries still waiting (no verdict yet, or a failed verdict being routed by feedback). */
|
|
39
67
|
waiting: number;
|
|
40
68
|
}
|
|
41
69
|
/** Test seam: forget reported overdue waits. */
|
|
42
70
|
export declare function __resetCommitVerdictReleaseForTests(): void;
|
|
71
|
+
/**
|
|
72
|
+
* The product-scoped config a release pass reads. `integrationBranch` is what the
|
|
73
|
+
* carry-forward proof compares against; without it (a partial test config) no held
|
|
74
|
+
* review is carried and every HEAD advance discards, as it did before.
|
|
75
|
+
*/
|
|
76
|
+
export type ReleaseConfig = Pick<DaemonConfig, 'organizationId' | 'productId'> & {
|
|
77
|
+
integrationBranch?: string;
|
|
78
|
+
};
|
|
43
79
|
/**
|
|
44
80
|
* One release pass over a product's active focuses. `config` must be
|
|
45
81
|
* product-scoped. Best-effort: a failure on one focus is logged and the next
|
|
46
82
|
* focus still runs; nothing throws.
|
|
47
83
|
*/
|
|
48
|
-
export declare function releaseCommitVerdictHolds(config:
|
|
84
|
+
export declare function releaseCommitVerdictHolds(config: ReleaseConfig, overrides?: Partial<CommitVerdictReleaseDeps>): Promise<CommitVerdictReleaseCounts>;
|
|
49
85
|
//# sourceMappingURL=commit-verdict-release.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commit-verdict-release.d.ts","sourceRoot":"","sources":["../../src/completion/commit-verdict-release.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commit-verdict-release.d.ts","sourceRoot":"","sources":["../../src/completion/commit-verdict-release.ts"],"names":[],"mappings":"AA+FA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAA0B,MAAM,2BAA2B,CAAC;AAOrF,OAAO,EAAwB,KAAK,qBAAqB,EAAyB,MAAM,+BAA+B,CAAC;AACxH,OAAO,EAAwB,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAQrF,uDAAuD;AACvD,eAAO,MAAM,2BAA2B,2BAA2B,CAAC;AAEpE;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,QAAqB,CAAC;AAE5D,kEAAkE;AAClE,MAAM,WAAW,wBAAyB,SAAQ,QAAQ,CAAC,IAAI,CAC7D,qBAAqB,EACrB,qBAAqB,GAAG,mBAAmB,GAAG,yBAAyB,GAAG,mBAAmB,CAC9F,CAAC;IACA,6EAA6E;IAC7E,iBAAiB,CAAC,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;IAC/D,oHAAoH;IACpH,sBAAsB,CAAC,EAAE,qBAAqB,CAAC,wBAAwB,CAAC,CAAC;IACzE,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,oBAAoB,EAAE,OAAO,oBAAoB,CAAC;IAClD,qBAAqB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IACpD,oBAAoB,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,sBAAsB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACtF,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,OAAO,CAAC;CAC7D;AAED,mDAAmD;AACnD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,uFAAuF;IACvF,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACrC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAOlE;AAeD,yBAAyB;AACzB,MAAM,WAAW,0BAA0B;IACzC,sDAAsD;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,wFAAwF;IACxF,UAAU,EAAE,MAAM,CAAC;IACnB,qGAAqG;IACrG,OAAO,EAAE,MAAM,CAAC;IAChB,oGAAoG;IACpG,OAAO,EAAE,MAAM,CAAC;CACjB;AAKD,gDAAgD;AAChD,wBAAgB,mCAAmC,IAAI,IAAI,CAE1D;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,YAAY,EAAE,gBAAgB,GAAG,WAAW,CAAC,GAAG;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAShH;;;;GAIG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,aAAa,EACrB,SAAS,GAAE,OAAO,CAAC,wBAAwB,CAAM,GAChD,OAAO,CAAC,0BAA0B,CAAC,CAoBrC"}
|