devlyn-cli 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +10 -94
- package/CLAUDE.md +7 -160
- package/LICENSE +21 -0
- package/README.md +65 -110
- package/bin/devlyn.js +95 -116
- package/bin/instruction-templates.json +43 -2
- package/bin/instructions.js +29 -8
- package/config/skills/_shared/adapters/claude.md +8 -85
- package/config/skills/_shared/adapters/codex.md +14 -34
- package/config/skills/_shared/adapters/omp.md +1 -11
- package/config/skills/_shared/codex-monitored.sh +4 -54
- package/config/skills/_shared/engine-doctor.sh +18 -58
- package/config/skills/_shared/engine-preflight.md +15 -47
- package/config/skills/_shared/expected-contract.py +242 -0
- package/config/skills/_shared/expected.schema.json +10 -95
- package/config/skills/_shared/invocation-receipt.py +26 -757
- package/config/skills/_shared/platform-support.py +37 -28
- package/config/skills/_shared/role-config.py +100 -421
- package/config/skills/_shared/runtime-principles.md +17 -93
- package/config/skills/_shared/task-complete.py +490 -285
- package/config/skills/_shared/task-completion.md +235 -0
- package/config/skills/devlyn-engines/SKILL.md +9 -11
- package/config/skills/devlyn-ideate/SKILL.md +57 -107
- package/config/skills/devlyn-ideate/references/elicitation.md +18 -99
- package/config/skills/devlyn-ideate/references/loop.md +110 -0
- package/config/skills/devlyn-ideate/references/package-format.md +128 -0
- package/config/skills/devlyn-ideate/scripts/acceptance.py +795 -0
- package/config/skills/devlyn-ideate/scripts/queue.py +1780 -0
- package/package.json +2 -3
- package/config/commit-conventions.md +0 -28
- package/config/skills/_shared/adapters/README.md +0 -74
- package/config/skills/_shared/adapters/grok.md +0 -100
- package/config/skills/_shared/archive_run.py +0 -969
- package/config/skills/_shared/codex-config.md +0 -81
- package/config/skills/_shared/collect-codex-findings.py +0 -505
- package/config/skills/_shared/finish-gate.py +0 -521
- package/config/skills/_shared/grok-anchor-guard.py +0 -78
- package/config/skills/_shared/judge-output-parser.py +0 -200
- package/config/skills/_shared/judge-role-evidence.py +0 -320
- package/config/skills/_shared/phase-prompt-render.py +0 -183
- package/config/skills/_shared/process-evidence.py +0 -926
- package/config/skills/_shared/resolve-bootstrap.py +0 -1410
- package/config/skills/_shared/resolve-stop-hook.py +0 -359
- package/config/skills/_shared/run-bounded.py +0 -58
- package/config/skills/_shared/spec-verify-check.py +0 -5083
- package/config/skills/_shared/state-phase-write.py +0 -5989
- package/config/skills/_shared/terminal-claim-check.py +0 -777
- package/config/skills/_shared/verify-merge-findings.py +0 -3528
- package/config/skills/devlyn-design-ui/SKILL.md +0 -650
- package/config/skills/devlyn-ideate/references/from-spec-mode.md +0 -61
- package/config/skills/devlyn-ideate/references/project-mode.md +0 -80
- package/config/skills/devlyn-ideate/references/spec-template.md +0 -121
- package/config/skills/devlyn-ideate/references/templates/decision.md +0 -48
- package/config/skills/devlyn-ideate/references/templates/roadmap.md +0 -50
- package/config/skills/devlyn-ideate/references/templates/vision.md +0 -44
- package/config/skills/devlyn-queue/SKILL.md +0 -66
- package/config/skills/devlyn-queue/scripts/append.py +0 -94
- package/config/skills/devlyn-resolve/SKILL.md +0 -379
- package/config/skills/devlyn-resolve/references/free-form-mode.md +0 -71
- package/config/skills/devlyn-resolve/references/outer-loop.md +0 -23
- package/config/skills/devlyn-resolve/references/phases/build-gate.md +0 -75
- package/config/skills/devlyn-resolve/references/phases/cleanup.md +0 -33
- package/config/skills/devlyn-resolve/references/phases/implement.md +0 -44
- package/config/skills/devlyn-resolve/references/phases/plan.md +0 -39
- package/config/skills/devlyn-resolve/references/phases/probe-derive.md +0 -261
- package/config/skills/devlyn-resolve/references/phases/surface-close.md +0 -34
- package/config/skills/devlyn-resolve/references/phases/verify.md +0 -310
- package/config/skills/devlyn-resolve/references/state-schema.md +0 -152
- package/config/skills/devlyn-resolve/references/task-completion.md +0 -160
- package/config/templates/prompt-templates.md +0 -71
- package/config/templates/template-feature.spec.md +0 -255
- package/config/templates/template-product-spec.md +0 -680
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# PHASE 4 — CLEANUP (canonical body)
|
|
2
|
-
|
|
3
|
-
The selected IMPLEMENT worker performs code/doc cleanup in its existing invocation before its final checks. The owner then uses the CLEANUP span for generated-artifact removal and invariant checks only; no new model call.
|
|
4
|
-
|
|
5
|
-
<input>
|
|
6
|
-
- Cumulative diff, original spec and immutable PLAN authorized surface.
|
|
7
|
-
- CLEANUP `pre_sha`: tracked source and HEAD must remain unchanged during owner checks.
|
|
8
|
-
</input>
|
|
9
|
-
|
|
10
|
-
<allowlist>
|
|
11
|
-
Within IMPLEMENT and PLAN authorization, you may modify or delete:
|
|
12
|
-
|
|
13
|
-
1. **Tooling artifacts** the spec did not list as deliverables: `test-results/`, `playwright-report/`, `.last-run.json`, coverage HTML output, build artifacts, runtime caches (`__pycache__/`, `*.pyc`, `.cache/`).
|
|
14
|
-
2. **Dead code added by this diff** — symbols (functions, classes, types, exports) introduced by this diff that no other code added by this diff references AND that are not part of the spec's required surface. Pre-existing dead code is out of scope.
|
|
15
|
-
3. **Doc references this diff invalidated** — links / file paths / symbol names in markdown files that this diff renamed or removed. Update only the references; do not rewrite surrounding prose.
|
|
16
|
-
4. **Inline comments** that explain code this diff deleted but the comment still mentions.
|
|
17
|
-
|
|
18
|
-
Files outside this allowlist must not change. Pre-existing tooling leaks (already in main before this run) belong to a future cleanup, not this one.
|
|
19
|
-
</allowlist>
|
|
20
|
-
|
|
21
|
-
<output>
|
|
22
|
-
The owner removes only run-owned untracked/ignored generated artifacts from item 1, preserving deliverables, evidence and recovery inputs. It records PASS when the source checkpoint is unchanged and no cleanup finding remains. A code/doc finding returns through the budget-admitted selected IMPLEMENT repair route and reruns BUILD before fresh VERIFY. Never modify source inside owner CLEANUP or reuse stale checks. Record lifecycle via `state-phase-write.py`.
|
|
23
|
-
</output>
|
|
24
|
-
|
|
25
|
-
<quality_bar>
|
|
26
|
-
- Subtractive-first applies most strongly here. Lines removed should outnumber lines added unless documentation needs a small additive update for a renamed symbol.
|
|
27
|
-
- Do not "improve" code outside the allowlist, even if it looks fixable. The allowlist is the contract.
|
|
28
|
-
- If an artifact / dead symbol / stale doc reference straddles the allowlist (e.g. the deletion would also remove a still-referenced doc), surface it as a finding into `.devlyn/cleanup.findings.jsonl` rather than guessing — the orchestrator will route the conflict to the next budget-admitted round.
|
|
29
|
-
</quality_bar>
|
|
30
|
-
|
|
31
|
-
<runtime_principles>
|
|
32
|
-
Cleanup is the smallest reversible step toward "what shipped equals what the spec licensed."
|
|
33
|
-
</runtime_principles>
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# PHASE 2 — IMPLEMENT (canonical body)
|
|
2
|
-
|
|
3
|
-
Per-engine adapter header is prepended at runtime.
|
|
4
|
-
|
|
5
|
-
<role>
|
|
6
|
-
You execute the plan. Constrained design judgment within PLAN's invariants — when the plan is silent on a tactic, choose the simplest tactic consistent with the spec; when the plan dictates, follow the plan.
|
|
7
|
-
</role>
|
|
8
|
-
|
|
9
|
-
<input>
|
|
10
|
-
- Plan: `.devlyn/plan.md` (file list + risks + acceptance restatement).
|
|
11
|
-
- Source: `pipeline.state.json:source.spec_path` or `criteria_path`.
|
|
12
|
-
- Codebase at `state.base_ref.sha`.
|
|
13
|
-
</input>
|
|
14
|
-
|
|
15
|
-
<output>
|
|
16
|
-
- Code changes implementing every Requirement. Verify with `git diff`.
|
|
17
|
-
- In this same selected worker invocation, remove dead code/comments introduced by this diff and repair references it invalidated, within PLAN authorization and `references/phases/cleanup.md`. Finish before the final checks/checkpoint; no separate cleanup model is dispatched.
|
|
18
|
-
- Tests added or updated for changed behavior. Run the focused development tests needed to establish that behavior; BUILD_GATE and VERIFY own the post-implementation full suite.
|
|
19
|
-
- For every sibling `spec.expected.json.process_evidence[]` item whose `phase` is `implement`, run `python3 "$DEVLYN_SHARED_DIR/process-evidence.py" --devlyn-dir .devlyn run --phase implement --id '<id>'`. The runner must report `expectation_met: true`; cite its manifest path in the phase reply.
|
|
20
|
-
- For each criterion satisfied, set `state.criteria[i].status: "implemented"` with an `evidence` record `{"file": "...", "line": N, "note": "brief"}`.
|
|
21
|
-
- Report your verdict in this reply: `PASS` on success; `BLOCKED` if a criterion cannot be satisfied (missing external dep, blocking ambiguity in the spec) — never silently `pending`. Do not edit `pipeline.state.json` yourself — the orchestrator records it via `state-phase-write.py`.
|
|
22
|
-
</output>
|
|
23
|
-
|
|
24
|
-
<quality_bar>
|
|
25
|
-
- Spec is the contract. The plan is the path. If they disagree, surface the conflict and follow the spec.
|
|
26
|
-
- Bugs: write the failing test first, then fix. Features: follow existing patterns, then write tests. Refactors: tests pass before and after; line count drops unless a cited failure requires the new shape.
|
|
27
|
-
- Do not execute the spec's `verification_commands` in IMPLEMENT; VERIFY MECHANICAL executes those literal commands once after CLEANUP. Declared IMPLEMENT process obligations, including red-first commands, run only through the shared evidence runner above.
|
|
28
|
-
- Tooling-generated artifacts (`test-results/`, `playwright-report/`, `.last-run.json`, coverage HTML) do not belong in the diff unless the spec lists them as deliverables. Configure tools to emit to gitignored paths.
|
|
29
|
-
- Existing tests are contract. Do not replace real HTTP / filesystem / subprocess calls with mocks. Do not skip or disable tests. Do not reduce assertion count on behavior still in scope.
|
|
30
|
-
- Files not in PLAN's list are off-limits. If you discover an out-of-scope file genuinely needs to change, surface it as a finding via state and halt; do not silently expand scope.
|
|
31
|
-
</quality_bar>
|
|
32
|
-
|
|
33
|
-
<runtime_principles>
|
|
34
|
-
Codex-routed phases receive the inlined excerpt:
|
|
35
|
-
|
|
36
|
-
- Subtractive-first: every accretion-shaped change is visible in the commit message or a flagged finding. Net-deletion is the default; pure-addition needs a citation.
|
|
37
|
-
- Goal-locked: implement only the listed Requirements. Adjacent code that "looks fixable" is drift unless the spec or plan listed it.
|
|
38
|
-
- No-workaround: no `any`, no `@ts-ignore`, no silent `catch`, no hardcoded fallback that hides a broken contract, no helper scripts that bypass root cause. Required unavailable engines stop with `BLOCKED:<engine>-unavailable`; they do not downgrade.
|
|
39
|
-
- Evidence: every claim cites file:line you opened. Hallucinated APIs are excluded.
|
|
40
|
-
</runtime_principles>
|
|
41
|
-
|
|
42
|
-
Before declaring the phase complete, re-read each Requirement and confirm an `evidence` record points at the file:line that satisfies it.
|
|
43
|
-
|
|
44
|
-
The task is: [orchestrator pastes the task description and plan context here]
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# PHASE 1 — PLAN (canonical body)
|
|
2
|
-
|
|
3
|
-
The orchestrator reads this body in its existing context; no PLAN worker is dispatched.
|
|
4
|
-
|
|
5
|
-
<role>
|
|
6
|
-
You translate a spec or generated criteria into a concrete plan: the file list to touch, the risks the implementation must navigate, and a verbatim restatement of what acceptance requires. The plan is the contract IMPLEMENT executes against.
|
|
7
|
-
</role>
|
|
8
|
-
|
|
9
|
-
<input>
|
|
10
|
-
- Source: `pipeline.state.json:source.spec_path` (real spec) or `state.source.criteria_path` (`.devlyn/criteria.generated.md`).
|
|
11
|
-
- Codebase at `state.base_ref.sha`.
|
|
12
|
-
- For free-form mode: also `state.complexity` (trivial / medium / large) — informs depth.
|
|
13
|
-
</input>
|
|
14
|
-
|
|
15
|
-
<output>
|
|
16
|
-
Write `.devlyn/plan.md` with three sections:
|
|
17
|
-
|
|
18
|
-
1. **Files to touch** — precede this section with a `<!-- devlyn:authorized-surface -->` sentinel comment on its own line directly above the heading (the machine locator BUILD_GATE uses; the heading text itself is decorative, any language). Explicit list: each entry is a path, change type (`new` / `edit` / `delete`), one-line rationale tied to a specific Requirement. Immediately after the list, emit one fenced ```json block restating just the paths as the mechanical scope contract BUILD_GATE enforces: `{"authorized_surface": ["path/one.ts", "path/two.ts"]}`. An entry may end in `/**` to authorize an entire directory only when the file count is genuinely unenumerable (e.g. a codemod) — this is your scoping judgment, not a mechanism default. List every path from section 1 literally; do not paraphrase or add paths not already decided above.
|
|
19
|
-
2. **Risks** — out-of-scope expansions to refuse, ambiguous spec sections to interpret strictly, known failure modes for this language/framework.
|
|
20
|
-
3. **Acceptance restatement** — verbatim copy of the spec's `## Verification` block (or generated criteria's equivalent). The plan is wrong if any verification command later fails because of a planning oversight.
|
|
21
|
-
4. **Execution phases** — conditional; large work only. Emit this section ONLY when ALL hold: (a) spec frontmatter `complexity: high` (legacy `large`) or `state.complexity == "large"`; (b) the work spans multiple subsystems or more than ~8 files; (c) every phase boundary has at least one runnable gate command. Otherwise emit exactly the three sections above — when in doubt, do not decompose. When emitted: 2-5 `### Phase <k> — <title>` blocks, each with task checkboxes (`- [ ]`), a `gate:` line (1-2 commands, exit-code truth, runnable at that boundary), and the files it owns (a subset of section 1). Definitions are written once here and are the contract; the orchestrator later updates checkboxes as a display mirror only — routing truth lives in `pipeline.state.json`.
|
|
22
|
-
|
|
23
|
-
Record via `state-phase-write.py`: `PASS` if plan is shippable; `BLOCKED` if spec is internally contradictory or cannot be planned without violating constraints. Never hand-edit lifecycle fields.
|
|
24
|
-
</output>
|
|
25
|
-
|
|
26
|
-
<quality_bar>
|
|
27
|
-
- Scope first, then implementation. Decide what files to touch before deciding how to implement. Files not in the list are off-limits to IMPLEMENT.
|
|
28
|
-
- Tooling artifacts and reporter output are not deliverables unless the spec lists them. Plan to configure tools to emit to gitignored paths.
|
|
29
|
-
- Existing tests are contract. Plan to extend them; do not plan to remove or weaken them.
|
|
30
|
-
- Spec frontmatter is read-only; cleanup cannot broaden the task contract.
|
|
31
|
-
- If a Requirement says "match the literal output X", restate the literal in the plan. Paraphrasing the contract here propagates into IMPLEMENT.
|
|
32
|
-
</quality_bar>
|
|
33
|
-
|
|
34
|
-
<runtime_principles>
|
|
35
|
-
- Subtractive-first: prefer trimming an existing helper to introducing a new one. Pure-addition needs a cited prior failure mode or an explicit spec/user requirement.
|
|
36
|
-
- Goal-locked: refuse "while I'm here" cleanups, speculative robustness, mid-flight re-scoping. Single test before any deviation: "did the user ask for this OR does the stated goal strictly require it?"
|
|
37
|
-
- No-workaround: no `any`, no `@ts-ignore`, no silent `catch`, no hardcoded fallback that hides a broken contract, no helper scripts that bypass root cause.
|
|
38
|
-
- Evidence: every claim cites file:line opened at planning time. Vague claims excluded.
|
|
39
|
-
</runtime_principles>
|
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
# PHASE 1.5 — RISK_PROBES (canonical body)
|
|
2
|
-
|
|
3
|
-
Per-engine adapter header is prepended at runtime. This file is engine-agnostic.
|
|
4
|
-
|
|
5
|
-
<role>
|
|
6
|
-
Convert visible verification obligations into executable probes. You are not a
|
|
7
|
-
second planner, critic essay, or debate participant. Your output is JSONL only.
|
|
8
|
-
</role>
|
|
9
|
-
|
|
10
|
-
<input>
|
|
11
|
-
- Source spec or generated criteria.
|
|
12
|
-
- `.devlyn/plan.md`.
|
|
13
|
-
- Codebase read/search at `state.base_ref.sha`.
|
|
14
|
-
- If the spec declares `required_risk_probe_requirements` (a language-neutral
|
|
15
|
-
`{tag, derived_from}` obligation list — see `_shared/expected.schema.json`),
|
|
16
|
-
the orchestrator pastes just that array into this prompt, never the rest of
|
|
17
|
-
`spec.expected.json`. Every `derived_from` value is already an exact
|
|
18
|
-
substring of the visible `## Verification` text you read directly, so this
|
|
19
|
-
exposes nothing hidden. Emit at least one probe per declared entry whose
|
|
20
|
-
`tags` includes that `tag` and whose `derived_from` matches the declared
|
|
21
|
-
value verbatim — BUILD_GATE mechanically checks this coverage.
|
|
22
|
-
</input>
|
|
23
|
-
|
|
24
|
-
<forbidden_input>
|
|
25
|
-
Do not read `spec.expected.json`, `.devlyn/spec-verify.json`,
|
|
26
|
-
`BENCH_FIXTURE_DIR`, benchmark fixture/verifier paths, `.devlyn/*.findings.jsonl`,
|
|
27
|
-
`.claude/skills`, `.codex/skills`, `.agents/skills`, `CLAUDE.md`, `AGENTS.md`, or other harness
|
|
28
|
-
docs unless the orchestrator pasted a specific excerpt into the prompt.
|
|
29
|
-
</forbidden_input>
|
|
30
|
-
|
|
31
|
-
<task>
|
|
32
|
-
Read the visible `## Verification` section. Emit 1 to 3 executable probes
|
|
33
|
-
that cover the highest-risk bullets whose failure would change observable
|
|
34
|
-
behavior. Prefer bullets that combine ordering/priority, rollback/state
|
|
35
|
-
mutation, idempotency, auth/error priority, stdout/stderr, or exact output
|
|
36
|
-
shape. Treat CLI/process errors and HTTP error responses as different contracts:
|
|
37
|
-
CLI errors must prove exit/stderr behavior, while HTTP errors must prove the
|
|
38
|
-
status code and response body. When the visible verification text names concurrent or near-concurrent
|
|
39
|
-
mutations, the probe must overlap the operations and assert the complete
|
|
40
|
-
externally-visible state, not just that every request returned a success code.
|
|
41
|
-
When a batch/import operation must be all-or-nothing, the probe must exercise a
|
|
42
|
-
mixed valid/invalid batch and prove the externally-visible state is unchanged
|
|
43
|
-
after the failure.
|
|
44
|
-
|
|
45
|
-
Do not modify tracked files, and do not pre-implement the candidate fix to prove
|
|
46
|
-
post-fix success. Validate each probe by executing it against `state.base_ref.sha`
|
|
47
|
-
and classify the base outcome: bug-exposing probes fail on base for the asserted
|
|
48
|
-
reason, while preservation/regression probes may pass on base when they exercise
|
|
49
|
-
unchanged behavior.
|
|
50
|
-
|
|
51
|
-
For high-complexity specs with two or more behavior bullets, at least one probe
|
|
52
|
-
must be compound: one command must exercise two or more visible verification
|
|
53
|
-
bullets together. Do not split every risk into isolated one-axis probes.
|
|
54
|
-
|
|
55
|
-
Compound means interaction, not a checklist in one script. If the visible
|
|
56
|
-
verification text includes priority/ordering plus rollback, blocked intervals,
|
|
57
|
-
or failed-operation state, the first probe must be a dominance-loss scenario:
|
|
58
|
-
an earlier lower-priority/input-order entity would succeed alone, a later
|
|
59
|
-
higher-priority entity consumes or blocks the critical resource first, a failed
|
|
60
|
-
or blocked middle entity must not corrupt state, and the assertion must compare
|
|
61
|
-
the complete externally-visible result (accepted/scheduled rows, rejected rows,
|
|
62
|
-
remaining/state rows when present, exit/stdout/stderr).
|
|
63
|
-
|
|
64
|
-
When a verification bullet contains an alternative such as "rejected or moved
|
|
65
|
-
later", the probes must cover both sides when bounded: one case with a later
|
|
66
|
-
valid placement and one case with no later valid placement, where rejection is
|
|
67
|
-
the only correct outcome. Do not test only the easier side of an "or" clause.
|
|
68
|
-
For blocked-interval bullets, include boundary probes where a candidate starts
|
|
69
|
-
exactly at `blocked.start`, ends exactly at `blocked.end`, and has only a
|
|
70
|
-
one-minute overlap. Half-open assumptions must be tested by the command rather
|
|
71
|
-
than left implicit in prose.
|
|
72
|
-
|
|
73
|
-
When a placement algorithm may advance a candidate start past a blocked
|
|
74
|
-
interval or already-accepted entity, include a no-later-valid case where the
|
|
75
|
-
advanced start would exceed the active availability/window bound. The expected
|
|
76
|
-
result must reject that entity. A probe is too weak if every advanced candidate
|
|
77
|
-
still has enough room after the advance; that misses window-bound recheck bugs.
|
|
78
|
-
|
|
79
|
-
When a verification bullet names `remaining`, inventory, stock, balances, or
|
|
80
|
-
state after failures, assert the full externally-visible state. Rows with zero
|
|
81
|
-
quantity do not represent remaining availability; a probe that checks remaining
|
|
82
|
-
state should fail if zero-quantity rows are emitted unless the visible spec
|
|
83
|
-
explicitly requires zero rows. For all-or-nothing rollback, include a later
|
|
84
|
-
entity that can succeed only if the failed entity returned every tentative
|
|
85
|
-
allocation.
|
|
86
|
-
|
|
87
|
-
When visible bullets combine priority ordering, all-or-nothing rollback,
|
|
88
|
-
single-resource or single-warehouse constraints, choice ordering such as FEFO,
|
|
89
|
-
and `remaining` output, prefer one compound probe over isolated checks. The
|
|
90
|
-
probe must include: a lower-priority input-first entity that loses because a
|
|
91
|
-
higher-priority entity consumes stock first; a middle entity that tentatively
|
|
92
|
-
allocates at least one line/lot and then fails another line; a later entity that
|
|
93
|
-
can succeed only if that failed entity rolled back; a single-resource constraint
|
|
94
|
-
case where total cross-resource stock would be enough but no single allowed
|
|
95
|
-
resource is enough; and full expected `remaining` output sorted exactly as the
|
|
96
|
-
visible spec says, with zero-quantity rows absent unless explicitly required.
|
|
97
|
-
For all-or-nothing allocation probes, the failed middle entity must not be
|
|
98
|
-
pre-rejected by a whole-order availability shortcut. It must allocate a scarce
|
|
99
|
-
first line from mutable state, then fail a later line because that SKU/resource
|
|
100
|
-
is absent or otherwise impossible under the visible contract. The later entity
|
|
101
|
-
must request the same scarce first-line SKU so the probe proves rollback by
|
|
102
|
-
observable success, not by internal reasoning.
|
|
103
|
-
|
|
104
|
-
Each probe must run entirely from the worktree with standard shell/Node/Python
|
|
105
|
-
tools already present in the repo. For multiline probes, write a script under
|
|
106
|
-
`.devlyn/probes/<id>.<ext>` and set `cmd` to invoke it (rules below). Probe
|
|
107
|
-
commands must not call external network APIs or write to external
|
|
108
|
-
memory/telemetry services.
|
|
109
|
-
</task>
|
|
110
|
-
|
|
111
|
-
<output>
|
|
112
|
-
Write `.devlyn/risk-probes.jsonl`. Each line is one JSON object:
|
|
113
|
-
|
|
114
|
-
```json
|
|
115
|
-
{"id":"P1","derived_from":"verbatim substring from ## Verification","cmd":"shell command","exit_code":0,"stdout_contains":[],"stdout_not_contains":[],"tags":["ordering_inversion"],"tag_evidence":{"ordering_inversion":["input_order_would_choose_wrong_winner","asserts_processing_order_result"]}}
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
Rules:
|
|
119
|
-
- `derived_from` must be an exact substring of the visible `## Verification`
|
|
120
|
-
bullet that the command directly exercises. For `error_contract`, use the
|
|
121
|
-
invalid-input/stderr/JSON-error/exit-2 bullet, not a generic test-runner
|
|
122
|
-
bullet.
|
|
123
|
-
- `tags` is required. Use only these shape tags:
|
|
124
|
-
`ordering_inversion`, `boundary_overlap`, `prior_consumption`,
|
|
125
|
-
`rollback_state`, `positive_remaining`, `stdout_stderr_contract`,
|
|
126
|
-
`error_contract`, `http_error_contract`, `auth_signature_contract`,
|
|
127
|
-
`idempotency_replay`, `concurrent_state_consistency`,
|
|
128
|
-
`atomic_batch_state`, `shape_contract`.
|
|
129
|
-
- `tag_evidence` is required and must be a JSON object keyed by tag, never a
|
|
130
|
-
top-level array. For these tags, include every listed evidence marker in the
|
|
131
|
-
tag's array and make the command actually exercise it:
|
|
132
|
-
- Do not emit a shape tag unless the visible `## Verification` text names that
|
|
133
|
-
kind of risk and the command exercises it. In particular, `boundary_overlap`
|
|
134
|
-
is only for visible blocked-interval/window/overlap boundary semantics; do not
|
|
135
|
-
use it for inventory, warehouse, or generic resource constraints.
|
|
136
|
-
- `ordering_inversion`: `input_order_would_choose_wrong_winner`,
|
|
137
|
-
`asserts_processing_order_result`.
|
|
138
|
-
- `boundary_overlap`: `starts_at_blocked_start`, `ends_at_blocked_end`,
|
|
139
|
-
`one_minute_overlap`.
|
|
140
|
-
- `prior_consumption`: `same_resource_consumed_first`,
|
|
141
|
-
`later_entity_fails_or_reroutes`.
|
|
142
|
-
- `rollback_state`: `failed_entity_tentative_state_absent`,
|
|
143
|
-
`later_entity_uses_released_state`.
|
|
144
|
-
- `positive_remaining`: `asserts_full_remaining_state`,
|
|
145
|
-
`zero_quantity_rows_absent`.
|
|
146
|
-
- `stdout_stderr_contract`: `asserts_named_stream_output`.
|
|
147
|
-
- `error_contract`: `asserts_error_payload_or_stderr`,
|
|
148
|
-
`asserts_nonzero_or_exit_2`.
|
|
149
|
-
- `http_error_contract`: `asserts_http_error_status`,
|
|
150
|
-
`asserts_error_payload_body`.
|
|
151
|
-
- `auth_signature_contract`: `asserts_signature_over_exact_bytes`,
|
|
152
|
-
`asserts_tampered_or_missing_signature_rejected`.
|
|
153
|
-
- `idempotency_replay`: `first_delivery_then_duplicate`,
|
|
154
|
-
`duplicate_id_rejected_regardless_of_body`.
|
|
155
|
-
- `concurrent_state_consistency`: `overlapping_mutations_exercised`,
|
|
156
|
-
`all_successful_responses_reflected`, `distinct_identifiers_asserted`.
|
|
157
|
-
- `atomic_batch_state`: `mixed_valid_invalid_batch`,
|
|
158
|
-
`asserts_store_unchanged_after_failure`,
|
|
159
|
-
`asserts_success_order_and_distinct_ids`.
|
|
160
|
-
- `shape_contract` when the visible text names exact keys, fields, row
|
|
161
|
-
shapes, JSON objects, response bodies, stdout/stderr objects, or exact error
|
|
162
|
-
bodies: `uses_visible_input_key_names`,
|
|
163
|
-
`asserts_visible_output_key_names`, `asserts_no_unexpected_output_keys`.
|
|
164
|
-
If it names an exact JSON error object/body, also include both
|
|
165
|
-
`visible_text_names_exact_json_error_object` and `asserts_exact_error_object`.
|
|
166
|
-
Tags not listed here may use an empty evidence list or be omitted from
|
|
167
|
-
`tag_evidence`.
|
|
168
|
-
- `cmd` must not reference `BENCH_FIXTURE_DIR`, `verifiers/`, benchmark fixture
|
|
169
|
-
paths, hidden oracle files, external URLs, or files outside the worktree.
|
|
170
|
-
Localhost URLs are allowed only when the visible verification command needs a
|
|
171
|
-
local server.
|
|
172
|
-
- `cmd` may invoke `.devlyn/probes/<id>.<ext>`; the script is part of the
|
|
173
|
-
replayed probe and obeys the same hidden-path/external-URL rules as `cmd`.
|
|
174
|
-
- A probe may declare `timeout_sec` from 1 through 600 when the exercised
|
|
175
|
-
verification legitimately needs more than the default 60 seconds.
|
|
176
|
-
- Match the spec's visible input and output key names literally; do not invent
|
|
177
|
-
aliases such as `stock` for `lots`, `order_id` for `id`, or `warehouse_id`
|
|
178
|
-
for `warehouse`.
|
|
179
|
-
- When a verification bullet names exact keys, fields, row shapes, JSON object
|
|
180
|
-
shape, or an exact error body, the probe must use `shape_contract` and assert
|
|
181
|
-
exact key sets with parsed JSON/deep equality. A substring check is too weak:
|
|
182
|
-
the command must fail on aliased keys, missing keys, and extra keys.
|
|
183
|
-
- For cart/pricing specs whose visible verification covers duplicate combining,
|
|
184
|
-
multiple line-promotion types, tax, coupon, and shipping, the compound success
|
|
185
|
-
probe must include interleaved duplicate SKUs plus taxable and non-taxable
|
|
186
|
-
items, then assert the full output object and item rows. Use `shape_contract`
|
|
187
|
-
for this probe unless the command also proves the required
|
|
188
|
-
`ordering_inversion` evidence markers.
|
|
189
|
-
- Empty output is invalid when this phase is enabled. If no bounded executable
|
|
190
|
-
probe can be derived, write one JSONL object whose command exits nonzero and
|
|
191
|
-
whose `derived_from` names the blocking verification bullet; BUILD_GATE will
|
|
192
|
-
surface the inability as a concrete failure instead of silently proceeding.
|
|
193
|
-
- No prose, no Markdown, no summaries, no alternate plan.
|
|
194
|
-
</output>
|
|
195
|
-
|
|
196
|
-
<quality_bar>
|
|
197
|
-
- Executable beats rhetorical. A risk that cannot become a bounded command does
|
|
198
|
-
not belong in this artifact.
|
|
199
|
-
- Keep probes small. They are BUILD_GATE obligations, not a replacement for the
|
|
200
|
-
full test suite.
|
|
201
|
-
- Coverage over cleverness: mirror the verification bullet literally before
|
|
202
|
-
inventing an edge case.
|
|
203
|
-
- If a probe passes while an implementation processes entities in input order
|
|
204
|
-
instead of the required priority/order, or emits extra zero-value state rows,
|
|
205
|
-
the probe is too weak.
|
|
206
|
-
- If priority/order appears in the visible contract, at least one probe must
|
|
207
|
-
carry `ordering_inversion`.
|
|
208
|
-
- If blocked intervals, forbidden windows, or overlap appear in the visible
|
|
209
|
-
contract, at least one probe must carry `boundary_overlap`.
|
|
210
|
-
`boundary_overlap` is not satisfied by a generic overlap case. The same
|
|
211
|
-
probe must assert a candidate starting exactly at the blocked interval start,
|
|
212
|
-
a candidate ending exactly at the blocked interval end, and a one-minute
|
|
213
|
-
overlap case with no later valid placement.
|
|
214
|
-
- If the domain has both windows/availability and conflicts that can push a
|
|
215
|
-
candidate later, at least one probe must assert the pushed candidate is
|
|
216
|
-
rejected when the pushed start plus duration no longer fits inside the same
|
|
217
|
-
window. The full expected output must exclude that row from scheduled/accepted
|
|
218
|
-
output and include the required rejection reason.
|
|
219
|
-
- If accepted operations reduce stock/state/availability for later operations,
|
|
220
|
-
at least one probe must carry `prior_consumption`: a later lower-priority or
|
|
221
|
-
later-submitted entity must fail or reroute only because an earlier accepted
|
|
222
|
-
entity consumed the exact resource/lot/slot.
|
|
223
|
-
- If a visible contract has all-or-nothing rollback plus `remaining`, at least
|
|
224
|
-
one probe must carry both `rollback_state` and `positive_remaining`; it must
|
|
225
|
-
prove the rollback by a later successful entity and by the final remaining
|
|
226
|
-
rows, not just by the rejected order reason.
|
|
227
|
-
- If `remaining` state appears in the visible contract, at least one probe must
|
|
228
|
-
carry `positive_remaining` and assert that zero-quantity/zero-value rows are
|
|
229
|
-
absent unless the visible spec explicitly requires them.
|
|
230
|
-
- If webhook signatures, raw-body signatures, HMAC, or `X-Signature` appear in
|
|
231
|
-
the visible contract, at least one probe must carry
|
|
232
|
-
`auth_signature_contract` and prove exact-byte signature verification plus a
|
|
233
|
-
tampered or missing signature rejection.
|
|
234
|
-
- If replay, duplicate delivery, same id, already-seen ids, or idempotency
|
|
235
|
-
appear in the visible contract, at least one probe must carry
|
|
236
|
-
`idempotency_replay` and cover first delivery followed by duplicate rejection,
|
|
237
|
-
including the case where the duplicate body would otherwise fail validation
|
|
238
|
-
when the spec says duplicate wins.
|
|
239
|
-
- If an HTTP status error such as `400`, `401`, `409`, or `422` appears with a
|
|
240
|
-
JSON error body, error object, or named error field, at least one probe must
|
|
241
|
-
carry `http_error_contract` and assert both the exact status code and parsed
|
|
242
|
-
response body. Do not use CLI `error_contract` for these HTTP-only checks
|
|
243
|
-
unless the visible text also names process exit or stderr behavior.
|
|
244
|
-
- If concurrent, close-together, simultaneous, parallel, race, lost update, or
|
|
245
|
-
many-at-once mutation semantics appear in the visible contract, at least one
|
|
246
|
-
probe must carry `concurrent_state_consistency`. It must trigger overlapping
|
|
247
|
-
mutations, then compare every successful response against the final
|
|
248
|
-
externally-visible state and assert the identifiers are distinct. Do not use
|
|
249
|
-
this tag for ordinary batch success cases that only require distinct ids.
|
|
250
|
-
- If a batch/import contract says one valid plus one invalid item fails while
|
|
251
|
-
the later state remains the same as before, or otherwise says all-or-nothing /
|
|
252
|
-
no partial updates / 0 inserts on failure, at least one probe must carry
|
|
253
|
-
`atomic_batch_state`. It must execute a mixed valid/invalid batch, assert the
|
|
254
|
-
store/list is unchanged after failure, and include an all-valid success case
|
|
255
|
-
proving order and distinct ids.
|
|
256
|
-
</quality_bar>
|
|
257
|
-
|
|
258
|
-
<runtime_principles>
|
|
259
|
-
The discipline here is: visible contract
|
|
260
|
-
in, executable obligation out. Hidden oracle leakage is a blocker.
|
|
261
|
-
</runtime_principles>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# PHASE 2.5 — SURFACE_CLOSE (canonical body)
|
|
2
|
-
|
|
3
|
-
<role>
|
|
4
|
-
Audit and repair the frozen post-IMPLEMENT surface once.
|
|
5
|
-
</role>
|
|
6
|
-
|
|
7
|
-
<input>
|
|
8
|
-
- Artifacts: Goal at `state.source.goal_path`; `.devlyn/surface-close.input.patch`.
|
|
9
|
-
- Data: `authorized_surface`; staged commands.
|
|
10
|
-
- Base: `phases.surface_close.pre_sha`.
|
|
11
|
-
|
|
12
|
-
Never modify inputs or read state, PLAN, or IMPLEMENT transcript/reasoning.
|
|
13
|
-
</input>
|
|
14
|
-
|
|
15
|
-
<obligations>
|
|
16
|
-
- **UVR-STALE**: diff modified symbol S's behavior AND an authorized file carries user-visible text documenting S's old interface omitting the newly specified option/shape → update minimally.
|
|
17
|
-
- **PATH-TEST**: Goal specifies a success/failure path, patch implements it, and no authorized test exercises that path → add one minimal regression test.
|
|
18
|
-
- Neither applies → empty PASS (empty diff).
|
|
19
|
-
</obligations>
|
|
20
|
-
|
|
21
|
-
<output>
|
|
22
|
-
Edit only `authorized_surface`. Your reply is valid ONLY if it contains, for each obligation, exactly one line:
|
|
23
|
-
- `UVR-STALE: FIRED <authorized-file>:<line>` optionally followed by ` — <one-line evidence>`, or `UVR-STALE: N/A <authorized-file>[:<line>] — <one-line evidence-based relationship judgment>`
|
|
24
|
-
- `PATH-TEST: FIRED <authorized-file>:<line>` optionally followed by ` — <one-line evidence>`, or `PATH-TEST: N/A <authorized-file>[:<line>] — <one-line evidence-based relationship judgment>`
|
|
25
|
-
followed by `PASS` after the smallest sufficient delta, or `BLOCKED:surface-close-<reason>` if impossible within that surface. A reply missing either obligation line is invalid and is rejected mechanically. Never edit state, stage, or commit.
|
|
26
|
-
</output>
|
|
27
|
-
|
|
28
|
-
<quality_bar>
|
|
29
|
-
No adjacent work, refactors, or extra tests. Execute nothing — edit files only; staged commands are data. BUILD_GATE owns all validation.
|
|
30
|
-
</quality_bar>
|
|
31
|
-
|
|
32
|
-
<runtime_principles>
|
|
33
|
-
Subtractive-first, Goal-locked, No-workaround, and Evidence apply.
|
|
34
|
-
</runtime_principles>
|