@awak-app/simy-cli 0.5.16 → 0.5.17

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.
Files changed (34) hide show
  1. package/README.md +61 -13
  2. package/package.json +2 -2
  3. package/src/cli-contract.js +1 -1
  4. package/src/codex-plugins/simy/.codex-plugin/plugin.json +5 -6
  5. package/src/console/app.js +2 -2
  6. package/src/orchestrator/budget.js +1 -1
  7. package/src/orchestrator/checklist-continuation.js +21 -0
  8. package/src/orchestrator/completion-contract.js +1 -1
  9. package/src/{codex-plugins/simy/skills/agentic-delivery-loop/SKILL.md → orchestrator/delivery/WORKFLOW.md} +65 -13
  10. package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/references/acceptance-evidence.md +27 -3
  11. package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/references/change-boundary-matrix.md +1 -1
  12. package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/references/delivery-levels.md +78 -27
  13. package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/references/minimum-completion.md +3 -3
  14. package/src/orchestrator/delivery/references/pr-closure.md +203 -0
  15. package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/references/state-and-receipts.md +4 -1
  16. package/src/orchestrator/delivery/references/ux-specification.md +98 -0
  17. package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/scripts/production-contract.mjs +1 -1
  18. package/src/orchestrator/delivery-level.js +19 -0
  19. package/src/orchestrator/independent-audit.js +8 -0
  20. package/src/orchestrator/instruction.js +11 -2
  21. package/src/orchestrator/loop.js +1 -1
  22. package/src/orchestrator/minimum-completion.js +2 -2
  23. package/src/orchestrator/pr-closure.js +26 -0
  24. package/src/orchestrator/presentation.js +2 -2
  25. package/src/orchestrator/result.js +2 -2
  26. package/src/orchestrator/ux-specification.js +20 -0
  27. package/src/runner.js +12 -0
  28. package/src/codex-plugins/simy/skills/agentic-delivery-loop/agents/openai.yaml +0 -5
  29. /package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/references/chrome-user-verification.md +0 -0
  30. /package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/references/cross-repository-control.md +0 -0
  31. /package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/references/local-sqm-evidence.md +0 -0
  32. /package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/references/shared-system-specifications.md +0 -0
  33. /package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/scripts/check-acceptance.mjs +0 -0
  34. /package/src/{codex-plugins/simy/skills/agentic-delivery-loop → orchestrator/delivery}/scripts/check-minimum-completion.mjs +0 -0
@@ -45,7 +45,7 @@ for the end-to-end row when the requested experience depends on their combinatio
45
45
  ## Executable contract
46
46
 
47
47
  `check-minimum-completion.mjs` and `check-acceptance.mjs` ship together under the
48
- installed skill's scripts directory. The CLI instruction supplies controller input
48
+ CLI runtime delivery/scripts directory. The CLI instruction supplies controller input
49
49
  JSON; save it as charter.json for the standalone command. It contains id,
50
50
  requirement, repository, acceptance_criteria, completion_contract (version 2), and
51
51
  thread_state.original_request. For standalone use the controller freezes the same
@@ -98,7 +98,7 @@ Evidence must be bounded regular files; path escapes/symlinks are rejected.
98
98
  Standalone invocation, with controller-owned trusted digests:
99
99
 
100
100
  ```text
101
- node <installed-skill>/scripts/check-minimum-completion.mjs charter.json matrix.json context.json <trusted-charter-sha256> <trusted-context-sha256>
101
+ node <cli-package>/src/orchestrator/delivery/scripts/check-minimum-completion.mjs charter.json matrix.json context.json <trusted-charter-sha256> <trusted-context-sha256>
102
102
  ```
103
103
 
104
104
  Exit 0 is evidence_complete; 1 is evidence_incomplete; 2 means invalid/unavailable
@@ -143,4 +143,4 @@ for purpose, user experience, cross-view consistency, risk-proportionate indepen
143
143
  reviews and explicitly opted-in, identity-aware SQM. These are controller workflow obligations, not fields magically
144
144
  validated by the minimum checker. The CLI gate verifies minimum structured evidence;
145
145
  it does not launch every design review or SQM phase on its own. Standalone hosts
146
- remain responsible for executing this skill and cannot claim an enforced host hook.
146
+ remain responsible for executing this workflow and cannot claim an enforced host hook.
@@ -0,0 +1,203 @@
1
+ # PR closure: SIMY Web / CLI procedure
2
+
3
+ This procedure is loaded by the Web/CLI executor and independent auditor through
4
+ `src/orchestrator/pr-closure.js`. It is not a local Codex skill or a GitHub hook.
5
+ It adds a closure safety gate to the existing delivery workflow, not a new remote
6
+ mutation tool, permission or terminal state. Closing a PR never proves delivery.
7
+
8
+ Flow: scope/authority -> original requirements and exact revisions -> before/after
9
+ table -> real outcome verification -> independent review -> decision -> freshness
10
+ and authority recheck -> authorized close -> remote read-back and durable receipt.
11
+ When blocked, stop the close, not independent authorized investigation. Reuse the
12
+ run's attempt/time/cost limits; do not repeat unchanged failed checks indefinitely.
13
+
14
+ ## 1. Define the scope and reason
15
+
16
+ Record repository/PR, purpose, beneficiary, source requirements and non-goals.
17
+ Distinguish merged, duplicate/fully superseded, transfer to unfinished work, and
18
+ intentional cancellation/retirement. An already merged PR needs its actual merge
19
+ identity verified, not a manual unmerged close. Merge is not deployment.
20
+
21
+ An audit/table request is read-only. Record close and comment-posting authority
22
+ separately; a factual same-PR comment must be covered by explicit authorization
23
+ or governing policy. Otherwise prepare an unposted draft. Do not infer authority
24
+ to merge successors, deploy, delete branches or reopen an already closed PR.
25
+ An existing clear authorization need not be requested twice; a newly discovered
26
+ loss of functionality requires an informed decision on that consequence.
27
+
28
+ ## 2. Freeze requirements and comparison identities
29
+
30
+ Use original requests, acceptance criteria and approved decisions as the oracle,
31
+ not the closing comment or candidate's own tests alone. Reuse stable acceptance
32
+ IDs from the delivery charter. Independently reconcile the original sources with
33
+ the ID list so an omitted requirement cannot disappear before validation.
34
+
35
+ Record full old PR head and merge-base SHAs, current target base, successor and
36
+ companion heads, exact integrated candidate, PR/merge state, build/runtime identity,
37
+ flags, permissions/tenant, environment and observation time. Track deployed state
38
+ separately; never infer it from a branch. Preserve a recoverable reference to
39
+ unmerged source before cleanup. An SHA without retrievable objects is not backup.
40
+
41
+ Keep requested, intended-in-code, observed-in-runtime, absent and unknown distinct.
42
+ An unavailable old environment does not prove a feature never existed. Old missing
43
+ code does not waive an explicit requirement, and labels do not prove old guarantees.
44
+
45
+ ## 3. Persist the before/after table
46
+
47
+ Use [UX behavioral completeness](ux-specification.md) for both sides of the
48
+ comparison. A concise table cell must link to the complete interaction contract;
49
+ do not reduce the comparison to feature labels or omit divergent branches.
50
+
51
+ Use the existing [acceptance evidence](acceptance-evidence.md) and stable IDs.
52
+ Keep separate bound results for each context and link the comparison to them;
53
+ do not overwrite base-only results with combined or live results. Persist outside
54
+ chat and retain failed/pending rows. Minimum comparison columns:
55
+
56
+ | ID / requirement source | Persona, condition, required outcome | Old PR intended / observed | Current base alone | Base + successors | Deployed target | Decision, gap, owner, remediation PR | Evidence |
57
+ | --- | --- | --- | --- | --- | --- | --- | --- |
58
+ | Stable criterion | Trigger, real entry, action, result, next action | Exact revision, evidence level | Exact revision, evidence level | Exact integrated identity | Observed identity or unknown | Retained / approved change / transferred / missing / unknown | Source locations, raw results, artifact hashes, times |
59
+
60
+ For each affected journey cover real navigation, discoverability, first use and
61
+ empty data, flags/roles/ownership; transferred input/context, confirmation, state
62
+ changes, actual execution, usable output and next action; persistence, reload and
63
+ session return, history/sync, privacy and data migration; loading, no-match,
64
+ permission denial, error, cancellation and retry/recovery. Include accessibility
65
+ and device variants when affected. Extra clicks or lost controls may be regressions
66
+ even if an API is unchanged.
67
+
68
+ For workflow products, separately account for existing-workflow reuse, composition,
69
+ conversational design of a saved workflow, immediate ad-hoc work without saving a
70
+ workflow, and background discovery/learning. Explicitly test the no-workflow or
71
+ no-match branch: can the user ask for help, preserve intent, clarify/design/execute
72
+ as required and obtain a usable result? A catalog recommender or background
73
+ learning is not proof of conversational/ad-hoc fallback. Classify each capability
74
+ against authoritative requirements; do not invent an old capability or silently
75
+ exclude one because old code lacked it.
76
+
77
+ Inventory every changed file, including deletions/renames, contracts, flags, tests
78
+ and affected consumers outside the diff. Map each to criteria or a justified
79
+ non-behavioral classification. Trace all requirements forward to proof, removed
80
+ behavior back to retained behavior or approved retirement, and added permissions,
81
+ data collection, automation, costs, defaults or steps back to authorized scope.
82
+ Identical blobs, ancestry and file counts prove accounting, not UX equivalence.
83
+
84
+ ### Yellow/red rows must become remediation PR work
85
+
86
+ Display unresolved partial/changed/unverified outcomes as yellow (🟡), and verified
87
+ missing/regressed outcomes as red (❌). Keep factual behavior, evidence sufficiency
88
+ and approved scope separate; uncertainty alone is not proof of a product defect.
89
+ For every yellow/red row, create a new remediation PR for the required repair or
90
+ verification within the active task's implementation/commit/push/PR authority.
91
+ Group rows only when they form one coherent behavior change; do not mechanically
92
+ create one PR per row or combine unrelated fixes. Use a Draft PR while unfinished.
93
+ Before creation, check existing remediation PRs: reuse an exact open match with
94
+ explicit criterion coverage rather than creating duplicate competing work. A broad
95
+ successor link does not count without that mapping.
96
+
97
+ Record criterion IDs, original PR, observed gap/evidence, required outcome, owner,
98
+ repository/base, tests/E2E and acceptance gates in each remediation PR. Add its real
99
+ URL and state to every covered table row; include dependencies and re-evaluation
100
+ triggers. Evidence-only yellow rows need the missing verification, not speculative
101
+ product changes. An unresolved product choice remains `needs_decision`; do not
102
+ choose a new specification just to open a PR. If implementation or publication is
103
+ unauthorized, blocked or outside the current budget, record a concrete PR plan and
104
+ the missing decision/authority, but do not claim a PR exists. A plan/issue alone
105
+ does not satisfy the requested PR handoff or justify `transfer_ready`.
106
+
107
+ Independent review must reconcile all yellow/red IDs with the actual remediation
108
+ PRs and explicitly named blockers before the original PR can be closed by transfer.
109
+ Creating a PR is not fixing the issue: keep the row non-green until its required
110
+ revision-bound checks pass. Approved changes/retirements may resolve a row only
111
+ with the product decision and applicable safety evidence; preserve its history.
112
+
113
+ ## 4. Verify the actual consumer and independent postconditions
114
+
115
+ Trace normal production entry -> caller -> UI/service -> backend -> persisted
116
+ result -> next user action. Verify actual imports, routes, permissions and flags.
117
+ A surviving component/API used only in fixtures is not a production experience.
118
+ Test the unchanged old candidate where feasible, base alone and exact integrated
119
+ candidate. Inspect the combined behavior, not just mergeability or individual CI.
120
+ Reuse valid bound evidence; do not inflate counts with unnecessary reruns.
121
+
122
+ For browser behavior, use [normal-user verification](chrome-user-verification.md)
123
+ on the complete production-like stack with authorized services and safe fixtures.
124
+ Capture meaningful visible states, errors and correlated technical postconditions
125
+ for the same input/run. Mocked/component E2E, direct API calls and static analysis
126
+ are supporting evidence, not substitutes. Only an exact-runtime live journey proves
127
+ live inheritance. Do not imply that local or merged verification is deployed proof.
128
+ For docs/CLI/library/API work use the actual artifact, command or downstream
129
+ consumer; record why browser checks are inapplicable. Unavailable checks are pending,
130
+ not inapplicable. Never make production writes solely to satisfy this procedure.
131
+
132
+ Preserve initial failures. Classify product, environment and oracle failures with
133
+ independent evidence. Changed assertions/fixtures create a different tested
134
+ candidate and require independent oracle review; do not credit their passes to
135
+ the unchanged original PR. A stale label alone does not explain a missing route.
136
+
137
+ ## 5. Independent review and decision
138
+
139
+ Before the close action, a separate reviewer receives original requirements,
140
+ candidate revisions, complete file inventory, table and raw artifacts, without
141
+ a prescribed verdict. Review omissions, reachability, fallback, integrated results,
142
+ unapproved scope and unfinished dependencies. Record identity-bound findings in
143
+ the existing independent-review receipt. A comment claiming a review occurred is
144
+ not review evidence. Repair only within authority; re-review changed inputs.
145
+ The normal post-execution CLI audit is not a substitute for review before closing.
146
+
147
+ Store these labels in the closure record, not in the delivery-state enum:
148
+
149
+ | Decision | Required evidence and permitted action |
150
+ | --- | --- |
151
+ | `close_ready` | All requirements accounted for, candidate evidence and independent review pass; no hidden loss or pending implementation. State separately whether base-only or live. Deployment may remain an explicit delivery obligation. |
152
+ | `transfer_ready` | Every pending outcome/risk has an accepted owner or authorized assignment, actual open remediation PR with criterion coverage, acceptance gate and re-evaluation trigger; explicit informed administrative-close authorization. No unmapped yellow/red row or unresolved handoff blocker. Not full inheritance/completed delivery. |
153
+ | `retirement_ready` | Explicit product decision retires named outcomes; necessary user-data/migration/safety obligations verified or safely assigned before close. Not equivalence. |
154
+ | `needs_decision` | Lost/changed outcome or trade-off lacks an authoritative human selection; present consequences/options and keep open. |
155
+ | `blocked` | Missing/stale evidence, review, authority, classification or handoff, or unsafe consequence prevents the proposed action/claim. |
156
+
157
+ Unknown/failed applicable rows cannot support `close_ready`. A deliberately
158
+ authorized transfer keeps them non-green and visible. Verify the successor exists,
159
+ is open and carries the actual pending criteria; a link alone is insufficient.
160
+ Do not invent an owner's acceptance. Transfer cannot waive mandatory security,
161
+ privacy, data-integrity or external-contract constraints. Retain the actual highest
162
+ proven delivery state, independently of the closure-task disposition.
163
+
164
+ ## 6. Freshness check, authorized action and read-back
165
+
166
+ Immediately before mutation refresh old head, target base, all successor heads and
167
+ states, integrated identity, checks/review inputs, flags/environment and authority.
168
+ Any changed bound input invalidates affected verification/review under
169
+ [state and receipts](state-and-receipts.md). Inspect and reverify before continuing;
170
+ checking only the old head is insufficient. Use conditional updates if available;
171
+ otherwise read immediately before/after, record residual races and stop on drift.
172
+
173
+ Prepare a factual explanation: reason, exact identities, comparison/evidence/review
174
+ links, approved changes, pending obligations/owners, deployment status and recovery
175
+ reference. Do not say nothing remains if work is unknown or unmerged. Missing close
176
+ authority blocks closing; missing posting authority retains a draft. If policy
177
+ requires a posted explanation, missing posting authority also blocks closing.
178
+
179
+ After an authorized close, read back state, close/merge timestamps and identities,
180
+ any authorized posted explanation, and successor status (open or demonstrably
181
+ resolved). Reconcile ambiguous responses before retrying to avoid duplicate
182
+ actions/comments. On unexpected concurrent changes, preserve evidence and report;
183
+ do not silently reopen or declare success. Audit previously closed PRs read-only,
184
+ separating the historical decision's evidence from today's state.
185
+
186
+ ## 7. Durable receipt and handoff
187
+
188
+ Add a `closure` section to the existing completion/handoff evidence record, reusing
189
+ its run/input digest, idempotency key and append-only rules. Record target/reason,
190
+ decision, comparison/context digests, criterion/file coverage, all non-green rows,
191
+ review and artifact references/hashes, human decisions and separate authorities,
192
+ pre/post state/timestamps, mutation identity, comment ID/URL or unposted draft,
193
+ pending owners/gates/triggers, yellow/red-ID-to-remediation-PR mappings and blocked
194
+ PR plans, and source recovery references. Record unperformed
195
+ actions as unperformed; reconcile retries with the same logical action identity.
196
+ This documented section is not a new automatically validated CLI schema.
197
+
198
+ Preserve the table, relevant raw proof, review and recoverable unmerged source in
199
+ an approved durable location before deleting temporary worktrees. Verify links
200
+ remain accessible and remove secrets/unrelated personal data. Never remove the
201
+ only evidence/source copy. Administrative closure can finish a scoped closure task,
202
+ not unfinished feature delivery. Promise ongoing monitoring only if authorized and
203
+ actually configured; otherwise hand off to the recorded owner/tracking item.
@@ -14,7 +14,10 @@ Persist one controller-owned snapshot with at least:
14
14
  - acceptance-source identities and digests, architecture boundaries, applicable
15
15
  rule decisions, human-decision receipt IDs, approved canonical sources and
16
16
  their precedence and fallback semantics, risk tier, requested/effective
17
- delivery levels, the safety ceiling reason, and chat-confirmation receipt;
17
+ delivery levels, numbering version, safety floor and reason, complete five-level
18
+ comparison with per-level hour estimates and assumptions, recommendation and
19
+ rationale, and chat-confirmation receipt; preserve legacy numbering and record
20
+ verified conversions separately rather than rewriting historical choices;
18
21
  - repository, base SHA, head SHA, companion SHAs, merge SHA, image digests, and
19
22
  deployed revision;
20
23
  - target environments, user journey, user/tenant fixture identities, and
@@ -0,0 +1,98 @@
1
+ # UX specification: behavioral completeness
2
+
3
+ Apply this standard to every UX description across the SIMY Web/CLI delivery loop:
4
+ requirements, As-Is/To-Be, design, implementation mapping, acceptance criteria,
5
+ verification records, reviews, release, before/after comparisons, closure and handoff.
6
+ The quality target is **behavioral completeness and verifiability**, not prose length.
7
+ Expand until no material user-observable behavior must be guessed; stop expanding
8
+ when additional text only repeats or introduces unsupported scope.
9
+
10
+ ## Unit of description and decomposition
11
+
12
+ An **observable interaction unit** describes one coherent transition from a stated
13
+ user context to an observable outcome, including the user's control and the system's
14
+ response. A feature name or a list of implementation components is not such a unit.
15
+ Reuse stable UX/acceptance IDs and link finer units to their parent criterion. Do not
16
+ create a second competing source of requirements or silently replace frozen IDs.
17
+
18
+ Split a unit when the actor, prerequisite, choice, observable state, postcondition
19
+ or recovery obligation differs materially. Also split independently falsifiable
20
+ claims so a partial failure cannot hide inside a broadly passing row. Retain an
21
+ end-to-end criterion joining the units: local completeness does not prove a usable
22
+ journey. Derive the necessary granularity from actual requirements and system
23
+ boundaries, never from a fixed number of screens, steps, rows or words.
24
+
25
+ ## Semantic obligations for every unit
26
+
27
+ Each obligation must have explicit content, a precise reference to shared content,
28
+ or an authoritative non-applicability reason. These are semantic requirements for
29
+ the canonical specification, not additional mandatory fields in the CLI JSON schema.
30
+
31
+ | Obligation | Required description |
32
+ | --- | --- |
33
+ | Actor and intent | Who acts or receives value, what they seek, and how the outcome serves that intent. |
34
+ | Context and preconditions | Relevant prior state, available information, authority and constraints that determine whether and how the experience is possible. |
35
+ | Trigger and reachability | What initiates the unit, how the actor reaches it, and which prerequisite or preceding unit supplies the entry state. |
36
+ | Perception and comprehension | Information and feedback available to the actor, its timing and meaning, and how it communicates current state, consequences and what can happen next. Do not assert a mental state as observed without evidence. |
37
+ | Action, choice and control | Permitted actions, required input, alternatives, decision ownership, confirmation and reversibility where applicable, with their consequences. |
38
+ | System response and transition | Response to each relevant action or event, observable intermediate and terminal states, and applicable timing, ordering and consistency constraints. |
39
+ | Usable outcome and postconditions | What the actor can actually use after the transition, affected state or effects, and the conditions that distinguish complete, partial and unsuccessful outcomes. |
40
+ | Continuation and handoff | Next permitted action or terminal boundary, destination/owner and context retained across the transition. A handoff must identify its receiving preconditions. |
41
+ | Alternatives, failure and recovery | Conditions producing materially different behavior, what the actor perceives, available recovery/control and retained or lost state. A terminal state must be intentional, not an unexplained dead end. |
42
+ | Acceptance oracle and provenance | Requirement source, observable pass/fail predicates, observation method and evidence identity for the same actor/context/revision. Distinguish planned verification from its observed result. |
43
+
44
+ Apply relevant usability, accessibility, privacy, authority and continuity constraints
45
+ to these obligations where they change the experience. Express qualitative requirements
46
+ as observable discriminators; use quantitative thresholds only when grounded in an
47
+ authoritative requirement or an explicitly approved decision. Unspecified values or
48
+ policy remain unknown; never invent them to make the description appear complete.
49
+
50
+ ## Completeness review criteria
51
+
52
+ Use these criteria together, not an average score. A complete description satisfies
53
+ every applicable criterion for its declared scope. A completed form is not proof.
54
+
55
+ | Criterion | Pass condition |
56
+ | --- | --- |
57
+ | Source coverage | Every in-scope user outcome and constraint from the independent acceptance sources maps to identified units; every specified behavior maps back to a source or recorded authorized decision. |
58
+ | Causal continuity | Entry and exit conditions connect across units without an unstated user step, system dependency or context transfer. The complete path reaches a usable outcome or an explicitly justified terminal state. |
59
+ | Branch closure | Each material alternative derived from requirements and actual boundaries has a condition, observable response, consequence and continuation or recovery. Conditions distinguish which response applies. |
60
+ | Control clarity | The actor can determine what they may do, what is automatic, who decides, and the consequences and available reversal of relevant actions. |
61
+ | Observability and falsifiability | An independent verifier can distinguish success, partial success and failure using the stated oracle and evidence method, without inventing expected behavior. |
62
+ | Cross-view consistency | Descriptions of the same intent agree on actors, prerequisites, transitions, authority, outcomes and recovery across all affected surfaces and specification views, or cite an approved difference. |
63
+ | Traceability and freshness | Stable IDs connect source, specification, implementation, checks, observations and unresolved obligations; referenced revisions and context match the claim. |
64
+ | Epistemic separation | Requirements, intentions, observations, assumptions and unknowns are separately identified; lack of evidence is not presented as absence, success or non-applicability. |
65
+
66
+ Perform an **independent reconstruction check**: a reader who did not author the
67
+ implementation must be able to derive the intended interaction and its acceptance
68
+ checks without supplying a material product decision. Review against original
69
+ sources as well as the described units, so omitted behavior cannot pass unnoticed.
70
+ Return gaps by criterion ID, missing obligation, consequence, authoritative question
71
+ or evidence needed, and dependent phase. Do not claim exhaustive coverage beyond
72
+ the declared scope and available sources; disclose unavailable sources and risks.
73
+
74
+ ## Application through the lifecycle
75
+
76
+ | Phase | Required use of the same contract |
77
+ | --- | --- |
78
+ | Discovery and charter | Record known As-Is observations separately from requested outcomes and unknowns; derive coverage and freeze intended behavior before solution-dependent decisions. |
79
+ | Design and implementation | Maintain the source-linked To-Be units and map their obligations to affected paths; inspect dependencies and consistency, without weakening the contract to fit candidate code. |
80
+ | Verification and review | Observe the complete applicable paths and independent postconditions in the same bound context; compare expected and observed behavior unit by unit and end to end. |
81
+ | Repair and scope change | Preserve failed results, record authorized requirement changes and invalidate only affected descriptions/evidence; re-review dependent units and their connected paths. |
82
+ | Release and operation | Identify the target runtime and applicable outcome/guardrail observations; distinguish expected exposure, observed behavior and unresolved operational obligations. |
83
+ | PR closure and handoff | Compare before/after using the same units, retain reachability and recovery detail, map unresolved obligations to authorized remediation work and preserve evidence and ownership. |
84
+
85
+ Persist complete descriptions in the canonical specification and reference their IDs
86
+ from matrices, PRs and receipts. Compact user-facing summaries may omit repetition,
87
+ not material behavior, uncertainty or the link to the full contract. Do not impose
88
+ long transcripts or duplicate the full specification in each progress update.
89
+
90
+ Unknowns are visible work, not a reason to fabricate detail. A material unresolved
91
+ requirement decision blocks dependent design/implementation; a missing runtime
92
+ observation blocks the affected verification or equivalence claim. Discovery and
93
+ independent authorized work may continue. Explicit assumptions retain their source,
94
+ risk and resolution condition; assumption-based behavior cannot be presented as
95
+ verified. Genuine non-applicability needs a reason/source before execution, not a
96
+ post-failure waiver. This is a workflow and independent-review standard; existing
97
+ validators check their documented evidence contracts, not these semantic criteria
98
+ automatically. Do not claim machine enforcement merely because this guide is loaded.
@@ -1,4 +1,4 @@
1
- // Shared by the CLI and the independently installed skill. Keep this module
1
+ // Shared by the CLI and the packaged evidence checker. Keep this module
2
2
  // self-contained so validation never depends on the repository checkout.
3
3
  const cleanString = value => typeof value === "string" ? value.trim() : "";
4
4
  const record = value => value && typeof value === "object" && !Array.isArray(value) ? value : {};
@@ -0,0 +1,19 @@
1
+ import { fileURLToPath } from "node:url";
2
+ import { section } from "./shared.js";
3
+
4
+ export const DELIVERY_LEVELS_PATH = fileURLToPath(
5
+ new URL("./delivery/references/delivery-levels.md", import.meta.url),
6
+ );
7
+
8
+ export function buildDeliveryLevelInstruction({ auditor = false } = {}) {
9
+ return section("delivery_level_contract", [
10
+ `Read the Web/CLI delivery-level contract: ${DELIVERY_LEVELS_PATH}`,
11
+ "Use assurance-ascending-v2: 5 is maximum assurance, 4 protected, 3 balanced, 2 fast, 1 lightest. Higher numbers mean more assurance, not greater task priority. Apply the highest applicable risk/policy floor; never lower mandatory verification or expand authority.",
12
+ "Whenever recommending, confirming or changing a level, present ALL five levels in descending order 5, 4, 3, 2, 1, as a table or clearly separated prose. For EACH show content, verification/review scope, trade-off, task applicability, and task-specific duration in hours. Mark the recommendation and explain its task/risk rationale, even when the user already selected a level; acknowledge a valid selection without asking again. Mark unsafe levels unavailable with reasons; do not hide them.",
13
+ "Estimate numeric lower-to-upper execution and elapsed-hour ranges for the same task scope and endpoint, using observed boundaries, implementation, checks, review, setup, repair and dependency critical path. Separate execution from CI/queue/approval/external waiting; account for parallelism. State assumptions, evidence, uncertainty and confidence. Do not hardcode per-level durations or product examples. Unknown external wait stays explicitly unbounded, with a conditional numeric execution range; never invent a finite total. If execution cannot yet be estimated, show the missing input and discovery step for each affected row and keep the selection packet incomplete pending a defensible range. Explain overlaps or inversions; estimates are not guarantees or permission to skip work.",
14
+ "Record the comparison, estimate basis, recommendation/reason, requested/effective level, numbering version, risk floor and user selection reference in existing charter/decision evidence, not invented CLI API fields. Refresh on material changes. Preserve historical receipts: map verified legacy levels 1→5, 2→4, 3→3, 4→2, 5→1 without changing assurance; clarify ambiguous unversioned selections rather than guessing.",
15
+ auditor
16
+ ? "Remain read-only. Check the actual user-facing comparison and selection evidence, not only this instruction. Report missing levels, scope, estimates, rationale, unsafe effective levels, or ambiguous legacy numbering as findings. This is procedural guidance, not a new deterministic selection validator."
17
+ : "Before material implementation ensure a valid selection and complete comparison are available. Read-only discovery may continue while unresolved; do not substitute a recommendation-only message. This is procedural guidance, not a new deterministic selection validator.",
18
+ ].join("\n"));
19
+ }
@@ -1,4 +1,8 @@
1
1
  import { bullets, cleanString, section } from "./shared.js";
2
+ import { buildPrClosureInstruction } from "./pr-closure.js";
3
+ import { buildUxSpecificationInstruction } from "./ux-specification.js";
4
+ import { buildDeliveryLevelInstruction } from "./delivery-level.js";
5
+ import { buildChecklistContinuationInstruction } from "./checklist-continuation.js";
2
6
  import {
3
7
  COMPLETION_CONTRACT_VERSION,
4
8
  acceptanceCriterionRows,
@@ -19,6 +23,10 @@ export function buildIndependentAuditInstruction(charter, attempt) {
19
23
  : [];
20
24
 
21
25
  return [
26
+ buildUxSpecificationInstruction({ auditor: true }),
27
+ buildDeliveryLevelInstruction({ auditor: true }),
28
+ buildChecklistContinuationInstruction({ auditor: true }),
29
+ buildPrClosureInstruction({ auditor: true }),
22
30
  section(
23
31
  "role",
24
32
  "You are an independent PR auditor. You did not implement this change and must not edit files.",
@@ -1,7 +1,12 @@
1
- import { minimumCharter } from "../codex-plugins/simy/skills/agentic-delivery-loop/scripts/check-minimum-completion.mjs";
1
+ import { minimumCharter } from "./delivery/scripts/check-minimum-completion.mjs";
2
2
  import { bullets, looksLikeUiTask, section } from "./shared.js";
3
3
  import { problemSolvingResultContract } from "./problem-solving.js";
4
4
  import { acceptanceCriterionRows } from "./completion-contract.js";
5
+ import { fileURLToPath } from "node:url";
6
+ import { buildPrClosureInstruction } from "./pr-closure.js";
7
+ import { buildUxSpecificationInstruction } from "./ux-specification.js";
8
+ import { buildDeliveryLevelInstruction } from "./delivery-level.js";
9
+ import { buildChecklistContinuationInstruction } from "./checklist-continuation.js";
5
10
  import { PR_PREPARATION_CHECKS } from "./pr-preparation.js";
6
11
 
7
12
  export function buildCodingInstruction(
@@ -16,6 +21,9 @@ export function buildCodingInstruction(
16
21
  ) {
17
22
  const sections = [
18
23
  section("role", "You are the local coding executor for a SIMY agentic loop."),
24
+ buildUxSpecificationInstruction(),
25
+ buildDeliveryLevelInstruction(),
26
+ buildChecklistContinuationInstruction(),
19
27
  section(
20
28
  "requirement_charter",
21
29
  [
@@ -64,7 +72,7 @@ export function buildCodingInstruction(
64
72
  section("minimum_completion_evidence", [
65
73
  "All delivery levels require this floor. Before implementation reconcile every original requirement and frozen experience with the stable criterion-ID list; report omissions instead of silently dropping them.",
66
74
  "Save a matrix.json under the local evidence root (ui_evidence_root or repository .artifacts). Return delivery_evidence_path in SIMY_RESULT_JSON. A passed flag or tests_run string is not proof.",
67
- "Use check-minimum-completion.mjs from the installed Delivery Loop skill. Its reference minimum-completion.md defines the matrix and structured observation format.",
75
+ `Use the packaged Web/CLI verifier: ${fileURLToPath(new URL("./delivery/scripts/check-minimum-completion.mjs", import.meta.url))}. The contract is ${fileURLToPath(new URL("./delivery/references/minimum-completion.md", import.meta.url))}. No local Codex Delivery Loop skill is required.`,
68
76
  "For each stable criterion ID include real implementation_refs and required user/system evidence. Exercise the actual operation and result, then inspect postcondition and integration independently. For saving, reload/return in a new session and verify stored values and ownership. Document-only work uses the real command/consumer and artifact integrity, not imaginary API/DB checks.",
69
77
  "First evidence artifact per layer must be JSON: {criterion_id, context_sha256, checks}. User checks: operation (expected=true, actual=observed boolean) and result; system checks: postcondition and integration. Each check includes subject, expected and actual. Derive expected values from the original requirement, not from the candidate output. Include screenshots/logs as additional evidence.",
70
78
  "Freeze and bind observations to the current committed revision and charter before verification. Do not rehash old observations to make changed code pass. Use pending/failed for unavailable or mismatching evidence.",
@@ -92,6 +100,7 @@ export function buildCodingInstruction(
92
100
  "Disclose remaining work, intentional skips, uncertainty, and post-merge migration/deploy/monitoring steps without calling them complete.",
93
101
  ].join("\n")),
94
102
  section("must_not", bullets(charter.must_not)),
103
+ buildPrClosureInstruction(),
95
104
  section(
96
105
  "active_request_reconciliation",
97
106
  [
@@ -1,4 +1,4 @@
1
- import { minimumCharter } from "../codex-plugins/simy/skills/agentic-delivery-loop/scripts/check-minimum-completion.mjs";
1
+ import { minimumCharter } from "./delivery/scripts/check-minimum-completion.mjs";
2
2
  import { auditAttempt, evaluatePrReadiness } from "./audit.js";
3
3
  import {
4
4
  buildIndependentAudit,
@@ -5,11 +5,11 @@ import {
5
5
  minimumContext,
6
6
  checkMinimumCompletion,
7
7
  loadMinimumJson,
8
- } from "../codex-plugins/simy/skills/agentic-delivery-loop/scripts/check-minimum-completion.mjs";
8
+ } from "./delivery/scripts/check-minimum-completion.mjs";
9
9
  import {
10
10
  contextDigest,
11
11
  sha256,
12
- } from "../codex-plugins/simy/skills/agentic-delivery-loop/scripts/check-acceptance.mjs";
12
+ } from "./delivery/scripts/check-acceptance.mjs";
13
13
 
14
14
  export function minimumCharterDigest(charter) {
15
15
  return sha256(Buffer.from(JSON.stringify(minimumCharter(charter))));
@@ -0,0 +1,26 @@
1
+ import { fileURLToPath } from "node:url";
2
+ import { section } from "./shared.js";
3
+
4
+ export const PR_CLOSURE_GUIDE_PATH = fileURLToPath(
5
+ new URL("./delivery/references/pr-closure.md", import.meta.url),
6
+ );
7
+
8
+ // Both real executor and independent-auditor instructions use this contract.
9
+ // This is not a GitHub permission hook: external mutations still need authority.
10
+ export function buildPrClosureInstruction({ auditor = false } = {}) {
11
+ return section("pr_closure_gate", [
12
+ "Applies only when proposing, performing or auditing PR closure/supersession/retirement. It does not request closing any PR.",
13
+ `Before a closure decision, read the packaged Web/CLI procedure: ${PR_CLOSURE_GUIDE_PATH}`,
14
+ "Freeze the original outcome criteria and exact old head/base, current target base, successor heads, integrated candidate and deployed identity. Preserve intended, observed and unknown behavior separately.",
15
+ "Persist a criterion-ID before/after table: old PR, current base alone, integrated successors and deployed target. Account for all changed files and unintended added behavior; file counts, ancestry and green CI are not UX equivalence.",
16
+ "For every unresolved yellow/red row, create a new remediation PR within explicit implementation/commit/push/PR authority, grouping only coherent changes. Reuse an exact existing open remediation PR rather than duplicating it. Map every criterion ID to a real PR URL, owner and acceptance tests; a broad successor link or uncreated PR plan is insufficient for transfer_ready. Missing authority, unresolved product decisions or budget blocks remain explicit blockers. PR creation alone never makes a row green.",
17
+ "Verify normal production reachability and the complete trigger-to-usable-result path, with independent technical postconditions and recovery. Code surviving only in fixtures is not inherited UX. Distinguish reuse, composition, conversational design, immediate ad-hoc work and background learning, including the no-workflow/no-match fallback.",
18
+ "Unknown, failed or stale applicable evidence blocks close_ready. Require independent review of original requirements and raw evidence before an authorized close. Preserve initial failures; tests changed to pass do not validate the unchanged original candidate.",
19
+ "Unfinished successors require transfer_ready with explicit informed administrative-close authorization, accepted owner, open tracking and remaining gates; never claim full inheritance. Intentional removal requires an explicit retirement decision and safe data/migration handling.",
20
+ "Re-read all bound revisions, successor state, checks and authority immediately before mutation; changed inputs invalidate affected verification/review. Close and comment-posting authority are separate. Audit-only requests authorize neither.",
21
+ "After an authorized action, read back remote state before claiming success or retrying. Persist pre/post state, review/evidence digests, draft/comment identity, pending obligations and recovery references before cleanup. Do not infer branch deletion, successor merge, deployment or delivery completion.",
22
+ auditor
23
+ ? "You remain read-only. Independently inspect the closure table and raw proof; report gaps as findings. Closure decisions never turn unmet delivery criteria green. Do not close, reopen, comment or repair the PR."
24
+ : "If any required decision, evidence, independent review or authority is missing, stop the dependent close action and report the blocker. This protocol is not authorization and does not introduce a new loop completion state.",
25
+ ].join("\n"));
26
+ }
@@ -88,9 +88,9 @@ export function summarizeCodingLoopEvent(snapshot, event) {
88
88
  };
89
89
  case "pr_ready_for_review":
90
90
  return {
91
- summary: "Implementation is complete, but the PR still needs human review or external evidence.",
91
+ summary: "The run is unfinished: required PR checks, review or evidence still need verification.",
92
92
  result: pendingReasons.length ? `Pending: ${pendingReasons.join("; ")}` : cleanString(event?.message),
93
- next: "Review or approve the PR, then refresh its evidence from Web or CLI.",
93
+ next: "Continue authorized verification, resolve the listed pending gates, then refresh evidence from Web or CLI. Obtain human approval only where required.",
94
94
  };
95
95
  case "merge_ready":
96
96
  return {
@@ -1,6 +1,6 @@
1
1
  import { minimumCharterDigest } from "./minimum-completion.js";
2
- import { minimumContext } from "../codex-plugins/simy/skills/agentic-delivery-loop/scripts/check-minimum-completion.mjs";
3
- import { contextDigest } from "../codex-plugins/simy/skills/agentic-delivery-loop/scripts/check-acceptance.mjs";
2
+ import { minimumContext } from "./delivery/scripts/check-minimum-completion.mjs";
3
+ import { contextDigest } from "./delivery/scripts/check-acceptance.mjs";
4
4
  import { cleanString, stringArray } from "./shared.js";
5
5
  import { normalizeProblemSolving } from "./problem-solving.js";
6
6
  import {
@@ -0,0 +1,20 @@
1
+ import { fileURLToPath } from "node:url";
2
+ import { section } from "./shared.js";
3
+
4
+ export const UX_SPECIFICATION_PATH = fileURLToPath(
5
+ new URL("./delivery/references/ux-specification.md", import.meta.url),
6
+ );
7
+
8
+ export function buildUxSpecificationInstruction({ auditor = false } = {}) {
9
+ return section("ux_specification_contract", [
10
+ `Apply the same behavioral-completeness standard throughout requirements, design, implementation mapping, verification, review, release, closure and handoff. Read: ${UX_SPECIFICATION_PATH}`,
11
+ "Describe observable interaction units, not feature inventories. Reuse stable acceptance IDs. For each unit specify actor/goal, context/preconditions, trigger/reachable entry, perceived information, available action/choice/control, system response/state transition, usable outcome/postconditions, next action/handoff, alternative/failure/recovery paths, and verification oracle/provenance. Treat these as semantic obligations in the existing specification, not new CLI JSON fields.",
12
+ "Decompose when actor, precondition, decision, observable state, postcondition or recovery differs materially, or when any clause could fail independently. Link predecessors/successors and preserve end-to-end criteria. Derive branches and applicable constraints from authoritative requirements and observed system boundaries; do not invent scenarios, defaults, thresholds or product policy to fill gaps.",
13
+ "Description is sufficient only when another implementer can derive the intended behavior and an independent verifier can determine pass/fail without guessing a material requirement. Review source coverage, causal continuity, branch closure, controllability, observability, traceability, consistency and epistemic separation. Word count, row count and verbosity are not quality thresholds.",
14
+ "Keep required/intended/observed/assumed/unknown distinct. Unknown facts stay explicit with affected IDs and resolution evidence; a missing requirement decision blocks dependent design, while missing runtime evidence blocks the affected verification claim. Genuine non-applicability needs a source and reason, not an empty cell.",
15
+ "Persist the complete contract in the canonical specification and link the same IDs from summaries, matrices, PRs and receipts. Summaries may shorten repetition but must not replace or drop behavioral obligations, unresolved gaps or evidence. A phase change revalidates affected descriptions and results; plans never become observed proof by wording alone.",
16
+ auditor
17
+ ? "Remain read-only. Independently derive coverage from original sources, identify any material behavior that still requires guessing, and report affected criterion IDs and required clarification/evidence as findings. Do not infer completeness from filled fields or copied executor claims."
18
+ : "Before dependent implementation, resolve material specification ambiguity within authority or report needs_decision; continue independent work. Before verification or completion, repair missing descriptions/evidence rather than relabeling incomplete UX as complete. This procedural contract does not add automatic schema or GitHub enforcement.",
19
+ ].join("\n"));
20
+ }
package/src/runner.js CHANGED
@@ -532,6 +532,18 @@ async function runLocalCodingRun(
532
532
 
533
533
  markAttachmentsDelivered(run.request.attachments);
534
534
 
535
+ // All collectors and the executor must use the same root. Bind a missing
536
+ // default only after resolving the authorized checkout, including on resume.
537
+ if (!run.snapshot.charter.ui_evidence_root) {
538
+ const evidenceRoot = path.join(repositoryPath, ".artifacts");
539
+ run.snapshot.charter.ui_evidence_root = evidenceRoot;
540
+ run.request.ui_evidence_root = evidenceRoot;
541
+ appendEvent(run.snapshot, run.status, "Local evidence root bound to the verified checkout.", {
542
+ code: "local_evidence_root_bound",
543
+ });
544
+ await updateRun(run, run.status);
545
+ }
546
+
535
547
  const executor =
536
548
  executeAttempt ||
537
549
  ((context) =>
@@ -1,5 +0,0 @@
1
- interface:
2
- display_name: "Agentic Delivery Loop"
3
- short_description: "Converge code changes through real live proof"
4
- default_prompt: "Use $agentic-delivery-loop to take this change from reproduction through verified delivery."
5
-