Skip to content

fix(lexicon-upgrade): fly op file + composite scope + five-list wiring test - #1226

Merged
lex00 merged 2 commits into
mainfrom
fix-1218-fly-upgrade-wiring
Jul 30, 2026
Merged

lex00 merged 2 commits into
mainfrom
fix-1218-fly-upgrade-wiring

Conversation

@lex00

@lex00 lex00 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Closes #1218.

Every scheduled lexicon-upgrade run since fly joined the matrix (Jul 12) failed with Op "fly-upgrade" not found. Root cause was two gaps: the op file was never created, and the LexiconUpgradeOp composite's IN_SCOPE_LEXICONS — a fifth hand-maintained copy of the lexicon set — also never learned about fly, so the op file alone would still have been rejected at author time.

  • adds ops/lexicon-upgrade/fly-upgrade.op.ts (mirrors the other seven)
  • extends IN_SCOPE_LEXICONS with fly; updates the pinned scope test
  • adds upgrade-wiring.test.ts: matrix == op files, op args match filenames, IN_SCOPE == matrix, rolling ⊆ matrix — the next miswiring fails at PR time instead of three weeks of red crons

Verified: CHANT_UPGRADE_MODE=report chant run fly-upgrade --local completes (HasUpgrade=false vs the committed baseline); temporal suite 335/335.

🤖 Generated with Claude Code

lex00 and others added 2 commits July 29, 2026 22:41
)

Every scheduled run since fly joined the matrix failed with
'Op "fly-upgrade" not found'. Root cause was two gaps, not one:
ops/lexicon-upgrade/fly-upgrade.op.ts was never created, and the
LexiconUpgradeOp composite's IN_SCOPE_LEXICONS list — a fifth
hand-maintained copy of the lexicon set — also never learned about fly,
so the op file alone would still have been rejected at author time.

Adds the op file, extends the scope list, and pins all five lists
together with upgrade-wiring.test.ts: matrix == op files, op files'
lexicon args match their filenames, IN_SCOPE_LEXICONS == matrix, and
every rolling lexicon appears in the matrix. Verified:
CHANT_UPGRADE_MODE=report chant run fly-upgrade --local completes
(HasUpgrade=false against the committed baseline).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lex00
lex00 merged commit fa808db into main Jul 30, 2026
5 checks passed
@lex00
lex00 deleted the fix-1218-fly-upgrade-wiring branch July 30, 2026 05:59
lex00 added a commit that referenced this pull request Jul 31, 2026
`chant dev onboard` adds `@intentius/chant-lexicon-<name>` to the root
package.json dependencies, but fly, forgejo and fountain were never added.
Nine lexicons were listed, three were not, and nothing checked — the same
shape as the lexicon-upgrade miswiring (#1218/#1226) and the publish steps
that stranded two packages.

Nothing broke, because resolution never depended on that list:
`workspaces: ["lexicons/*"]` symlinks every lexicon into node_modules whether
it is listed or not, which is exactly why three omissions survived unnoticed.
The entry is an explicit declaration of what core may import, not the
mechanism that makes the import work.

Complete the list and add lexicon-wiring.test.ts so it either covers every
lexicon or fails. Verified the test catches the real drift by removing
fountain again and watching it go red.

The CI page claimed the dependency was what made workspace resolution work,
and that a lexicon missing from it "fails when loaded by the CLI". Neither is
true. Corrected to describe what the entry is actually for.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JTHr67zuAjGHJAX6gF5tYA
lex00 added a commit that referenced this pull request Jul 31, 2026
…rd stranding a release (#1278)

* fix(ci): publish every workspace package, and stop a missing npm record stranding a release

Every publish run since chant-v0.33.0 has failed. @intentius/chant-k8s-client
(#1177) and @intentius/chant-lexicon-fountain (#1253) each landed a publish
step in publish.yml but neither package ever got an npm trusted-publisher
record, so `npm publish` fell through to ENEEDAUTH while the other twelve
published over OIDC in the same job on the same token. The proof is in the
registry: every chant-lexicon-fly version carries a SLSA attestation, and
those two carry none — they only ever went out by hand. Both are still
stranded, k8s-client at 0.32.0 and fountain at 0.33.0 against 0.33.1
everywhere else, and on chant-v0.33.0 the failure skipped all twelve lexicons
behind it and half-published the release.

Replace the fourteen copy-pasted steps with scripts/publish-packages.sh. It
enumerates every non-private workspace package, so a newly added package is
published the moment it exists rather than waiting on someone to remember the
step. Order is core, then the k8s API client (the k8s lexicon declares it
optional, #1074), then the rest. A package already at its version is skipped,
which keeps re-runs idempotent and makes a partial release recoverable by
dispatching the workflow again. Failures no longer stop the loop; every
package gets its attempt and the run exits non-zero at the end with a summary
table.

On an auth failure — and only an auth failure, never a build error — it
retries with the NPM_TOKEN secret that was already in the repo and unused,
via a throwaway userconfig so the token never reaches the process table. That
is a fallback, not the path: a package with a trusted-publisher record still
publishes over OIDC and never touches the token.

`chant onboard` no longer adds a per-lexicon publish step, since enumeration
makes it unnecessary, and the two docs tables describing it are updated.

Also fix emulator-freshness, red every week since 2026-07-20. `gh issue
create --label chore` failed with "could not add label: 'chore' not found",
and gh declines to create the issue at all when a label is missing, so the
advisory issue was never filed. Create the label idempotently first.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JTHr67zuAjGHJAX6gF5tYA

* fix(ci): name the EOTP case, and stop misreading npm's provenance narration

Dispatching publish on this branch (run 30610577415) proved the script's
control flow and turned up two things the stubbed tests could not.

The trusted-publisher records for chant-k8s-client and chant-lexicon-fountain
are genuinely absent — the OIDC attempt still returns ENEEDAUTH. The token
fallback then authenticated but failed EOTP: the NPM_TOKEN secret is a
classic publish or granular token, not an automation token, so npm demands a
one-time password that no one is present to type. That is indistinguishable
from a permissions problem in the raw log, so say it outright and name both
ways out.

The provenance retry also misfired. It scanned the whole publish output, and
`npm notice` narrates provenance on every run — so an EOTP failure looked
like a provenance rejection and got retried for nothing. Match npm's `npm
error` lines instead, which is what the check meant all along.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JTHr67zuAjGHJAX6gF5tYA

* fix(ci): ask the registry why it refused OIDC, instead of assuming

npm's oidc helper is written never to throw: when the token exchange fails it
logs at verbose level and returns undefined, so `npm publish` falls through to
ordinary auth and reports a bare ENEEDAUTH. That one error covers two very
different situations — no trusted-publisher record at all, versus a record
that exists but does not match this workflow's OIDC claims. The previous
message asserted the first, which is a guess.

Replay the exchange against
/-/npm/v1/oidc/token/exchange/package/<name> and print the registry's own
status and message. Neither the GitHub id-token nor the publish token a
successful exchange returns is ever printed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JTHr67zuAjGHJAX6gF5tYA

* fix(ci): a successful OIDC exchange answers 201, not 200

A controlled probe run from inside publish.yml settled which packages
actually have trusted-publisher records:

  @intentius/chant-lexicon-fly       HTTP 201 accepted
  @intentius/chant                   HTTP 201 accepted
  @intentius/chant-k8s-client        HTTP 404 package not found
  @intentius/chant-lexicon-fountain  HTTP 404 package not found

Same workflow, same ref, same run — so the split is per package, and the two
that fail have no record rather than a mismatched one. Probing from any other
workflow file 404s for all four, since the record is tied to a workflow
filename; that is why the diagnostic lives here and not in a scratch workflow.

The probe also caught a bug in the diagnostic added a commit ago: it treated
only HTTP 200 as success, so a working record would have been reported as
refused. Accept any 2xx.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JTHr67zuAjGHJAX6gF5tYA

* docs(lexicon-authoring): the release page never said to create the npm record

Audited every workspace package's trusted-publisher record from inside
publish.yml, where the workflow filename matches and the answer is therefore
meaningful. Twelve are configured; @intentius/chant-k8s-client and
@intentius/chant-lexicon-fountain are not. Those are exactly the two that
cannot publish.

The reason they were missed is here: the onboarding page walks through every
file `chant dev onboard` patches and every manual step after it, and never
mentions that a new package needs its own trusted-publisher record on npm.
The record is per package, is not inherited from the org, and nothing in the
repo can create it — so a new lexicon ships unpublishable and the failure
surfaces as a bare ENEEDAUTH much later, at release time.

Two further things on that page were simply wrong:

  * It said releases are triggered by pushing a `v*` tag. The workflow matches
    `chant-v*` and `lexicon-*-v*`; a bare `v<version>` tag triggers nothing.
    Point at `just release` / `just release-lexicon`, which push the real tags.
  * It said the workflow passes `--tolerate-republish`. No such flag is used
    anywhere, and npm has no such option. The actual behaviour is the
    skip-if-already-at-this-version check in scripts/publish-packages.sh.
    TESTING.md repeated the same claim in its risk table; corrected there too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JTHr67zuAjGHJAX6gF5tYA

* docs(lexicon-authoring): an onboarding skill an agent can be pointed at

The trusted-publisher step went missing because the knowledge was spread
across a page about what `chant dev onboard` patches, a release section that
was itself wrong, and nothing at all. An author working with an agent had no
single thing to hand it.

Add Lexicon Onboarding Skill: one self-contained ordered checklist from
scaffold through first publish, written to stand alone so an agent pointed at
just that URL can finish the job. It leads with the step nothing in the repo
can automate — creating the npm trusted-publisher record — because that is
the one whose absence merges cleanly and only surfaces at release time.

The overview and CI pages now lead agents into it rather than expecting them
to assemble the sequence from the section.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JTHr67zuAjGHJAX6gF5tYA

* ci(publish): report trusted-publisher coverage on every run

Twice now a package has shipped without an npm trusted-publisher record and
nobody found out until a release went red, because the only symptom is a bare
ENEEDAUTH at publish time. Verifying it by hand means hand-editing publish.yml
each time, since npm matches the record against the workflow FILENAME and a
probe from anywhere else reports every package as missing.

Add an audit job with no `needs:`, so dispatching the workflow puts a coverage
table in the run summary within about forty seconds, well before the test gate
finishes. Informational only — the publish job remains what fails a release.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JTHr67zuAjGHJAX6gF5tYA

* fix(workspace): list every lexicon in the root deps, and gate the list

`chant dev onboard` adds `@intentius/chant-lexicon-<name>` to the root
package.json dependencies, but fly, forgejo and fountain were never added.
Nine lexicons were listed, three were not, and nothing checked — the same
shape as the lexicon-upgrade miswiring (#1218/#1226) and the publish steps
that stranded two packages.

Nothing broke, because resolution never depended on that list:
`workspaces: ["lexicons/*"]` symlinks every lexicon into node_modules whether
it is listed or not, which is exactly why three omissions survived unnoticed.
The entry is an explicit declaration of what core may import, not the
mechanism that makes the import work.

Complete the list and add lexicon-wiring.test.ts so it either covers every
lexicon or fails. Verified the test catches the real drift by removing
fountain again and watching it go red.

The CI page claimed the dependency was what made workspace resolution work,
and that a lexicon missing from it "fails when loaded by the CLI". Neither is
true. Corrected to describe what the entry is actually for.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JTHr67zuAjGHJAX6gF5tYA

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lexicon-upgrade: fly matrix job fails weekly — ops/lexicon-upgrade/fly-upgrade.op.ts was never added

1 participant