Uh oh!
There was an error while loading. Please reload this page.
fix(plugin-auth): declare plugin-hono-server and put the published example in a tsc program - #11008
Conversation
…ample in a tsc program `packages/plugins/plugin-auth/examples/basic-usage.ts` — published by `content/docs/permissions/authentication.mdx` as "Basic Auth Example" — imports `@objectstack/plugin-hono-server`, which this package declared in none of its dependency blocks, so the example could not resolve, compile or run for anyone who copied it (TS2307 at 12,34). Declaring the dependency alone would have been unverifiable: `tsconfig.json` selects `src/**/*`, so `examples/` was in no tsc program at all. A non-emitting sibling `tsconfig.examples.json` named in the `typecheck` script now compiles it, on the `packages/spec` / `packages/objectql` precedent. It type-checks clean under inherited strictness, so the directory graduates out of UNCHECKED_SOURCE_DEBT with zero debt recorded — which RECONCILED forces. Part of #10869 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PnJHU45vPJj5UQrxe946Bx
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 11 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 32560319985 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Uh oh!
There was an error while loading. Please reload this page.
Fixes#10869
packages/plugins/plugin-auth/examples/basic-usage.tsline 12 importsHonoServerPluginfrom@objectstack/plugin-hono-server, andpackages/plugins/plugin-auth/package.jsondeclared that package in none ofdependencies,devDependenciesorpeerDependencies. It declareshono,which is a different package. So the example could not resolve, compile or run
for anyone who copied it.
Reproduced first, on this tree
The card measured the failure at
main @ 5886ee6d22and the tree has moved, soit was re-measured at merge base
163a16241with the dependency closure built,through the program this PR adds:
Same file, same line, same column as the card. The identical invocation after
the fix:
a first run the same command also reported
basic-usage.ts(13,28): error TS2307for
@objectstack/plugin-authitself. That is the unbuilt-closure artifact, not afinding — the example self-references its own package, which resolves through
dist/index.d.ts, and that package had not been built. Building it removed thesecond error and left exactly the one above.
typecheck-workspaceinlint.ymlbuilds
@objectstack/plugin-authbefore runningtypecheck(confirmed byturbo run build --filter='./packages/*' --filter='./examples/*^...' --dry=json,which lists
@objectstack/plugin-auth#build), so the self-reference resolves inCI. It is left resolving through
distrather than repointed with apathsblock: that would be a partial, unledgered paydown of a different shrink-only
registry (
check:type-source-resolution, where this package is one of 51registered entries), and half-paying a ratchet is worse than not touching it.
Which repair, and the measurement that chose it
The card names two and declines to pick. Measured, they separate cleanly:
content/docs/permissions/authentication.mdx:1284links it under "Completeworking examples are available in the repository" as "Basic Auth Example".
Deleting it breaks a live docs link and removes a reference readers are being
sent to.
plugin's own class docblock (
src/auth-plugin.ts): "Server mode(HonoServerPlugin active): Registers HTTP routes at basePath". The two
packages are at the same version (17.1.0), and
plugin-hono-serverexportsHonoServerPluginwithHonoPluginOptions.port?: number— exactly what theexample passes.
compile above measures, under inherited
strict:ObjectKernel,use(),bootstrap(),getService(),shutdown(),HonoServerPlugin({ port }), andevery
AuthPluginOptionskey it passes (secret,baseUrl,databaseUrl,providers[],plugins{organization,twoFactor,passkeys,magicLink},session{expiresIn,updateAge},registerRoutes,basePath).Nothing here reads as stale. Repair 1 — declare the dependency — and the example
stays a working reference.
The other half: repair 1 alone would have been unverifiable
tsconfig.jsonselectsinclude: ["src/**/*"], and a manifest edit does notchange an
include. After a bare manifest edit the example would still compilein no program,
pnpm typecheckwould still ignore it, and the only evidencefor the fix would be that the right package name was typed.
So the directory now has a program:
packages/plugins/plugin-auth/tsconfig.examples.json,a non-emitting sibling named in the package's
typecheckscript. That is thein-tree precedent, not a new shape —
packages/spec/tsconfig.scripts.json(#5475)and
packages/objectql/tsconfig.scripts.json(#10756) are the same file for thesame reason, and
check-type-check-coverage.mjsnames the sibling as the remedyin its own header. A sibling rather than widening
tsconfig.jsonbecause thatconfig emits (
rootDir: "src",outDir: "dist"): widening it would putexamples/in front of the emit,rootDirwould reject it, andtsupwouldstart shipping the example. Strictness is inherited and not relaxed.
The
UNCHECKED_SOURCE_DEBTentry — deleted because the directory is read nowThis PR is the widen-the-program case, so the entry must go, and the gate
said so before it was touched rather than after:
The entry is gone, and the header records the graduation so
SEEDED AT 10cannotbe read as "still 10". The directory graduates with zero debt recorded
anywhere — it type-checks clean, so there was nothing to write down. The ratchet
shrank because the thing was repaired, which is the only reason it is allowed to:
10 directories → 9.
Ablation — prediction written before mutating
Predicted, in writing before the mutation: removing the devDependency line and
re-installing turns the program RED, exit 2, with exactly one error —
examples/basic-usage.ts(12,34): error TS2307: Cannot find module '@objectstack/plugin-hono-server' ….Direction predicted as a straight red, not a count change and not a reversal,
because the widened program compiles the file unconditionally and only the
resolution is being removed.
Observed: exit
2, exactly that one error, exactly that line.Both legs ran
pnpm install, because the thing being ablated is the pnpmworkspace symlink rather than a
dist/artifact — a manifest edit alone leavesthe symlink in place and the mutated leg would have stayed green, which is the
manifest-layer form of an unrebuilt ablation. Each leg proved the symlink's state
before reading tsc:
LINK ABSENTon the mutation leg,LINK PRESENTon therestore leg.
Restore proved byte-identical:
Why
devDependenciesand notdependenciesCounter-check, with the positive control run first so the instrument is proven
on the corpus before its silence is read as evidence: the exact pattern that finds
the import in
examples/finds nothing insrc/.A first attempt at this used a regex whose own positive control came back empty —
the bracket expression
[^\n]*excludes the literaln, so it matched nothing.That run was not measured and is not quoted here; the control is what caught
it. Three
plugin-hono-serverstrings do exist insrc/, and all three arecomment prose, inspected line by line rather than counted.
filesships onlydist,README.mdandCHANGELOG.md, so nothing new reachesa published tarball. No cycle:
plugin-hono-servernamesplugin-authin none ofits dependency blocks.
Gates
Union derived on the final commit
a144502c, clean tree,node scripts/pm/dispatch-gates.mjswith no path arguments (5 paths vs mergebase
163a16241; exit 0). Every exit code captured before any pipe. All 20 derivedfamilies plus
check:published-filesandcheck:nul-bytes, added by judgmentbecause a
package.jsonand a new tsconfig were edited — class #10309 is live andthe derivation is known short. The derivation did not name either of those two.
All green (
EXIT=0):check:changeset-gate-self-tests,check:cross-package-test-inputs,check:entry-guard,check:objectui-changeset,check:override-consistency,check:parse-guard,check:slot-lookup,check:test-source-alias,check:type-check-coverage,check:type-check-debt,check:type-source-resolution,check-adr-0087-registration,check-changeset-fixed,check-changeset-no-major,check-ci-filter-parity,check-empty-changeset,check-osv-exemptions,check-plugin-teardown-shape,check-affected-docs,check:published-files,check:nul-bytes.Their own verdict lines, quoted rather than inferred from
$?:check-type-check-coverage: OK — 65/78 workspace packages type-checked (plus the root), 13 in the DEBT ledger …check-type-check-coverage --re-measure: OK — 33 ledger entr(ies) re-measured in 381.0s, 1908 raw tsc error(s) total, none above its recorded number.check-type-source-resolution OK — 77 packages with a tsconfig.json scanned; 51 registered as still resolving a workspace dep's types through 'dist/'.check-nul-bytes: OK (scanned 6357 text file(s) … no raw ASCII control bytes).check:type-check-debtfirst exited 1 with--re-measure cannot run: 30 workspace dependenc(ies) … have no built type entry point on disk. That is a refusal, not ameasurement — nothing was checked. The closure was built exactly as
lint.ymldoes (
turbo run build --filter='./packages/*' --filter='./packages/*/*', 70/70successful) and the gate re-run to the green verdict quoted above.
Package suite, script name echoed so a zero-match cannot read as a pass:
Left alone deliberately
check:type-check-debtreports@objectstack/plugin-auth: TEST_DEBT records 109, tsc now reports 97 (-12) -- the entry can be lowered.That surplus is the standingone tracked in #10615, it pre-dates this branch, and this PR touches no test and no
srcfile.--lowerwas not run: that ledger is not this card's to move.Generated by Claude Code