fix(cli): render the provision command as a YAML block scalar - #220
Conversation
b114e50 to
4890d90
Compare
|
Reviewed this and pushed two commits to the branch (
All three indent
Nothing in the suite failed when the block scalar was reverted; it stayed at the same pass/fail count either way. CONTRIBUTING asks that a change to generated YAML be covered by a test that parses and exercises the rendered workflow rather than checking text alone, so the test runs the real installer for three provision shapes — none detected (the Asserting the parsed value rather than only that parsing succeeded is deliberate: it also catches a future rendering change that escapes or mangles the command quietly.
Verification: all eight workflows parse across all three provision shapes; One thing deliberately left out, filed as #269: the command is also interpolated raw into the On your "deliberately not included": agreed that |
…erer
packages/core/src/render.ts renders the same templates as the CLI from its
own variable map, and that map carried PROVISION_CMD but not PROVISION_RUN.
Since the templates now interpolate the provision command through a block
scalar, core emitted a literal "{{PROVISION_RUN}}" where the CLI emits the
command, so the two renderers disagreed and every workflow core produced
carried an unsubstituted placeholder.
The byte-for-byte parity test caught it, which is what it is for. It was
failing before this branch added anything — at 4890d90 on facility-codex.yml,
and after the remaining three templates were converted on
facility-address-review.yml, which merely sorts earlier. It went unseen
because CI does not run on a fork pull request until a maintainer approves it.
provisionRun mirrors the CLI's implementation exactly, alongside the copy of
checksRun already kept in step the same way.
The parity test now runs three provision shapes instead of one: an ordinary
command, a command containing ": ", and no command at all so both sides take
the ": "-bearing fallback. The old single shape could only catch a raw
placeholder; the new ones also catch a future divergence in how either
renderer escapes or indents the command. All three fail if PROVISION_RUN is
removed again.
Addresses: CI minimum-node and verify on theam#220
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LyXT6m6npUH46VBuY1mPGM
|
CI ran on this branch for the first time — a fork PR's checks stay
Worth being clear that this was not introduced by the extra templates — it fails at your Same defect; converting the other three templates only changed which file sorts first. I also widened that parity test from one provision shape to three — an ordinary command, one containing Verification: Two notes for whoever merges:
|
|
CI approved and re-run on
That is repo-wide and already owned by #267 ("floor browserslist at 4.28.7 for today's advisories"). #245's The branch still wants that update anyway: |
facility-crew.yml and facility-codex.yml were unparseable on any repository where init detected no provision command, so neither agent trigger ran: facility-crew.yml:196:27: could not parse as YAML: mapping values are not allowed in this context [syntax-check] The command is interpolated into a bare scalar, and the no-provision fallback text contains "facility: ". Any provision command containing ": " breaks the same way, e.g. 'docker compose up -d && echo "db: ready"'. Rendered into a block scalar, matching what checksRun already does for the checks list. Message text is unchanged; only its YAML context is. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…kflow The block scalar landed in facility-crew.yml and facility-codex.yml, but init renders the same interpolation into three more workflows, which kept the bare scalar and so kept the bug: facility-review.yml:51 facility-address-review.yml:64 facility-doctor.yml:112 A default `facility init --yes` on a repository where no provision command is detected still produced three workflows GitHub cannot parse — the fallback text contains "facility: ", and the colon-space ends the scalar: FAIL facility-address-review.yml: mapping values are not allowed here FAIL facility-doctor.yml: mapping values are not allowed here FAIL facility-review.yml: mapping values are not allowed here All three sites indent `run:` by eight spaces exactly like the two already fixed, so PROVISION_RUN applies unchanged. Addresses: review finding — packages/cli/templates/workflows/*.yml Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LyXT6m6npUH46VBuY1mPGM
CONTRIBUTING requires that a change to generated YAML be covered by a test that parses and exercises the rendered workflow rather than checking text alone. Nothing failed when the block scalar was reverted, so the fix was unprotected: the suite stayed at 94 pass / 3 pre-existing fail either way. The test runs the real installer into a temporary repository for three provision shapes — none detected (the ": "-bearing fallback), a command containing ": ", and an ordinary command — parses all eight rendered workflows, and asserts the parsed Provision step's `run` round-trips the command it was given. Reverting the block scalar fails it with "facility-address-review.yml must parse as YAML". Asserting the parsed value, not just that parsing succeeded, is what stops a future rendering change from escaping or mangling the command quietly. `yaml` is added as a root devDependency. It was already in the lockfile as a transitive dependency at the same version, so no new package enters the tree, and being a devDependency it leaves the CLI's no-runtime-dependency rule for what it vendors into adopter repositories untouched. Addresses: review finding — packages/cli/test/init.test.mjs (absent coverage) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LyXT6m6npUH46VBuY1mPGM
…erer
packages/core/src/render.ts renders the same templates as the CLI from its
own variable map, and that map carried PROVISION_CMD but not PROVISION_RUN.
Since the templates now interpolate the provision command through a block
scalar, core emitted a literal "{{PROVISION_RUN}}" where the CLI emits the
command, so the two renderers disagreed and every workflow core produced
carried an unsubstituted placeholder.
The byte-for-byte parity test caught it, which is what it is for. It was
failing before this branch added anything — at 4890d90 on facility-codex.yml,
and after the remaining three templates were converted on
facility-address-review.yml, which merely sorts earlier. It went unseen
because CI does not run on a fork pull request until a maintainer approves it.
provisionRun mirrors the CLI's implementation exactly, alongside the copy of
checksRun already kept in step the same way.
The parity test now runs three provision shapes instead of one: an ordinary
command, a command containing ": ", and no command at all so both sides take
the ": "-bearing fallback. The old single shape could only catch a raw
placeholder; the new ones also catch a future divergence in how either
renderer escapes or indents the command. All three fail if PROVISION_RUN is
removed again.
Addresses: CI minimum-node and verify on theam#220
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LyXT6m6npUH46VBuY1mPGM
d2393e1 to
f46e46e
Compare
|
Rebased onto
The The rebase replayed all four commits with no conflicts, even though Verified locally after the rebase before pushing: PR is now Still open and deliberately not fixed here: #269, the shell-quoting truncation in |
Closes part of #217.
facility-crew.ymlandfacility-codex.ymlare unparseable on any repository whereinitdetects no provision command, so neither agent trigger ever runs:The command is interpolated into a bare scalar (
run: {{PROVISION_CMD}}), and the no-provision fallback text containsfacility:. The colon-space ends the scalar.This is not limited to the fallback — any provision command containing
": "breaks identically:Change
Render the command into a block scalar, matching what
checksRunalready does for the checks list — including for strings containing::error::. The message text is unchanged; only its YAML context is.Verification
actionlinton both rendered templates across three cases: no provision command, a command containing": ", and an ordinary command. Clean in all three; the first two fail onmain.node guards/run.mjsclean.Deliberately not included
Having
doctorparse the workflows it generated would have caught this, and would close the whole class rather than this instance —doctor --run-guardscurrently reports "Everything checkable checks out" on a repository whose primary workflow cannot be parsed. That is a larger change and I would rather agree the approach first. Detail in #217.