source-command-pharn-ship-stages
Part of /pharn-ship: the stages it runs after the SPEC is approved, one section each. Not run on its own; use /pharn-ship.
- License 许可
- Apache-2.0
- 所属仓库
- pharn-dev/skills
- 最近更新
- 2026-11-13
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- source-command-pharn-ship-stages
- description
- Part of /pharn-ship: the stages it runs after the SPEC is approved, one section each. Not run on its own; use /pharn-ship.
03 SKILL.md 正文
source-command-pharn-ship-stages
Use this skill when the user asks to run the migrated source command pharn-ship-stages.
Command Template
/pharn-ship — the stages after GATE 1
Part of /pharn-ship (.Codex/commands/pharn-ship.md), which reads this file once — when the run resumes after GATE
1, before the structural backstop that decides whether the SPEC is Approved — under the rule in its ## Step 2 section: this is ## Running a stage,
Step 2 from the backstop on, one ### section per item, and Step 2b. It is not run on its own — if it was invoked as a
command, stop and say so — and it changes nothing about /pharn-ship's trusted prefix, trust rules and human gates,
which still apply. Its ### headings carry the item numbers the text cites: Step 2.7 is "step 7".
Running a stage (6.27.0) — a routed stage runs as a stage agent, requested on its configured model
A stage ROUTE_POLICY routes runs as a Codex subagent — a stage agent — requested on the
model models.stages resolves for it. The model is routed; effort is not: the Agent tool takes no effort, so a
routed stage runs at the effort it inherits. The protocol — the policy table, every inline reason and its
remedy, the stage agent's rules, the closed result — is pharn/floor/stage-agent-core.mjs's header, cited
here, not restated (P4). In this command /pharn-plan, /pharn-grill, /pharn-test and /pharn-build (the
Step 2b re-build too) are routed. /pharn-spec runs inline by policy (it IS GATE 1), and so do
/pharn-regress and /pharn-verify (floor code produces their verdicts, so their model does not change them) — one
stage-direct.mjs call each (the last paragraph below).
Each routed stage in Step 2 carries a start line, a brief prompt and a finish line (6.43.0: start and finish each
do what two lines did), and you run them in this order:
-
The start line (
stage-agent.mjs start). It decides the route exactly asroutedoes, writes the stage-start marker with that token, and prints the token, then the marker line. Branch only on its exit code (P5):-
0— the token isagent:<alias>: run the stage as a stage agent (2, below). -
3— it isinline:<reason>: run the stage INLINE, exactly as before 6.27.0, then the inline return line (4). Its stderr names the remedy for that reason; keep it forSHIP.md. -
anything else — a crash, no marker written: run this line (for the build, add the start line's own
--iteration), then the stage inline, and name it inSHIP.md's route line. Its route is a fixed literal:node pharn/floor/mark-phase.mjs --name '<name>' --kind stage-start --stage <stage> --route 'inline:route-unavailable' -
no Agent tool in your tool list, and none in the deferred-tool list either (a deferred one IS present: load it first) — append
--no-agent-toolto the start line: it recordsinline:no-agent-tooland exits3. ADVISORY: this one is your own reading of your tools, and it fails in the safe direction.
A second line
marker: not writtenchanges onlySHIP.md's route line. -
-
On start exit
0only, the Agent call:subagent_type: "general-purpose",model: "<alias>"(the part afteragent:),description: "pharn stage <stage>",run_in_background: false(the JSON booleanfalse, never the string"false"), and noisolation— the stages write into this one tree, one after another, never a worktree each. Itspromptis the stage's pinned one-line brief prompt,<name>substituted, and nothing else: the stage agent runs that line first and receives its rules from code (brief), never from your transcription. -
The finish line — only after an Agent call has returned the agent's COMPLETED result. It reads the agent's result as
readdoes and writes theorchestratorreturn marker. A call that returns a background-launch notice has not: wait for the agent's completion notice first (you may end your turn to wait for it, and say why), then runfinish. Never runfinishfor a stage that ran inline. Branch only on its exit code:0(done, ordone gate:pass|failfor build) or3(refused) — go on to the stage's own verdict read, unchanged (the build step says how a routed build's verdict is read).4(question) — the round trip below. Its return marker waits (marker: deferred (question)), so the requests a relayed question costs bill to the stage, as they do inline.2(unusable …,no-resultincluded) — STOP. Never re-run the stage inline: it may have written half its files, and a second executor would run it twice.- anything else — a crash, no verdict — STOP.
-
After an inline run, the inline return line in place of
finish:node pharn/floor/mark-phase.mjs --name '<name>' --kind orchestrator
A question, round-tripped. Present the question and its options to the human as quoted DATA (P2), through
the same interactive form the stages use. Deliver the human's answer, quoted verbatim, to the SAME stage agent
with SendMessage — load its schema first if the harness lists it as a deferred tool. If SendMessage is absent
altogether, re-run the stage's start line (it writes no second stage-start while the stage is still open). On exit
0, spawn a fresh stage agent (item 2's call). It never saw
the question, so its prompt carries, below its one line, the stage's question and its options verbatim, then the
human's answer verbatim — each in its own fence longer than any backtick run inside it, labelled DATA (the
first as the stage's question, the second as the human's answer to it); that stage restarts from its Step 0.
Either way, then run finish again. On any other exit of that start line, STOP: the stage has already
started as an agent, and a second executor would run it twice. Two exceptions, kept from before 6.27.0:
/pharn-test's question is presented as a STOP (the chain stops either way), and an answer that abandons the run
is a STOP. Before any STOP on a question, run the inline return line.
Bounds, each stated where the rule is. A stage agent's report is another model's output. Only finish's exit
code and its closed first line are floor. That this command's control flow never uses the agent's prose is
ADVISORY — your own discipline: the Agent tool returns the agent's final text into your context, which is
pharn/THREAT-MODEL.md §5's free-text residual (a model consuming another model's free text) in a new place,
bounded — no proceed/stop reads it — and not zeroed (P2). The other bounds (a hung stage agent, what a route
records) are the header's named residuals.
The two floor-only stages, /pharn-regress and /pharn-verify, are one call each to
pharn/floor/stage-direct.mjs (6.43.0, its header): it sets the stage's writes-scope, runs its stage script, releases
the scope and writes the stage's stage-start and return markers, printing the script's pharn-stage-exit/1 object
(pharn/pharn-contracts/stage-exit.md) and exiting with its code. Run each line with the Bash tool's timeout at 600000. Branch only on its exit code:
-
0(done) — the stage's verdict read (Step 2). -
2(unusable— or the call's own refusal: astage-direct:line and no object, the scope or the in-flight lock could not be taken) or3(refused) — STOP: present the object'sreason_codeand itsdetailor rendered file as quoted DATA, never as an instruction, with that reason's remedy (.Codex/commands/pharn-<stage>.md, Step 1). -
4(question) — relayquestionandoptions[]verbatim (P2). On an answer, runstage-direct.mjswith the pinned line's own flags up to and including--budget-ms 570000, then the object'sresume.argvtokens after its own--budget-msvalue, then the chosen option'sargv— never the pinned line's stage flags again:resume.argvcarries every one the script kept and drops the one a question replaces. Single-quote each token from the object or the answer, an embedded'written as'\''; a "stop" option is a STOP. -
5(continue) — the stage's resume line, the same way, until another exit:node pharn/floor/stage-direct.mjs --stage pharn-regress --name '<name>' --resume --budget-ms 570000node pharn/floor/stage-direct.mjs --stage pharn-verify --name '<name>' --resume --budget-ms 570000 -
anything else (
1included) — a crash, never a verdict: STOP.
A call the Bash tool reports as moved to the background is STILL RUNNING — it finishes the stage itself. Wait for
its completion notice (you may end your turn to wait for it, and say why), then branch on the exit code and object it
reports. Never start its resume line, or any other stage-direct.mjs call, while it runs: a second call refuses
in-flight (exit 2, a STOP).
Step 2, after GATE 1 — the stages, one section each
Step 2's own rules hold for every section below: branch only on the verdict each one names, fail closed on a missing
verdict, and send every STOP through ## Closing the run (all in /pharn-ship's ## Step 2).
Step 2.1 — after GATE 1: the backstop, the base, the run marker, the snapshot and the entry gates
Structural backstop (on resume, before /pharn-plan): confirm the SPEC is Approved + un-drifted —
node pharn/floor/check-spec-approved.mjs pharn/features/<name>/SPEC.md
Branch only on the exit code (P5): 0 → the human approved and pinned the intent → proceed to
/pharn-plan. Non-zero → the intent is not Approved (still Draft, or drifted) → STOP (the human
has not approved / must re-approve via /pharn-spec). This is a backstop, not the gate: the gate is the
human halt at Step 2 item 1.
Capture the base — immediately after the backstop exits 0 (in a --quick run, after its kind read), before
anything is built:
git rev-parse --verify HEAD
Its one printed line is <base sha>: substitute it literally into both /pharn-regress lines (step 6 and Step 2b)
and into the quick scope check (## Quick mode item 7). Run this capture once per run, here, and never again:
a later HEAD may already hold the build, which would put the build inside its own base. If you no longer hold
<base sha> when a regress line needs it (a resumed conversation, a compaction that dropped it), STOP and hand to
the human — never re-capture. Non-zero (no commit to compare against, an unborn HEAD) → STOP before
/pharn-plan, through Steps 3 and 3a like every STOP. Why the base is captured, not derived:
pharn/floor/stage-regress-core.mjs (BASE_SOURCES).
Open the run marker (6.24.0, D3) — immediately after the base capture, before /pharn-plan's own
stage-start marker:
node pharn/floor/run-marker.mjs --open pharn-ship '<name>'
Branch only on its exit code (P5): 0 → proceed to /pharn-plan. Non-zero → STOP before
/pharn-plan: the run could not mark itself open, so in an installed project the write guard's default
between the stages below would be the permissive one. Present the line's run-marker: refusal (it names
the path and the error code — typically a file planted where a pharn/.run/ directory belongs) and hand to the
human. Like every STOP, it goes through Steps 3 and 3a; Step 3a's --close is idempotent.
The marker holds the write guard's fail-closed default standing in an installed project until Step 3a's
close (pharn/floor/run-marker.mjs, header).
Then record the pre-run snapshot, bound to that marker: every changed path with a digest, kept in the git dir,
so /pharn-regress and the quick scope check report a path that still holds those bytes instead of counting it as
this run's escape. It is the tree as it stands at this approval (pharn/floor/pre-run-snapshot.mjs, header):
node pharn/floor/pre-run-snapshot.mjs --capture '<name>'
Non-zero → STOP before /pharn-plan, as for the marker line: present its pre-run-snapshot: refusal and hand to
the human. Like every STOP, it goes through Steps 3 and 3a. Unlike /pharn-loop, this command runs no isolation
check (check-run-isolation.mjs): a person approved its SPEC at GATE 1 and decides at GATE 2, so do not add one by
analogy.
Then start the entry gates (6.42.0) — the gates /pharn-verify will discover, run once on this tree in the
background while /pharn-plan and /pharn-grill work; the read before /pharn-test decides
(pharn/floor/entry-gates.mjs, header):
node pharn/floor/entry-gates.mjs --start --feature '<name>' --timeout-ms 540000
Whatever the exit → /pharn-plan: with no gates, /pharn-verify asks about that, as before, and a start that
failed is reported by the read before /pharn-test, which asks.
Step 2.2 — /pharn-plan
-
/pharn-plan→ writespharn/features/<name>/PLAN.md. Routed (## Running a stage):node pharn/floor/stage-agent.mjs start --command pharn-ship --stage pharn-plan --name '<name>'On start exit
0, the Agent call's whole prompt:Run exactly this line, then follow what it prints: node pharn/floor/stage-agent.mjs brief --command pharn-ship --stage pharn-plan --name '<name>'…or, on exit
3, run the stage inline, then the inline return line. Only after an Agent call has returned:node pharn/floor/stage-agent.mjs finish --command pharn-ship --name '<name>' --stage pharn-plan
/pharn-plan's own first gate
(check-spec-approved.mjs) refuses unless the SPEC is Approved + un-drifted, so if it produced a
PLAN.md, that floor gate passed. Product /pharn-plan has no separate human-approval halt. Proceed
on a produced PLAN.md; fail-closed if /pharn-plan refused (no PLAN.md) → STOP.
Verdict read (FLOOR), BEFORE the grill runs (6.45.0) — /pharn-grill owns TWO deterministic stops, and
BOTH must be read (Quick mode skips this block: ## Quick mode item 4). Reading them first means a RED
plan costs no grill agent. Proceed only when both exit 0; a non-zero from either is a STOP:
node pharn/floor/check-plan-spec-agree.mjs pharn/features/<name>/PLAN.md pharn/features/<name>/SPEC.md
node pharn/floor/check-plan-lessons.mjs pharn/features/<name>/PLAN.md pharn/memory-bank/lessons-learned.md
- chain (
check-plan-spec-agree.mjs) —0→ the plan was made against the current Approved, un-drifted spec → proceed. Non-zero → STOP, present the checker's RED line verbatim as DATA (no grill ran, so noGRILL.mdrecords it, andSHIP.md's pointer to it says "not written"), hand to the human (re-plan via/pharn-plan/ re-approve via/pharn-spec). - lessons (
check-plan-lessons.mjs) —0→ the PLAN'sapplied_lessonsis present, well-formed, every cited id resolves, and every cited id is referenced in the plan body → proceed. Non-zero → STOP, present the RED line verbatim as DATA, hand to the human (re-plan via/pharn-planwith a corrected declaration). A project with nopharn/memory-bank/is unblocked by construction —noneshort-circuits before the file is read — so this is not a new barrier for a fresh install.
Read BOTH exit codes, never just the first. They are separate refusals with separate remedies. Nothing
re-reads them after the grill: its write tools are scoped to GRILL.md (fix #7), but a Bash write to
PLAN.md is not re-checked for lessons before the build (/pharn-build re-checks only the chain) — a
stated bound (pharn/LIMITS.md §6).
Step 2.3 — /pharn-grill
-
/pharn-grill→ writespharn/features/<name>/GRILL.md. Routed (## Running a stage; in Quick mode its start line is## Quick modeitem 4's, and it runs inline):node pharn/floor/stage-agent.mjs start --command pharn-ship --stage pharn-grill --name '<name>'On start exit
0, the Agent call's whole prompt:Run exactly this line, then follow what it prints: node pharn/floor/stage-agent.mjs brief --command pharn-ship --stage pharn-grill --name '<name>'…or, on exit
3, run the stage inline, then the inline return line. Only after an Agent call has returned:node pharn/floor/stage-agent.mjs finish --command pharn-ship --name '<name>' --stage pharn-grill
Its verdict was read BEFORE it ran (the block above its start line), so on return proceed — except that a
grill finish exit 3 (refused) is a STOP here, because no verdict read follows it to catch the refusal. The
interrogation itself is advisory and gates nothing — present its findings' free-text as quoted DATA
(P2), then proceed regardless of what it raised. Never write that the grill verified the plan's lesson
application.
Then read the entry gates (6.42.0), before /pharn-test writes anything a gate reads. The line blocks until the
verdict is in, or for at most its budget (Bash-tool timeout 600000):
node pharn/floor/entry-gates.mjs --wait --feature '<name>' --budget-ms 570000
Branch only on the exit code (P5): 5 → run it again; 0 or 3 → proceed (keep any unattributed ids, and the
mutated gates with their changed_paths, for SHIP.md — regress reports those paths, it does not count them). 4 (a gate red on the tree the run started from), 6 (no gate red, but one not measured: killed at the per-gate timeout, or unable to start), 2 or anything else → present the document's red ids,
its unmeasured entries or its reason_code as DATA and ask, through the interactive form: Stop (a STOP, through Steps 3 and 3a) or
Continue (fixing that gate is the feature, or the human accepts a red or unmeasured verify at GATE 2; keep the ids for
SHIP.md). Never continue without the answer.
Step 2.4 — /pharn-test
-
/pharn-test <name>(6.19.0) → writes each Acceptance Criterion's test into the filesAC-TESTS.mdmaps, runs them before any implementation exists, and records the red run inpharn/features/<name>/AC-TESTS.lock.json— or a bootstrap lock for aspec_kind: test-infraSPEC, or nothing for a legacy SPEC. Routed (## Running a stage):node pharn/floor/stage-agent.mjs start --command pharn-ship --stage pharn-test --name '<name>'On start exit
0, the Agent call's whole prompt:Run exactly this line, then follow what it prints: node pharn/floor/stage-agent.mjs brief --command pharn-ship --stage pharn-test --name '<name>'…or, on exit
3, run the stage inline, then the inline return line. Only after an Agent call has returned:node pharn/floor/stage-agent.mjs finish --command pharn-ship --name '<name>' --stage pharn-test
Verdict read (FLOOR) — the test-stage gate, the same verdict /pharn-build re-reads first thing in its Step 0:
node pharn/floor/check-test-stage.mjs <name>
0 → proceed, and keep the first line's token for SHIP.md (READY test-first / READY bootstrap /
NOT-APPLICABLE legacy-spec). Non-zero → STOP, present the gate's first line (RED <reason>, or UNUSABLE — …
when a checker could not give a verdict), hand to the human. Run here
without --unattended: when a criterion's level has no test runner, /pharn-test ASKS the human whether to run a
test-setup increment first; relay that question as the STOP's presentation. The chain stops either way — /pharn-ship
never starts that setup run itself, and never continues to /pharn-build past a RED gate.
Step 2.5 — /pharn-build
-
/pharn-build→ writes the user's code + a thinpharn/features/<name>/BUILD.md. Routed (## Running a stage):node pharn/floor/stage-agent.mjs start --command pharn-ship --stage pharn-build --name '<name>' --iteration 1On start exit
0, the Agent call's whole prompt:Run exactly this line, then follow what it prints: node pharn/floor/stage-agent.mjs brief --command pharn-ship --stage pharn-build --name '<name>' --iteration 1…or, on exit
3, run the stage inline, then the inline return line. Only after an Agent call has returned:node pharn/floor/stage-agent.mjs finish --command pharn-ship --name '<name>' --stage pharn-build --iteration 1
/pharn-build re-checks
the chain (the 3rd enforcing consumer, after grill and /pharn-test) and the fix #7 writes-scope itself, and HALTs on a RED floor at
its Step 4. Verdict read, ROUTED build (6.27.0, ADVISORY): you did not witness the project gate's exit, so
proceed only on finish exit 0 with the exact first line done gate:pass, and STOP on anything else
(done gate:fail, refused, unusable …). That line is the build agent's report of its own gate — advisory,
never floor — and it is re-confirmed by /pharn-verify's floor .verdict two stages later, which re-runs
the project's gates at HEAD. Verdict read, INLINE build (FLOOR): the exit code of the same deterministic
project gate /pharn-build ran at its Step 4 —
- when building PHARN-shaped capabilities (the dogfood — PHARN builds PHARN), that gate is
node pharn/floor/validate.mjs .(identical to/pharn-dev-ship); - for a general user project, it is the gate discovered the same way
/pharn-buildStep 4 and/pharn-verify's stage script (pharn/floor/stage-verify.mjs, through the runner) discover it — explicit--gates, else the closed allowlist (ALLOWLISTinpharn/floor/gate-run-core.mjs, cited rather than copied) ∩ the project'spackage.jsonscripts, else ask the human (reused, NOT hard-codedvalidate.mjs, P3). The e2e gates in the allowlist are run by/pharn-verify, not by this build gate (pharn/floor/build-gate.mjsleaves them out), and the runner drops the ids the project'spharn.config.jsongates.excludelists (6.36.0) for both.
0 → proceed; non-zero → STOP, present the RED floor, hand to the human. Fail-closed: if
/pharn-build refused before its floor gate (missing PLAN.md/SPEC.md, a plan with no parseable
## Files scope, a RED chain at its Step 2) and so produced no floor exit to read → STOP (the
build did not complete).
Step 2.6 — /pharn-regress
-
/pharn-regress→ writespharn/features/<name>/regression-report.json(+REGRESSION.md). (SKIPPED entirely in Quick mode — see## Quick modeabove. Quick mode runs this stage's scope check itself, from## Quick modeitem 7.) One call (## Running a stage, its last paragraph):node pharn/floor/stage-direct.mjs --stage pharn-regress --name '<name>' --iteration 1 --timeout-ms 540000 --budget-ms 570000 --base '<base sha>'
Verdict read
(FLOOR): that file's .verdict (the check-regress.mjs verdict output verbatim). "no-regressions" →
proceed. "regressions" (a pass→fail flip outside the feature, see .regressions[]) or
"inconclusive" → STOP, present, hand to the human. Fail-closed on a missing file: on a RED chain
/pharn-regress writes only REGRESSION.md (no verdict JSON), so a missing
regression-report.json → STOP (present the RED-chain REGRESSION.md) — a membership test (present ∧
.verdict == "no-regressions"), never a silent proceed. Which stops leave no report, and which can leave an
EARLIER run's report in place, is pharn/pharn-contracts/stage-exit.md's exit table.
Step 2.7 — /pharn-verify
-
/pharn-verify→ writespharn/features/<name>/verify-report.json(+VERIFY.md). Inline by policy (floor-only,## Running a stage): no start line, no Agent call and nofinish— one call to its stage script,pharn/floor/stage-verify.mjs, whose exit you read below:node pharn/floor/stage-direct.mjs --stage pharn-verify --name '<name>' --iteration 1 --timeout-ms 540000 --budget-ms 570000
Verdict read (FLOOR), bound to THIS run (since 6.26.0, stage-verify-script): read that file's .verdict
(the check-verify.mjs output) only when /pharn-verify ended done in THIS run — its line, or its last
resume line, exited 0. Any other ending — 2 (unusable), 3 (refused), an unanswered 4 (question), or a
crash — is a STOP, whatever file is on disk: a refusal (a RED chain, a missing artifact, an unparseable
## Files) writes no verify-report.json, and a stop before the feature slug parses, path-containment, or a
crash can leave an EARLIER run's report in place. On a done exit: "PASS" (every gate green ∧ build complete) → proceed to
GATE 2. "INCOMPLETE" (all gates green and no AC evidence red, but a plan-declared ## Files path is absent, or one
marked (delete) is still present — .completeness.missing[] / .undeleted[] names it; an AC not delivered yet, or an AC gate that could not measure the partial tree,
rides along in .ac_gate) → the single build-completion retry (Step 2b), EXACTLY once. "FAIL" (a real gate
red — offenders in .failing_gates[]; a real failure beats incompleteness, so this is never retried) or
"INCONCLUSIVE" (fail-closed — e.g. a stamp the checker refused, an AC gate that could not measure, or a gate the
runner timed out or could not start, named in .unmeasured_gates[]) → STOP,
present, hand to the human. The advisory verifiers block is NOT a proceed input — a verifier finding never
flips the verdict (fix #3, pharn/ARCHITECTURE.md §7).
Step 2.8 — GATE 2
- GATE 2 — post-verify decision. On a
PASSverify, this is the chain's end./pharn-shippresents the standing verdicts (steps 1–7) + theGRILL.md/REGRESSION.md/VERIFY.md(andBUILD.md) free-text quoted as DATA (P2), +regression-report.json'spre_run_snapshot.unchangedpaths as quoted DATA (changed before this run; reported, not counted as escapes), plus the per-stage token table andcheck-cost-ledger.mjs's verdict from Step 3a (see its presentation rule), then — after writingSHIP.md(Step 3) and emitting the ledger + report (Step 3a) — ends its turn, handing to the human to decide merge / fix / abandon. There is no product/reviewstage: the product spine ends atverify.
Step 2b — The single build-completion retry (INCOMPLETE only; EXACTLY once, no loop)
(In Quick mode the regress re-run and its two markers are SKIPPED — see ## Quick mode item 9 above; the
rebuild and re-verify below run exactly as written, with the kept scope check (item 7) between them.)
Only reachable from a step-7 .verdict == "INCOMPLETE" — every gate is green but the build is
incomplete (a plan-declared ## Files path is absent, or one marked (delete) is still present;
.completeness.missing[] / .undeleted[] names it). This is the
one retryable verify outcome; FAIL and INCONCLUSIVE are never retried. An AC that is merely not
delivered yet, or an AC gate that could not measure the partial tree, does not block it; the retry's re-verify
measures the AC gate again from scratch, and it proceeds only on PASS.
A CRASHED completeness checker never reaches this step. /pharn-verify reports a
check-build-complete.mjs that crashed as unusable child-crashed, before any gate runs and with no report, so step
7 STOPs on it.
The retry, EXACTLY once (a straight-line block with NO back-edge — the ≤1 bound is structural):
-
Re-invoke
/pharn-build <name>(it re-runs its own Step-0 writes-scope + Step-2 hash-chain gates — the rebuild cannot escape the plan's## Filesor build a stale plan, retry or not). The retry is ITERATION 2 — the only way a ship run's markers exceed iteration 1 — so each re-invoked stage is bracketed exactly as in the chain above, with--iteration 2. The re-build is routed like the first build (## Running a stage), and its verdict is read the same way:node pharn/floor/stage-agent.mjs start --command pharn-ship --stage pharn-build --name '<name>' --iteration 2On start exit
0, the Agent call's whole prompt:Run exactly this line, then follow what it prints: node pharn/floor/stage-agent.mjs brief --command pharn-ship --stage pharn-build --name '<name>' --iteration 2…or, on exit
3, run the stage inline, then the inline return line. Only after an Agent call has returned:node pharn/floor/stage-agent.mjs finish --command pharn-ship --name '<name>' --stage pharn-build --iteration 2 -
Re-run
/pharn-regress, then/pharn-verify(the same order, and the same exit handling, as the chain above), each at--iteration 2:node pharn/floor/stage-direct.mjs --stage pharn-regress --name '<name>' --iteration 2 --timeout-ms 540000 --budget-ms 570000 --base '<base sha>'node pharn/floor/stage-direct.mjs --stage pharn-verify --name '<name>' --iteration 2 --timeout-ms 540000 --budget-ms 570000 -
Re-read the two
.verdicts ONCE and branch (P5, deterministic) — the re-verify's.verdictonly when that/pharn-verifyendeddonein THIS run, exactly as at step 7:- re-verify
.verdict == "PASS"∧ re-regress.verdict == "no-regressions"→ proceed to GATE 2. - anything else — still
INCOMPLETE, nowFAIL/INCONCLUSIVE, a regression, or a retry sub-stage that refused / HALTed and produced no freshverify-report.json/regression-report.json(fail-closed on a missing-or-stale post-retry verdict — a proceed is only ever an affirmative floor verdict; the absence of one is a STOP) → STOP, present, hand to the human. There is NO second retry.
- re-verify
<!-- end of pharn-ship-stages -->
04 同仓库更多 Skills
pharn-cli
Operate the PHARN CLI (@pharn-dev/pharn 0.10.0+, best on 0.16.0, with a fallback for 0.9.x) on a project that has PHARN installed. Use when the person asks whether PHARN is up to date, what an update would change, to update it, what is installed, or to add or remove a capability (griller or lens), or when pharn.config.json exists and they mention updating PHARN. When they ask to set up or uninstall PHARN, it tells them how to do it themselves. Read-only checks and a dry-run preview first; never overwrites their edits.
pharn-ci-policy
Draft or check a pharn-ci org policy, the JSON document that pharn-ci 0.4.x to 0.9.x apply over a repository's own settings (0.4.x is the first version that reads one; 0.1.x, 0.2.x and 0.3.x read none) - a coverage floor, test-integrity severities, agent settings and MCP rules, protected paths and size caps for agent pull requests (rules P01 to P14), prompt-injection scan severities and dependency safety. Validates the draft offline with a bundled checker against pharn-ci's policy.v1 schema, then says how to turn it on (the `policy` workflow input - an app policy with id-token write, or file:<path>). Use when the person asks to write, draft, review or validate an org or team policy for pharn-ci, to require a deny rule, forbid a permission or MCP server, or to protect paths from agent PRs. Writes only the policy file asked for, never weakens an existing policy unless asked for that specific change, never touches the accept label. Not for explaining a pharn-ci result (pharn-ci-explain), setting pharn-ci up (pharn-ci-install) or covering lines (pharn-ci-cover).
pharn-ci-install
Add the pharn-ci pull request check (the pharn-dev/pharn-ci GitHub Action) to a repository, writing pharn-ci 0.9.1 (Report v2, with the test-integrity check and dependency safety) and recognising an existing 0.1.x to 0.9.x setup and what upgrading it changes - lcov or Cobertura coverage output from the project's own test run, checked locally the way pharn-ci reads it, a .pharn/ci.yml with the threshold, and a workflow pinned to a full commit SHA with the test-integrity input. Asks before writing a workflow for a repository on a private registry, because dependency safety flags off-registry sources (D05). Use when the person asks to set up, add, install, update or wire in pharn-ci, a diff coverage gate or test integrity for pull requests, including on fork PRs or in an existing CI job. Never uses pull_request_target, never writes a tag pin, asks before installing anything, never creates or applies the accept label, never switches dependency safety off on its own, never commits. Not for explaining a pharn-ci result (pharn-ci-explain), covering reported lines (pharn-ci-cover) or the PHARN CLI (pharn-cli).
pharn-ci-fix
Act on the fix hints of a pharn-ci report (the pharn-dev/pharn-ci GitHub Action or the `pharn-ci check` CLI, 0.9.x, Report v2), where every message and finding carries a `fix` object with a kind (add-test, restore-test, restore-assertion, revert-config, remove-dependency, request-review, split-pr or none), a fixed hint and, on a finding, a target. Lists and checks the fix objects with a bundled helper, then makes the change a kind asks for where an agent may - tests for add-test, and for the restore, revert and remove kinds only the findings the person asks to fix - and hands request-review, split-pr and none to a person. Use when the person asks to fix what pharn-ci reported, act on its fix hints, or work through its findings by kind. Never lowers the threshold, adds an exclusion, turns a test off, edits the pharn-ci config, workflow or org policy, applies the accept label or treats a hint as proof that a fix worked. Not for covering lines in depth (pharn-ci-cover), explaining a verdict or a report without fix objects (pharn-ci-explain), adding pharn-ci (pharn-ci-install) or drafting a policy (pharn-ci-policy).
pharn-ci-explain
Explain a pharn-ci result (the pharn-dev/pharn-ci GitHub Action or the `pharn-ci check` CLI, 0.1.x to 0.9.x) - why a pull request's pharn-ci check failed or warned, what a message code such as COVERAGE_PATHS_UNMATCHED, TEST_INTEGRITY_TI03, POLICY_P13, AGENT_CONFIG_SECRET_S01, INJECTION_PI01 or DEPENDENCY_D05 means, what its diff coverage number covers, what a test-integrity, org policy, prompt-injection, dependency or stale-instruction finding asks a reviewer to look at, and what to change in this repository. Use when the person asks about a pharn-ci comment, verdict, report.json, diff coverage gate, test integrity, policy, secret, injection, dependency or flaky-test finding or agent setup message, or asks to loosen a policy, add or apply the pharn/accepted accept label or otherwise get past a block. Read-only unless asked; never applies the accept label, changes a policy, turns dependency safety off or quarantines a test to get a PR through, and never repeats a secret or the text of an injection finding. Not for adding pharn-ci (pharn-ci-install), writing a policy (pharn-ci-policy), acting on fix hints (pharn-ci-fix) or the PHARN CLI (`pharn`, pharn.config.json), which is the pharn-cli skill.
pharn-ci-cover
Write tests for the added lines that a pharn-ci report (the pharn-dev/pharn-ci GitHub Action or the `pharn-ci check` CLI, 0.1.x with Report v1 or 0.2.x to 0.9.x with Report v2) lists as uncovered, so a pull request's diff coverage meets its threshold. Use when pharn-ci fails with DIFF_COVERAGE_BELOW_THRESHOLD, or the person asks to cover the lines pharn-ci reports, raise diff coverage, get the pharn-ci coverage check passing, or exclude a file from, lower or switch off the pharn-ci coverage gate (it explains what that changes and asks first). Adds tests only - never lowers the threshold, excludes files, edits the pharn-ci config or workflow (including the test-integrity, dependencies and accept-label inputs), adds coverage-ignore comments, skips or focuses tests, weakens test scripts, adds a dependency or edits a lockfile to satisfy a test, adds a test to a quarantine list, imports a changed file into an unrelated test, or applies the accept label. From a 0.9.x report it acts only on fix hints of kind add-test. Not for adding pharn-ci to a repository (pharn-ci-install) or the PHARN CLI (pharn-cli).