From 8f48e1bdf3b9eeb9b6daff6fc37342f05822b8fb Mon Sep 17 00:00:00 2001 From: Steve Juma Date: Tue, 17 Nov 2026 20:33:07 +0000 Subject: [PATCH] Wire the Node-only specification publisher into shared completion observation Retain the existing verified tag publisher and no-Lapis-input graph while adding the pinned read-only completion caller. Keep an independent normal test for the no-update shape so a future Lapis dependency addition requires actual intake qualification. Focused callback tests, normal check/spec/runtime/architecture lanes, workspace and Node tests, build and publint pass. Record pre-existing development advisory findings without changing the lockfile or introducing an exception, release intent or synthetic dependency. --- .github/workflows/dependency-completed.yml | 17 ++++++++ package.json | 2 +- spec/records/2026-11-17-shared-completion.md | 37 ++++++++++++++++ spec/src/architecture.md | 12 +++++ spec/src/verification.md | 1 + tests/dependency-completion.test.ts | 46 ++++++++++++++++++++ 6 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/dependency-completed.yml create mode 100644 spec/records/2026-11-17-shared-completion.md create mode 100644 tests/dependency-completion.test.ts diff --git a/.github/workflows/dependency-completed.yml b/.github/workflows/dependency-completed.yml new file mode 100644 index 0000000..f19fba6 --- /dev/null +++ b/.github/workflows/dependency-completed.yml @@ -0,0 +1,17 @@ +name: Notify dependency completion +on: + workflow_run: + workflows: [Check] + types: [completed] +permissions: + contents: read + actions: read + pull-requests: read +jobs: + notify: + if: github.event.workflow_run.conclusion == 'success' + uses: lapismd/dependency-automation/.github/workflows/completion.yml@92e3e55d174498916c134f950850e1d572656cab + with: + automation-ref: 92e3e55d174498916c134f950850e1d572656cab + secrets: + app-private-key: ${{ secrets.LAPIS_DEPENDENCY_APP_PRIVATE_KEY }} diff --git a/package.json b/package.json index e2d0e0d..7e62b03 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "check:architecture": "tsx ./scripts/check-architecture.ts", "check:architecture:baseline": "tsx ./scripts/check-architecture.ts --write-baseline", "test:node": "node --import tsx --import ./src/test-setup.ts --test 'src/**/*.spec.ts'", - "test:architecture": "node --import tsx --test ./tests/architecture.test.ts", + "test:architecture": "node --import tsx --test ./tests/architecture.test.ts ./tests/dependency-completion.test.ts", "test:workspace": "node --import tsx --test ./packages/workspace-tools/src/workspace-tools.test.ts", "test:all": "pnpm run test:workspace && pnpm run test:architecture && pnpm run test:node", "test": "pnpm run build && pnpm run test:all", diff --git a/spec/records/2026-11-17-shared-completion.md b/spec/records/2026-11-17-shared-completion.md new file mode 100644 index 0000000..846901c --- /dev/null +++ b/spec/records/2026-11-17-shared-completion.md @@ -0,0 +1,37 @@ +# Shared completion adoption + +SV-ARCH-010 retains the existing Node-only Check workflow and tag/OIDC publisher. +There are no Lapis npm dependency inputs in the public root or private workspace +manifest. No synthetic Core pin, Changesets job, package bump or publication is +introduced. The functional no-input contract test blocks an unqualified future +Lapis dependency addition even when bot specification checks are exempted. + +The completion caller pins implementation/policy92e3e55d174498916c134f950850e1d572656cab, +registered in coordinator74. Only successful Check workflow399280612, PR/push, +can provide a hint; source permissions are contents/actions/PR-read and only the +existing explicit App key is passed. No candidate checkout, artifact/cache, +source execution or self-trigger occurs. The existing publisher notifier still +follows actual provenance verification. Existing secret/variable names were +verified without key retrieval, copying or rotation. Hosted read probe and +post-merge completion/no-update reconciliation remain pending. + +The new callback test first failed once because the caller was absent; both +focused cases pass after adding it. All normal checks, architecture/runtime +boundaries, Node/workspace tests, canonical specification, build and publint +pass. Two initial canonical-form diagnostics and a wrapped-bullet diagnostic +were corrected without changing enforcement. Source/runtime exports and the +registry dependency graph are unchanged. + +Fresh full audit separately records13 pre-existing development-tool findings +(2LOW/4MODERATE/7HIGH), including unfixed picomatch; production audit is clean. +These were not introduced by this workflow slice and are not suppressed. A +compatible tooling-refresh trial did not resolve them; it was discarded, +retaining the original lockfile and declared dependencies. Remediation belongs +to the tracked repository follow-up; this source grants no exception. The +existing required Check workflow has no audit lane, and that gate is unchanged. + +The operator requests a final merge pass and gives standing post-merge +activation approval after passing source acceptance. An eligible repository +with no Lapis inputs must report an honest no-op; this does not prove a new +release branch or authorize a fabricated update. Any actual future dependency +intake still needs source qualification and every applicable gate. diff --git a/spec/src/architecture.md b/spec/src/architecture.md index 27179e1..cc83c7c 100644 --- a/spec/src/architecture.md +++ b/spec/src/architecture.md @@ -156,3 +156,15 @@ The verified release tarball lives under `.release/`; artifact upload explicitly Configured doctor discovery is extracted into the bounded `doctor-files` command module. The original doctor module's counted-line budget decreases; the public Node CLI/build/runtime contract remains unchanged. + +## SV-ARCH-010 — Shared dependency completion + +**Requirement.** The repository MUST use the reviewed immutable coordinator callback only for +its successful existing Check workflow while preserving the tag/OIDC publisher. + +### Acceptance details + +- The callback MUST pass only the existing explicit App secret and matching implementation/policy pins, with read-only source permissions and no candidate checkout, cache, artifact or self-trigger. +- The existing verified npm notifier MUST remain after provenance acceptance; this adoption MUST NOT create a version job, release tag or publication. +- The root and private workspace tool currently consume no Lapis npm dependency; a normal functional test MUST fail if that no-update shape changes, requiring source-owned intake qualification before a dependency writer is admitted. +- Activation MAY follow source merge and successful checks under standing operator approval; ordinary reconciliation MUST report an honest no-op while no eligible dependency exists, without manufacturing release intent. diff --git a/spec/src/verification.md b/spec/src/verification.md index 8afac90..a189b41 100644 --- a/spec/src/verification.md +++ b/spec/src/verification.md @@ -9,6 +9,7 @@ | SV-GOV-005 | Implemented | `src/validators/book.ts`; `src/validators/qmd.ts`; `.gitignore` | | SV-GOV-006 | Implemented | `AGENTS.md`; `src/validators/governance.ts` extras | | SV-GOV-007 | Implemented | `AGENTS.md`; portable published dependency policy | +| SV-ARCH-010 | In progress | Source-owned completion contract test; pinned caller; hosted callback/no-update acceptance pending | | SV-ARCH-001 | Implemented | `package.json` bin; linked-bin CLI regression; `src/config.ts` | | SV-ARCH-002 | Implemented | `src/tracked-files.ts` | | SV-ARCH-003 | Implemented | `src/types.ts`; `src/commands/validate.ts` | diff --git a/tests/dependency-completion.test.ts b/tests/dependency-completion.test.ts new file mode 100644 index 0000000..04f71f4 --- /dev/null +++ b/tests/dependency-completion.test.ts @@ -0,0 +1,46 @@ +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import { test } from "node:test"; +const read = (file: string) => + readFileSync(new URL("../" + file, import.meta.url), "utf8"); +test("Spec Validator remains a no-Lapis-input publisher until explicit intake qualification", () => { + for (const file of [ + "package.json", + "packages/workspace-tools/package.json", + ]) { + const manifest = JSON.parse(read(file)); + for (const section of [ + "dependencies", + "devDependencies", + "optionalDependencies", + "peerDependencies", + ]) + assert.deepEqual( + Object.keys(manifest[section] ?? {}).filter((n) => + /^@(?:lapismd|lapis-notes)\//.test(n), + ), + [], + ); + } +}); +test("completion source is read-only, pinned, successful and cannot load candidate code", () => { + const source = read(".github/workflows/dependency-completed.yml"); + assert.match(source, /workflows: \[Check\]/); + assert.match(source, /github.event.workflow_run.conclusion == 'success'/); + const pin = /completion.yml@([a-f0-9]{40})/.exec(source)?.[1]; + assert.ok(pin); + assert.match(source, new RegExp(`automation-ref: ${pin}`)); + assert.match( + source, + /contents: read\n actions: read\n pull-requests: read/, + ); + assert.match( + source, + /app-private-key: \$\{\{ secrets.LAPIS_DEPENDENCY_APP_PRIVATE_KEY \}\}/, + ); + assert.doesNotMatch( + source, + /secrets: inherit|actions\/checkout|actions\/cache|download-artifact|: write/, + ); + assert.equal((source.match(/Check/g) ?? []).length, 1); +});