From f307761d1890480fb8bf7842f3b559abf6f49129 Mon Sep 17 00:00:00 2001 From: Cynrath <85012225+Cynrath@users.noreply.github.com> Date: Tue, 17 Nov 2026 19:56:41 +0300 Subject: [PATCH 1/6] docs: verify live Context7 and Docs7 distribution --- docs/guides/context7-docs7.md | 2 +- ...ntext7-ownership-and-docs7-distribution.md | 56 +++++++++++++++++-- ...d-patch-publication-and-public-surface-.md | 40 ++++++++++++- 3 files changed, 89 insertions(+), 9 deletions(-) diff --git a/docs/guides/context7-docs7.md b/docs/guides/context7-docs7.md index 051e912..4592ab2 100644 --- a/docs/guides/context7-docs7.md +++ b/docs/guides/context7-docs7.md @@ -19,7 +19,7 @@ By default, an owned Context7 library may say **Config source: Configuration is Avoid switching blindly: existing dashboard exclusions may differ from the repository file. The repository config intentionally indexes maintained feature docs and the README, not archived tasks or generated content. Leave **Index every version, old ones too** disabled unless historical-version docs are explicitly required. -Never commit Context7 API tokens, npm credentials or other secrets. If this library is ever unclaimed by an owner, use the [official claim process](https://context7.com/docs/howto/claiming-libraries) only then. +Never commit Context7 API tokens, npm credentials or other secrets. If this library is ever unclaimed by an owner, use the [official claim process](https://context7.com/docs/howto/claiming-libraries) only then. Copy the exact per-library `url` and `public_key` from that library's **Claim Library** dialog in the owner's Context7 panel; never invent a key or reuse another library's challenge. Existing ownership needs no new challenge. ## 3. Apply for the verified badge diff --git a/docs/tasks/active/TASK-0097-context7-ownership-and-docs7-distribution.md b/docs/tasks/active/TASK-0097-context7-ownership-and-docs7-distribution.md index 025d5e6..f6a3180 100644 --- a/docs/tasks/active/TASK-0097-context7-ownership-and-docs7-distribution.md +++ b/docs/tasks/active/TASK-0097-context7-ownership-and-docs7-distribution.md @@ -1,7 +1,7 @@ --- id: "TASK-0097" title: "Context7 ownership-ready configuration and Docs7 documentation distribution" -status: blocked +status: active schemaVersion: 2 dependencies: [] createdAt: "2026-10-15" @@ -36,11 +36,11 @@ Expose the maintained ACKit documentation to Context7 and prepare Docs7 hosting ## Acceptance criteria -- [ ] Repository metadata and exclusions match official Context7 schema. -- [ ] Docs7 schema and navigated paths match actual docs; existing pages remain source of truth. -- [ ] Claim instructions require exact per-library public key from the owner's Context7 panel. -- [ ] Existing hosting and released package identities are unchanged. -- [ ] Validated by repository checks, PR CI and Docs7 production build; external verification clearly recorded. +- [x] Repository metadata and exclusions match official Context7 schema. +- [x] Docs7 schema and navigated paths match actual docs; existing pages remain source of truth. +- [x] Claim instructions require exact per-library public key from the owner's Context7 panel. +- [x] Existing hosting and released package identities are unchanged. +- [~] Validated by repository checks, PR CI and Docs7 production build; external verification clearly recorded. - [ ] Release decision follows repository release governance and only occurs after complete evidence. ## Test steps @@ -70,6 +70,13 @@ Revert the documentation/configuration PR; keep historical tags/releases untouch ## Completion notes +Current status: external ownership and production proof are now available. +The conditional claim-key instruction has been clarified without adding any +challenge or credential. Exact-head validation of this documentation follow-up +is still required before completing and archiving the task. + +### Original blocked checkpoint (historical, retained verbatim) + PENDING. The GitHub connector provides file edits but no checkout/execution; source checkout failed DNS resolution to github.com (`Could not resolve host: github.com`) and pnpm is unavailable in the container, so the repository-built CLI could not allocate a task ID. `TASK-0097` uses the next unused ID after checked `TASK-0096` as a documented manual fallback. No local validation, Docs7 deploy, claim or badge may be asserted. ### Audit checkpoint 2026-11-17 @@ -99,3 +106,40 @@ task; historical blocked TASK-0087/0092/0093 remain untouched. ownership or badge verification. No deployment/account action is authorized by the corrective patch tasks. The task stays blocked, not completed/archived; this external documentation work is not a patch-publication prerequisite. + +### External evidence reconciliation 2026-11-17 + +- Public Context7 library `https://context7.com/cynrath/agent-context-kit` + returns 200. Provider metadata reports + `claimedBy=f799b9e6-8500-464e-a177-3bf3216860aa`, `verified=true`, + `verifiedAt=2026-10-15T10:16:21.849Z`, `configSource=context7json`. + This is provider read-back, not an inferred badge or a new account action. +- Docs7 Production check `134103983215` on master + `b7f07d68638a288a0c802f72dedd329014f4679d` concluded success with + "Deployment succeeded". The provider's existing site/deployment records are + `2adaa5e1-d7a5-49d4-9c9d-040f49885e22` / + `3fdd8869-f560-49b1-a866-c03963f2050f`, in the same owner teamspace. +- `https://cynrath-agent-context-kit.docs7.io/`, + `/guides/getting-started`, `/llms.txt`, `/llms-full.txt` and + `/guides/getting-started.md` each returned HTTP 200 with the expected HTML, + plain-text or Markdown content type. Agent content includes current + `canonicalPath`, `exit_code_hint` and feature-index documentation. +- The successful provider production render accepts this actual configuration + and its 32 real documentation routes. The previously recorded generic + upstream-schema regex compilation problem is preserved; no schema pattern + or validation gate was weakened to manufacture a formal-schema pass. +- The claim guide now explicitly requires the exact per-library URL and + public key from the owner panel only if the already-owned library becomes + unclaimed. No key was invented, no ownership/config-source setting changed, + no duplicate library/site created, and no deployment was dispatched. +- Existing GitHub Pages configuration and immutable package identities remain + unchanged by this documentation task. TASK-0103 separately owns the authorized + patch release for verified runtime/CI fixes; docs alone did not trigger it. +- PR #44 head `716dd255a351bbd338980f82c9b6cae24341039f` passed all required + cross-platform checks before merge. Follow-up guide/task changes still await + their own local documentation checks and exact-head PR evidence. +- Follow-up local validation: documentation distribution/canonical docs gates + 11/11 PASS; repository text hygiene, task doctor and diff check PASS. + The current goal's explicit Git/PR/master-merge authorization, also recorded + in TASK-0103, covers this scoped evidence follow-up. It does not authorize + a deployment or account/credential change in this task. diff --git a/docs/tasks/active/TASK-0103-authorized-patch-publication-and-public-surface-.md b/docs/tasks/active/TASK-0103-authorized-patch-publication-and-public-surface-.md index d7110b6..ae15546 100644 --- a/docs/tasks/active/TASK-0103-authorized-patch-publication-and-public-surface-.md +++ b/docs/tasks/active/TASK-0103-authorized-patch-publication-and-public-surface-.md @@ -1,7 +1,7 @@ --- id: "TASK-0103" title: "Authorized patch publication and public-surface verification" -status: active +status: pending schemaVersion: 2 dependencies: - "TASK-0102" @@ -70,7 +70,7 @@ external blocker; do independent authorized work first, never partial-publish np ## Acceptance criteria - [x] PR merged only after all exact-head CI checks pass; master SHA verified. -- [~] Marketplace target visible before new immutable tag triggers npm publication. +- [x] Marketplace target visible before new immutable tag triggers npm publication. - [ ] npm latest, fresh CLI/SDK/MCP and new-tag external Action consumer pass. - [ ] GitHub Release tag/VSIX identity and downloaded asset checksum pass. - [ ] Stable-pointer bookkeeping merged with CI; final master clean/aligned; @@ -153,4 +153,40 @@ temporary detached records worktree/PR transport, removed after merge; no direct master push or persistent development branch is introduced. Publication still waits for master checks, a fresh audited master VSIX and current target absence. +### Publication checkpoint — registry processing + +- Protected records PR #44 head `716dd255a351bbd338980f82c9b6cae24341039f` + passed all 12 required checks plus Docs7 Preview, then merged as + `b7f07d68638a288a0c802f72dedd329014f4679d`. Both commits have identical tree + `0822388ec806d47223eb64eca22168858c48b294`. Primary checkout remains clean + master equal to origin/master; both old PR transport branches were deleted. +- Post-merge CI run `44101924915` had two macOS jobs canceled before acquiring + a hosted runner (empty steps/runner name; capacity annotation), not test + failures. Other executed jobs and Action run `44101925039` passed. The + identical-tree PR platform matrix passed; no workflow was dispatched/rerun. +- Marketplace publication of audited `ackit-vscode-0.5.5.vsix` succeeded; + public latest read-back returned 0.5.5 before tag push. Uploaded VSIX size + 415230 bytes, SHA-256 + `b0c66db5b6aa4f3b12c58126021cc66d5407c1b99825295060772e277f8e6939`. +- NEW annotated tag `v0.5.5` object + `857d91b4866fd88c691eca2b230457ef9da11310` peels to `b7f07d6`. + The tag has not been moved/deleted. New-tag cold external Action consumer + passed scan/optimize/drift, thresholds, CLI errors and canonical SARIF. +- Release run `44129100682` passed full quality, VSIX preflight, tarball smoke, + Marketplace-first gate and npm OIDC publication. Published tarball SHA-1 + `41ff5b1865ef6ede16ac9c4d5743b34519f38537`; signed provenance transparency + log index `3949357822`. npm reported that package processing was pending. +- The 30 x 10s registry-visibility gate expired with exit 20. Subsequent fresh + npm-cache and direct HTTPS probes still returned 404; latest remained 0.5.4. + npm's official 2026-07-28 publish-time scanning announcement allows 15 minutes + or longer processing. This is not a failed upload or proof of public success. + Downstream consumer/GitHub Release steps were skipped. No second publish, + tag change, workflow rerun or stable-pointer update has been attempted. +- Publication read-back continues after the bounded TASK-0097 documentation + reconciliation unit; this scheduling change is not task completion. +- A temporary records worktree nested under ignored temp caused duplicate + skill discovery (8 issues). Moving that clean worktree outside the primary + repository restored 4 skills / 0 issues and doctor PASS; no product policy, + scan suppression or skill validator was changed. Scan CI remained exit 0. + Dependencies: TASK-0102 From 1219388a9385e7099a9fe40a217e02f4dcabec74 Mon Sep 17 00:00:00 2001 From: Cynrath <85012225+Cynrath@users.noreply.github.com> Date: Tue, 17 Nov 2026 20:03:55 +0300 Subject: [PATCH 2/6] docs(tasks): plan bounded npm processing verification --- ...ntext7-ownership-and-docs7-distribution.md | 4 +- ...npm-publish-time-processing-without-wea.md | 94 +++++++++++++++++++ 2 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 docs/tasks/active/TASK-0106-tolerate-npm-publish-time-processing-without-wea.md diff --git a/docs/tasks/active/TASK-0097-context7-ownership-and-docs7-distribution.md b/docs/tasks/active/TASK-0097-context7-ownership-and-docs7-distribution.md index f6a3180..568c270 100644 --- a/docs/tasks/active/TASK-0097-context7-ownership-and-docs7-distribution.md +++ b/docs/tasks/active/TASK-0097-context7-ownership-and-docs7-distribution.md @@ -1,7 +1,7 @@ --- id: "TASK-0097" title: "Context7 ownership-ready configuration and Docs7 documentation distribution" -status: active +status: pending schemaVersion: 2 dependencies: [] createdAt: "2026-10-15" @@ -40,7 +40,7 @@ Expose the maintained ACKit documentation to Context7 and prepare Docs7 hosting - [x] Docs7 schema and navigated paths match actual docs; existing pages remain source of truth. - [x] Claim instructions require exact per-library public key from the owner's Context7 panel. - [x] Existing hosting and released package identities are unchanged. -- [~] Validated by repository checks, PR CI and Docs7 production build; external verification clearly recorded. +- [ ] Validated by repository checks, PR CI and Docs7 production build; external verification clearly recorded. - [ ] Release decision follows repository release governance and only occurs after complete evidence. ## Test steps diff --git a/docs/tasks/active/TASK-0106-tolerate-npm-publish-time-processing-without-wea.md b/docs/tasks/active/TASK-0106-tolerate-npm-publish-time-processing-without-wea.md new file mode 100644 index 0000000..f76e9bc --- /dev/null +++ b/docs/tasks/active/TASK-0106-tolerate-npm-publish-time-processing-without-wea.md @@ -0,0 +1,94 @@ +--- +id: "TASK-0106" +title: "Tolerate npm publish-time processing without weakening release verification" +status: active +schemaVersion: 2 +dependencies: + - "TASK-0105" +createdAt: "2026-11-17" +completedAt: null +--- + + +## Purpose + +Prevent a successful OIDC upload from failing downstream verification solely +because npm's publish-time scanning exceeds the old five-minute retry budget. +Release run 44129100682 uploaded 0.5.5 at 16:45 UTC, exhausted its 30 x 10s +visibility gate, then the same immutable version became publicly readable +around 16:58 UTC with the exact uploaded checksum and signed provenance. + +## Scope + +- Increase only the post-upload registry-visibility retry budget to 90 x 20s + (30 minutes), with an explicit 35-minute step timeout. Keep version, shasum, + latest, isolated-consumer and Marketplace/GitHub ordering gates unchanged. +- Exercise the actual parsed workflow shell using local npm/sleep stubs: a + delayed visible version beyond the old retry count succeeds; permanent + absence, checksum mismatch and wrong latest still fail closed. +- Land forward through the current protected PR; preserve the failed release + run and all immutable tag/package/VSIX identities. + +## Explicit authorization + +The current goal explicitly authorizes scoped CI fixes, commits/ordinary branch +pushes and protected PR/master integration. TASK-0103 records publication and +manual downstream repair authority; this task performs no publication action. + +## Out of scope + +- Workflow dispatch/rerun, npm or Marketplace republish, new/moved/deleted tags, + credential/permission changes, deployment, runtime/package-version changes. + +## Affected files + +- `.github/workflows/release.yml` +- `tests/contract/ci-pinning.test.ts` +- This task's evidence; TASK-0103 public-release checkpoint as applicable. + +## Required tests + +- Behavioral shell regression against the old and corrected actual workflow + step, existing complete workflow contracts, full affected root tests and + lint/format/typecheck/build, offline/ACKit gates and exact-head PR CI. + +## Acceptance criteria + +- [ ] Delayed visibility beyond the old budget succeeds within a bounded wait. +- [ ] Permanent absence, wrong shasum and wrong latest retain failure exits. +- [ ] Marketplace-first, OIDC, immutable tag and all downstream gates remain. +- [ ] Local checks and required exact-head PR CI pass; evidence matches results. + +## Test steps + +1. Confirm official npm publish-time scanning guidance and the actual upload, + processing notice, visibility timeout and later exact-checksum read-back. +2. Commit this complete task plan before implementation; run task doctor. +3. Add tests which execute the actual YAML step with bounded stubbed npm/sleep; + show the delayed case fails with the old loop, then correct the retry budget. +4. Run workflow contracts, full root checks, ACKit gates and protected PR CI. + No live release is dispatched to test the next-release workflow change. + +## Security and compatibility + +No data migration, new dependency, secret, permission, product-network or public +API change. Missing or mismatched registry metadata remains a hard failure. +Official reference: https://github.blog/changelog/2026-07-28-npm-publish-time-malware-scanning-and-dual-use-metadata/ + +## Risks + +- Slow registry processing can still exceed the bounded budget; record failure + and verify existing upload before manual downstream repair, never republish. +- Windows tests must use Git's bundled Bash, not the unrelated WSL launcher; + discover it relative to Git's actual exec path without machine-specific paths. + +## Rollback plan + +Forward protected PR restoring the previous retry values if needed; never move +the released tag or overwrite an existing package/asset. No destructive Git. + +## Completion notes + +Plan allocated using the installed repository CLI's supported `task create` +syntax. The older title-only task alias is unavailable; it failed before any +task file was created. Implementation has not started. From 8e7452fc5237842d37a806b4417ca64f6f99b383 Mon Sep 17 00:00:00 2001 From: Cynrath <85012225+Cynrath@users.noreply.github.com> Date: Tue, 17 Nov 2026 20:08:27 +0300 Subject: [PATCH 3/6] fix(ci): allow bounded npm publish-time processing --- .github/workflows/release.yml | 10 ++- ...npm-publish-time-processing-without-wea.md | 35 ++++++++-- tests/contract/ci-pinning.test.ts | 66 +++++++++++++++++++ 3 files changed, 101 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 04cd168..3ed6ac6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -350,16 +350,20 @@ jobs: run: npm publish "${TARBALL_PATH}" --access public --provenance - name: Verify registry metadata, shasum, and dist-tag (bounded propagation retry) + timeout-minutes: 35 run: | set -euo pipefail + # npm scans uploads before making them installable; processing can + # exceed 15 minutes. Wait at most 30 minutes, then still fail closed. + # https://github.blog/changelog/2026-07-28-npm-publish-time-malware-scanning-and-dual-use-metadata/ seen=0 - for attempt in $(seq 1 30); do + for attempt in $(seq 1 90); do if npm view "@cynrath/agent-context-kit@${RELEASE_VERSION}" version > /dev/null 2>&1; then seen=1 break fi - echo "attempt ${attempt}/30: published version not visible yet; waiting 10s" - sleep 10 + echo "attempt ${attempt}/90: npm package processing or propagation pending; waiting 20s" + sleep 20 done if [ "${seen}" -ne 1 ]; then echo "::error::published version never became visible on the registry" diff --git a/docs/tasks/active/TASK-0106-tolerate-npm-publish-time-processing-without-wea.md b/docs/tasks/active/TASK-0106-tolerate-npm-publish-time-processing-without-wea.md index f76e9bc..e693255 100644 --- a/docs/tasks/active/TASK-0106-tolerate-npm-publish-time-processing-without-wea.md +++ b/docs/tasks/active/TASK-0106-tolerate-npm-publish-time-processing-without-wea.md @@ -1,7 +1,7 @@ --- id: "TASK-0106" title: "Tolerate npm publish-time processing without weakening release verification" -status: active +status: pending schemaVersion: 2 dependencies: - "TASK-0105" @@ -54,9 +54,9 @@ manual downstream repair authority; this task performs no publication action. ## Acceptance criteria -- [ ] Delayed visibility beyond the old budget succeeds within a bounded wait. -- [ ] Permanent absence, wrong shasum and wrong latest retain failure exits. -- [ ] Marketplace-first, OIDC, immutable tag and all downstream gates remain. +- [x] Delayed visibility beyond the old budget succeeds within a bounded wait. +- [x] Permanent absence, wrong shasum and wrong latest retain failure exits. +- [x] Marketplace-first, OIDC, immutable tag and all downstream gates remain. - [ ] Local checks and required exact-head PR CI pass; evidence matches results. ## Test steps @@ -89,6 +89,27 @@ the released tag or overwrite an existing package/asset. No destructive Git. ## Completion notes -Plan allocated using the installed repository CLI's supported `task create` -syntax. The older title-only task alias is unavailable; it failed before any -task file was created. Implementation has not started. +Local implementation and verification passed; required new-head PR CI remains +to be observed before completion. TASK-0103 resumes stable-pointer bookkeeping +while this task awaits the same protected-PR evidence. + +- Plan commit `1219388` preceded the workflow/test changes. The installed CLI + allocated this task with `task create`; the old title-only alias failed + before creating a file. No manual task ID was invented. +- The actual parsed registry-verification shell, with only npm and sleep + replaced by stubs, reproduced the old delayed-visibility failure: exit 20 + instead of 0. The other three failure cases passed. After correction all + 28 workflow contracts pass, including delayed success and unchanged exits + 20 (permanent absence), 21 (shasum) and 22 (latest). +- Full root suite: 126 files PASS, 778 tests PASS / 3 existing Windows symlink + privilege skips (781 total). Frozen install, lint, format, strict typecheck + and build PASS. The full suite also executes cold Action/package consumers. +- A shared dependency junction was unsuitable for pnpm's workspace safety + checks. It was moved intact to ignored temp, and a separate frozen install + succeeded. Primary dependencies were preserved; no external target deleted. +- The next-release gate now allows 90 x 20s reads and has a 35-minute outer + timeout. No version/shasum/latest condition, exit, consumer, ordering, + permission, authentication or immutable-artifact control was removed. +- **Not run:** a new live publish/workflow dispatch or rerun; those actions + are outside this task. The existing 0.5.5 run remains failed at its original + visibility timeout, with downstream verification/release repair in TASK-0103. diff --git a/tests/contract/ci-pinning.test.ts b/tests/contract/ci-pinning.test.ts index ba58b08..0231b09 100644 --- a/tests/contract/ci-pinning.test.ts +++ b/tests/contract/ci-pinning.test.ts @@ -1,3 +1,4 @@ +import { execFileSync, spawnSync } from "node:child_process"; import { readFileSync } from "node:fs"; import path from "node:path"; import { describe, expect, it } from "vitest"; @@ -208,6 +209,71 @@ describe("release workflow hardening", () => { expect(raw).toMatch(/seq 1 30/); }); + it.each([ + { + scenario: "delayed visibility", + visibleAfter: 46, + shasum: "audited", + latest: "0.0.1", + exit: 0, + }, + { + scenario: "permanent absence", + visibleAfter: 999, + shasum: "audited", + latest: "0.0.1", + exit: 20, + }, + { scenario: "wrong shasum", visibleAfter: 1, shasum: "different", latest: "0.0.1", exit: 21 }, + { scenario: "wrong latest", visibleAfter: 1, shasum: "audited", latest: "0.0.0", exit: 22 }, + ])("runs the npm processing gate: $scenario", (fixture) => { + const doc = parse(raw) as { jobs: { release: { steps: { name?: string; run?: string }[] } } }; + const step = doc.jobs.release.steps.find((item) => + item.name?.startsWith("Verify registry metadata, shasum, and dist-tag"), + ); + if (!step?.run) throw new Error("Registry verification step missing"); + const bash = + process.platform === "win32" + ? path.resolve( + execFileSync("git", ["--exec-path"], { encoding: "utf8", windowsHide: true }).trim(), + "../../../bin/bash.exe", + ) + : "bash"; + // Execute the actual workflow shell; replace only network calls and waits. + // The delayed case exceeds the old 30-attempt budget without real sleeps. + const stubs = String.raw` +attempts=0 +npm() { + case "$*" in + "view @cynrath/agent-context-kit@$RELEASE_VERSION version") + attempts=$((attempts + 1)) + [ "$attempts" -ge "$MOCK_VISIBLE_AFTER" ] ;; + "view @cynrath/agent-context-kit@$RELEASE_VERSION dist.shasum --json") + printf '"%s"\n' "$MOCK_SHASUM" ;; + "view @cynrath/agent-context-kit dist-tags.latest") + printf '%s\n' "$MOCK_LATEST" ;; + *) return 99 ;; + esac +} +sleep() { :; } +`; + const result = spawnSync(bash, ["--noprofile", "--norc", "-c", `${stubs}\n${step.run}`], { + encoding: "utf8", + windowsHide: true, + timeout: 10_000, + env: { + ...process.env, + RELEASE_VERSION: "0.0.1", + TARBALL_SHASUM: "audited", + MOCK_VISIBLE_AFTER: String(fixture.visibleAfter), + MOCK_SHASUM: fixture.shasum, + MOCK_LATEST: fixture.latest, + }, + }); + expect(result.error).toBeUndefined(); + expect(result.status, `${result.stdout}\n${result.stderr}`).toBe(fixture.exit); + }); + it("keeps GitHub Release after every publish and final verification last (failed publish aborts first)", () => { const releaseStep = raw.indexOf("- name: Create GitHub Release and attach audited VSIX"); expect(releaseStep).toBeGreaterThan(-1); From 2e8e0ae89dc2164bf90cccaff468e47cf569c6d1 Mon Sep 17 00:00:00 2001 From: Cynrath <85012225+Cynrath@users.noreply.github.com> Date: Tue, 17 Nov 2026 20:10:53 +0300 Subject: [PATCH 4/6] docs(release): align stable surfaces with verified 0.5.5 --- README.md | 12 ++-- docs/guides/agent-integration.md | 2 +- docs/guides/feature-index.md | 2 +- docs/guides/getting-started.md | 8 +-- ...d-patch-publication-and-public-surface-.md | 56 +++++++++++++++++-- examples/demo-github-action/README.md | 9 ++- release-state.json | 2 +- 7 files changed, 71 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 4ad3874..b8ae6af 100644 --- a/README.md +++ b/README.md @@ -187,11 +187,11 @@ OpenCode, Copilot, Gemini, Cursor, Cline, any MCP-capable agent). ```bash # global (recommended) npm install --global @cynrath/agent-context-kit -ackit --version # 0.5.4 +ackit --version # 0.5.5 # one-shot, pinned -npx --yes @cynrath/agent-context-kit@0.5.4 --version -npx --yes @cynrath/agent-context-kit@0.5.4 --help +npx --yes @cynrath/agent-context-kit@0.5.5 --version +npx --yes @cynrath/agent-context-kit@0.5.5 --help # from source pnpm install --frozen-lockfile && pnpm build @@ -321,7 +321,7 @@ More: [`docs/architecture/overview.md`](docs/architecture/overview.md) ### 🤖 GitHub Action -Official `Cynrath/agent-context-kit@v0.5.4` (SHA-pinned for high-assurance): +Official `Cynrath/agent-context-kit@v0.5.5` (pin the release commit for high assurance): ```yaml permissions: @@ -331,7 +331,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a - - uses: Cynrath/agent-context-kit@v0.5.4 + - uses: Cynrath/agent-context-kit@v0.5.5 with: command: scan args: "--json" @@ -456,7 +456,7 @@ See [`CONTRIBUTING.md`](CONTRIBUTING.md) for the docs-first workflow. ### 🔖 Versioning -Development: **`0.5.5`** on `master` · Latest stable: **`0.5.4`** · [Changelog](CHANGELOG.md) · [Releases](https://github.com/Cynrath/agent-context-kit/releases/latest) · `latest → 0.5.4` via OIDC Trusted Publishing with provenance. Stable pointer: [`release-state.json`](release-state.json). Legacy `.NET/NuGet 1.0.0-rc.1` at `258918b` is frozen. +Development: **`0.5.5`** on `master` · Latest stable: **`0.5.5`** · [Changelog](CHANGELOG.md) · [Releases](https://github.com/Cynrath/agent-context-kit/releases/latest) · `latest → 0.5.5` via OIDC Trusted Publishing with provenance. Stable pointer: [`release-state.json`](release-state.json). Legacy `.NET/NuGet 1.0.0-rc.1` at `258918b` is frozen. --- diff --git a/docs/guides/agent-integration.md b/docs/guides/agent-integration.md index bab97ce..155527d 100644 --- a/docs/guides/agent-integration.md +++ b/docs/guides/agent-integration.md @@ -19,7 +19,7 @@ duplicates. ## Managed-asset lifecycle (init → sync) > Availability: `ackit sync` is RELEASED in `0.4.0` and ships in published npm -> `@cynrath/agent-context-kit@0.5.4`. +> `@cynrath/agent-context-kit@0.5.5`. `ackit init` is the first-time onboarding; `ackit sync` is the later, version-aware reconciliation. Both run on the same ownership engine — the diff --git a/docs/guides/feature-index.md b/docs/guides/feature-index.md index 8ebb4cb..6abd4d5 100644 --- a/docs/guides/feature-index.md +++ b/docs/guides/feature-index.md @@ -1,4 +1,4 @@ -# ACKit feature reference (v0.5.4) +# ACKit feature reference (v0.5.5) This index covers the documented, implemented ACKit surfaces. The [CLI reference](../reference/cli.md), [SDK reference](../reference/sdk.md), [MCP reference](../reference/mcp.md) and [README](../../README.md) are authoritative for exact contracts. This index does not claim features beyond the current published code. diff --git a/docs/guides/getting-started.md b/docs/guides/getting-started.md index 493b669..1cce177 100644 --- a/docs/guides/getting-started.md +++ b/docs/guides/getting-started.md @@ -14,17 +14,17 @@ npm install --global @cynrath/agent-context-kit ackit --version ``` -One-shot usage: `npx --yes @cynrath/agent-context-kit@0.5.4 --help` (pinned to stable `0.5.4`). +One-shot usage: `npx --yes @cynrath/agent-context-kit@0.5.5 --help` (pinned to stable `0.5.5`). From a source checkout instead: ```bash pnpm install --frozen-lockfile pnpm build -node dist/cli/index.js --version # 0.5.4 +node dist/cli/index.js --version # 0.5.5 ``` -## 30-second tour (verified commands — stable v0.5.4) +## 30-second tour (verified commands — stable v0.5.5) Fastest check (no install): `npx --yes @cynrath/agent-context-kit@latest readiness` — scores the current repository 0–100 with actionable findings. @@ -38,7 +38,7 @@ ackit optimize --explain # 8-class advisor with waste estimates ackit pack --profile codex --max-tokens 50000 # provider-aware pack ackit diagnostics --json # env/config/instructions/cache/policy/tasks ackit dashboard --port 0 --open # localhost-only dashboard -ackit task "first task" # docs-first task with tool-allocated id +ackit task create "first task" # docs-first task with tool-allocated id ``` Deeper references: `docs/concepts/readiness.md` · `docs/reference/readiness.md` · `docs/guides/ci.md` · `docs/guides/watch-dashboard.md` · `docs/guides/vscode.md` · `docs/reference/sdk.md`. diff --git a/docs/tasks/active/TASK-0103-authorized-patch-publication-and-public-surface-.md b/docs/tasks/active/TASK-0103-authorized-patch-publication-and-public-surface-.md index ae15546..e2a6813 100644 --- a/docs/tasks/active/TASK-0103-authorized-patch-publication-and-public-surface-.md +++ b/docs/tasks/active/TASK-0103-authorized-patch-publication-and-public-surface-.md @@ -1,7 +1,7 @@ --- id: "TASK-0103" title: "Authorized patch publication and public-surface verification" -status: pending +status: active schemaVersion: 2 dependencies: - "TASK-0102" @@ -71,9 +71,9 @@ external blocker; do independent authorized work first, never partial-publish np - [x] PR merged only after all exact-head CI checks pass; master SHA verified. - [x] Marketplace target visible before new immutable tag triggers npm publication. -- [ ] npm latest, fresh CLI/SDK/MCP and new-tag external Action consumer pass. -- [ ] GitHub Release tag/VSIX identity and downloaded asset checksum pass. -- [ ] Stable-pointer bookkeeping merged with CI; final master clean/aligned; +- [x] npm latest, fresh CLI/SDK/MCP and new-tag external Action consumer pass. +- [x] GitHub Release tag/VSIX identity and downloaded asset checksum pass. +- [~] Stable-pointer bookkeeping merged with CI; final master clean/aligned; task evidence and open blockers match the actual public state. ## Test steps @@ -105,6 +105,11 @@ can correct artifacts; never overwrite/repoint/delete the released version. ## Completion notes +All three public channels now serve 0.5.5, independently verified below. The +stable-pointer follow-up still requires exact-head CI and protected merge. + +### Original plan checkpoint (historical) + Plan allocated by repository CLI on 2026-11-17. No publication or tag action yet. ### Publication preflight 2026-11-17 @@ -189,4 +194,47 @@ waits for master checks, a fresh audited master VSIX and current target absence. repository restored 4 skills / 0 issues and doctor PASS; no product policy, scan suppression or skill validator was changed. Scan CI remained exit 0. +### Public release verified; stable bookkeeping in progress + +- npm version and latest both returned 0.5.5 after processing, without another + publish. Downloaded registry tarball SHA-1 equals the original workflow value + `41ff5b1865ef6ede16ac9c4d5743b34519f38537`; SHA-512 integrity also matches + `sha512-sjiGI6x/NP8IyPEoNt/QAB9kJMVdG/L7EiHF1kQyjF8QwT4FRZnGj0YDTwHdwwd9YrOOpJ08XSu7FP5E8r15Xw==`. +- Independent consumers used empty directories outside the checkout and unique + npm caches. Fresh npx and installed CLI returned 0.5.5. Published SDK found the + built-in marker rule. Published MCP handshook version 0.5.5, listed 16 tools + without per-call root/includeGlobs overrides, and produced ci false/true hints + 0/1. `npm audit signatures --omit=dev`: 100 signatures / 17 attestations + verified. No global package or authentication state was modified. +- Public Marketplace latest remained 0.5.5 after npm. Its own VsixSha256 and + downloaded package match the exact uploaded VSIX: + `b0c66db5b6aa4f3b12c58126021cc66d5407c1b99825295060772e277f8e6939`. +- Manual downstream GitHub Release creation succeeded at + `https://github.com/Cynrath/agent-context-kit/releases/tag/v0.5.5` + (2026-11-17T17:00:09Z), after all independent npm/Marketplace consumers and + checksums passed. The release is public, stable, latest and uses the existing + immutable tag. Downloaded asset, API digest and release-note checksum agree + with the Marketplace VSIX above; packaged manifest/README/CHANGELOG, 31 ZIP + entries, CRC/bounds and offline/security preflight PASS (415230 bytes). +- The failed workflow's separately rebuilt ZIP had SHA-256 `35ae1f0...` and was + never uploaded as a Release asset. The repair attaches the original audited + Marketplace VSIX, byte-identical across both public extension channels. No + immutable asset was replaced and no workflow rerun/dispatch was performed. +- TASK-0106 owns the observed too-short next-release wait, planned before code + in `1219388` and implemented in `8e7452f`: bounded 30-minute visibility reads, + 35-minute step timeout, unchanged fail-closed gates. Behavioral regression + proved the old failure and all 28 workflow contracts now pass. Full root suite + is 126 files / 778 PASS / 3 existing Windows privilege skips (781 total). +- Stable pointer/current install pins now advance to the verified 0.5.5 in the + same follow-up, including the Action demo's stale pin/distribution copy. The + getting-started task example uses the installed `task create` command. + Source/extension versions and all runtime files remain identical to the tag. +- Follow-up stable documentation checks: version/readme/distribution/canonical + docs contracts 48/48 PASS; version parity reports source/stable both 0.5.5. + Text hygiene, task doctor and diff check PASS. Exact-head PR CI and protected + stable-bookkeeping merge remain the final completion gate. +- TASK-0097's live ownership/production evidence is recorded; completion waits + for the guide follow-up's exact-head CI. Historical TASK-0087/0092/0093 remain + blocked and are not casually closed by this release. + Dependencies: TASK-0102 diff --git a/examples/demo-github-action/README.md b/examples/demo-github-action/README.md index d51f0e1..ce50fec 100644 --- a/examples/demo-github-action/README.md +++ b/examples/demo-github-action/README.md @@ -1,6 +1,6 @@ # Demo: GitHub Action -Official `Cynrath/agent-context-kit@v0.4.1` +Official `Cynrath/agent-context-kit@v0.5.5` ```yaml permissions: @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a - - uses: Cynrath/agent-context-kit@v0.4.1 + - uses: Cynrath/agent-context-kit@v0.5.5 with: command: scan args: "--json" @@ -23,4 +23,7 @@ jobs: - Inputs `command/args/fail-threshold/upload-sarif`, outputs `findings-json/sarif-path` - Safe `execFile` arg split, SARIF 2.1.0, job summary, least-privilege - Verified via `actionlint` and local `uses: ./` smoke (annotations + SARIF valid) -- Distribution: `dist/action/index.js` 6KB, node24 +- Distribution: composite Action builds the exact tagged source with pinned + Node 24/pnpm setup and a frozen install, then runs offline against the consumer. + Setup requires registry access; generated `dist` is not tracked + ([ADR-0034](../../docs/decisions/ADR-0034-source-built-action-distribution.md)). diff --git a/release-state.json b/release-state.json index 08321ae..1c105dc 100644 --- a/release-state.json +++ b/release-state.json @@ -1,5 +1,5 @@ { "schemaVersion": 1, - "publishedStable": "0.5.4", + "publishedStable": "0.5.5", "maintenanceSeries": ["0.4.x"] } From 4d0aa26c9b2681fc48aa1b72350174d7860a120c Mon Sep 17 00:00:00 2001 From: Cynrath <85012225+Cynrath@users.noreply.github.com> Date: Tue, 17 Nov 2026 21:29:50 +0300 Subject: [PATCH 5/6] docs(tasks): plan isolated package lifecycle verification --- ...d-patch-publication-and-public-surface-.md | 14 ++- ...ackage-smoke-builds-from-parallel-cli-c.md | 102 ++++++++++++++++++ 2 files changed, 114 insertions(+), 2 deletions(-) create mode 100644 docs/tasks/active/TASK-0107-isolate-package-smoke-builds-from-parallel-cli-c.md diff --git a/docs/tasks/active/TASK-0103-authorized-patch-publication-and-public-surface-.md b/docs/tasks/active/TASK-0103-authorized-patch-publication-and-public-surface-.md index e2a6813..535ac15 100644 --- a/docs/tasks/active/TASK-0103-authorized-patch-publication-and-public-surface-.md +++ b/docs/tasks/active/TASK-0103-authorized-patch-publication-and-public-surface-.md @@ -1,7 +1,7 @@ --- id: "TASK-0103" title: "Authorized patch publication and public-surface verification" -status: active +status: pending schemaVersion: 2 dependencies: - "TASK-0102" @@ -73,7 +73,7 @@ external blocker; do independent authorized work first, never partial-publish np - [x] Marketplace target visible before new immutable tag triggers npm publication. - [x] npm latest, fresh CLI/SDK/MCP and new-tag external Action consumer pass. - [x] GitHub Release tag/VSIX identity and downloaded asset checksum pass. -- [~] Stable-pointer bookkeeping merged with CI; final master clean/aligned; +- [ ] Stable-pointer bookkeeping merged with CI; final master clean/aligned; task evidence and open blockers match the actual public state. ## Test steps @@ -238,3 +238,13 @@ waits for master checks, a fresh audited master VSIX and current target absence. blocked and are not casually closed by this release. Dependencies: TASK-0102 + +### Follow-up CI held for a shared-build race + +PR #45 head `2e8e0ae89dc2164bf90cccaff468e47cf569c6d1` passed the new npm +processing contracts and other executed checks, but Linux/Node 24 job +`134218923233` failed one built-CLI assertion (exit 1 instead of 2): the loader +read an incomplete `dist/core/policy/tiers.js` during a parallel prepack rebuild. +TASK-0107 plans isolation of both source-checkout pack writers; no assertion is +weakened and no failed run is rerun. The protected bookkeeping merge remains +held. Independent public release/install verification is unaffected. diff --git a/docs/tasks/active/TASK-0107-isolate-package-smoke-builds-from-parallel-cli-c.md b/docs/tasks/active/TASK-0107-isolate-package-smoke-builds-from-parallel-cli-c.md new file mode 100644 index 0000000..d0f13dd --- /dev/null +++ b/docs/tasks/active/TASK-0107-isolate-package-smoke-builds-from-parallel-cli-c.md @@ -0,0 +1,102 @@ +--- +id: "TASK-0107" +title: "Isolate package smoke builds from parallel CLI contracts" +status: active +schemaVersion: 2 +dependencies: + - "TASK-0105" +createdAt: "2026-11-17" +completedAt: null +--- + + +## Purpose + +Eliminate shared-build writes from parallel packaging tests. In PR #45 at +`2e8e0ae`, Linux/Node 24 job `134218923233` passed build/CLI smoke but later +failed invalid-usage exit-code verification because `dist/core/policy/tiers.js` +was read during another test's prepack rebuild and temporarily lacked exports. +Two current tarball callers execute lifecycle-enabled `pnpm pack` in the source +checkout, rewriting shared dist/schemas while sibling CLI contracts read them. + +## Scope + +- Export a minimal current source build into a private temporary project, + frozen-install its pinned root dependencies, and run real lifecycle-enabled + pack there. Share that isolated pack boundary between package smoke and the + tarball allowlist test; keep installed CLI/MCP/lifecycle assertions intact. +- Add a regression assertion that real packing preserves source-checkout + built-module and schema timestamps; reproduce its failure before the fix. +- Preserve parallel tests, all CLI assertions and real prepack build/schema + generation. Use the existing redacted consumer process boundary. + +## Explicit authorization + +The current goal authorizes scoped bug/CI/test fixes, ordinary commits/pushes +and protected PR/master integration. This task performs no publication, +workflow dispatch/rerun, tag, permission, credential or deployment action. + +## Out of scope + +- Runtime/public API/version changes; serializing the suite; skipping prepack, + weakening CLI exit-code expectations, retries that hide the race; republish, + tag movement, workflow dispatch/rerun, deployment or unrelated refactoring. + +## Affected files + +- `scripts/package-smoke.mjs` +- New `scripts/isolated-package.mjs` and its narrow `.d.mts` signature +- `tests/e2e/tarball/tarball-smoke.test.ts` +- This task and TASK-0103's CI/publication checkpoint. + +## Required tests + +- Old-path root-mutation regression must fail, then pass with isolation. +- Real allowlist/installed-package smoke plus parallel built-CLI contracts. +- Full affected root suite, lint/format/strict typecheck/build, frozen lock, + schema no-drift, offline/ACKit gates and required exact-head PR CI. + +## Acceptance criteria + +- [ ] Lifecycle-enabled packing preserves the checkout's built modules/schemas. +- [ ] Actual tarball allowlist, installed CLI/task/MCP and parallel CLI checks pass. +- [ ] No lifecycle/quality assertion is skipped, serialized or weakened. +- [ ] Full local gates and required exact-head PR CI pass with recorded evidence. + +## Test steps + +1. Record the completed hosted failure, inspect both writers and built-CLI + readers, and commit this complete plan before implementation. +2. Assert built-module/schema timestamps remain unchanged through real pack; + show the old source-checkout prepack violates that assertion. +3. Export current tracked/unignored build inputs into a new private temp + project (no ignored dist/node_modules), frozen-install, and perform real + prepack/pack there. Require bounded, redacted child-process failures. +4. Run focused parallel packaging/CLI tests, then full affected checks and + exact-head hosted matrix; leave previous failures visible, never rerun them. + +## Security and compatibility + +No runtime network/API, production data, dependency-version or permission change. +Only test/setup tooling uses the existing package registry, as before. Exports +must stay inside their private fixture, use real path bounds and refuse escaping +symlinks. Pack must still build/schema-generate and exercise actual tarballs. + +## Risks + +- Cold isolated installs add setup work; use the existing pinned dependency + graph/cache rather than sharing mutable build output. Do not invent timing + performance claims or silently ignore setup failures. +- Validate fixture cleanup boundaries; preserve all user files and primary + dependency directories. No source checkout build file may be rewritten. + +## Rollback plan + +Forward protected PR restoring the previous tooling if necessary while keeping +the failing CI gate honest. No immutable release/package/tag is changed. + +## Completion notes + +Tool-allocated plan only; implementation has not started. TASK-0103 is pending +this observed CI correction. Public npm/Marketplace/GitHub Release 0.5.5 and +their independently verified immutable artifacts remain unchanged. From 7a191414d7ff351acc20b8051914ca0492962ee2 Mon Sep 17 00:00:00 2001 From: Cynrath <85012225+Cynrath@users.noreply.github.com> Date: Tue, 17 Nov 2026 21:45:59 +0300 Subject: [PATCH 6/6] fix(ci): isolate package lifecycle builds from parallel CLI tests --- ...ntext7-ownership-and-docs7-distribution.md | 6 ++ ...d-patch-publication-and-public-surface-.md | 2 + ...ackage-smoke-builds-from-parallel-cli-c.md | 36 +++++++-- scripts/isolated-package.d.mts | 1 + scripts/isolated-package.mjs | 81 +++++++++++++++++++ scripts/package-smoke.mjs | 37 +++------ tests/e2e/tarball/tarball-smoke.test.ts | 29 ++++--- 7 files changed, 152 insertions(+), 40 deletions(-) create mode 100644 scripts/isolated-package.d.mts create mode 100644 scripts/isolated-package.mjs diff --git a/docs/tasks/active/TASK-0097-context7-ownership-and-docs7-distribution.md b/docs/tasks/active/TASK-0097-context7-ownership-and-docs7-distribution.md index 568c270..40c68cd 100644 --- a/docs/tasks/active/TASK-0097-context7-ownership-and-docs7-distribution.md +++ b/docs/tasks/active/TASK-0097-context7-ownership-and-docs7-distribution.md @@ -143,3 +143,9 @@ task; historical blocked TASK-0087/0092/0093 remain untouched. The current goal's explicit Git/PR/master-merge authorization, also recorded in TASK-0103, covers this scoped evidence follow-up. It does not authorize a deployment or account/credential change in this task. +- Context7's connected resolve/query tools independently found the exact + `/cynrath/agent-context-kit` library and returned the current master SDK/MCP + pages: SDK root descriptor `canonicalPath`, built-in/extra rules, fixed + MCP startup root, unsupported per-call root/includeGlobs and ci-controlled + `exit_code_hint=0/1`. Retrieval of the corrected documentation is verified, + beyond the public ownership/badge/config-source metadata above. diff --git a/docs/tasks/active/TASK-0103-authorized-patch-publication-and-public-surface-.md b/docs/tasks/active/TASK-0103-authorized-patch-publication-and-public-surface-.md index 535ac15..da38fd9 100644 --- a/docs/tasks/active/TASK-0103-authorized-patch-publication-and-public-surface-.md +++ b/docs/tasks/active/TASK-0103-authorized-patch-publication-and-public-surface-.md @@ -6,6 +6,8 @@ schemaVersion: 2 dependencies: - "TASK-0102" - "TASK-0105" + - "TASK-0106" + - "TASK-0107" createdAt: "2026-11-17" completedAt: null --- diff --git a/docs/tasks/active/TASK-0107-isolate-package-smoke-builds-from-parallel-cli-c.md b/docs/tasks/active/TASK-0107-isolate-package-smoke-builds-from-parallel-cli-c.md index d0f13dd..ce09759 100644 --- a/docs/tasks/active/TASK-0107-isolate-package-smoke-builds-from-parallel-cli-c.md +++ b/docs/tasks/active/TASK-0107-isolate-package-smoke-builds-from-parallel-cli-c.md @@ -58,10 +58,10 @@ workflow dispatch/rerun, tag, permission, credential or deployment action. ## Acceptance criteria -- [ ] Lifecycle-enabled packing preserves the checkout's built modules/schemas. -- [ ] Actual tarball allowlist, installed CLI/task/MCP and parallel CLI checks pass. -- [ ] No lifecycle/quality assertion is skipped, serialized or weakened. -- [ ] Full local gates and required exact-head PR CI pass with recorded evidence. +- [x] Lifecycle-enabled packing preserves the checkout's built modules/schemas. +- [x] Actual tarball allowlist, installed CLI/task/MCP and parallel CLI checks pass. +- [x] No lifecycle/quality assertion is skipped, serialized or weakened. +- [~] Full local gates and required exact-head PR CI pass with recorded evidence. ## Test steps @@ -97,6 +97,28 @@ the failing CI gate honest. No immutable release/package/tag is changed. ## Completion notes -Tool-allocated plan only; implementation has not started. TASK-0103 is pending -this observed CI correction. Public npm/Marketplace/GitHub Release 0.5.5 and -their independently verified immutable artifacts remain unchanged. +Implementation and local checks are verified; the corrected head still awaits +required PR CI. TASK-0103 stays pending this correction and protected bookkeeping +merge. Public release 0.5.5 and its immutable artifacts remain unchanged. + +- Plan `4d0aa26` preceded implementation. A regression assertion around the old + actual pack reproduced writes to both `dist/core/policy/tiers.js` and + `schemas/ackit.schema.json` (timestamps changed). The original CLI failure + and old-path mutation proof remain recorded; no run was rerun or hidden. +- Both pack callers now export current source inputs into private projects, + validate export/realpath bounds, frozen-install with the manifest's pinned + pnpm, and run the real prepack build/schema hooks there. Existing tarball + allowlist, CLI/task/MCP assertions remain. Each caller now asserts checkout + module/schema timestamps are unchanged; parallel CLI/package tests 6/6 PASS. +- `pnpm exec` does not set npm_execpath, so an initial focused invocation hit + the helper's explicit pinned-runner guard. The supported `pnpm test` script + provides it and the corrected focused invocation passed. No guard was removed. +- The first default full local run had two checkpoint 60s timeouts under load; + focused checkpoint/handoff checks then passed 20/20. On this 12-logical-CPU + host, `pnpm test --maxWorkers=8` ran the entire suite: 126 files PASS, + 778 PASS / 3 existing Windows privilege skips (781 total), 126.44s. + The existing test timeout and all assertions remained in force. Hosted CI + continues to run the default full-suite command on its normal matrix. +- Lint, format, strict typecheck, build, schema no-drift, text hygiene, task + doctor and static offline gate PASS. Required exact-head CI is the remaining + completion evidence; no new live publish/dispatch/rerun is part of this task. diff --git a/scripts/isolated-package.d.mts b/scripts/isolated-package.d.mts new file mode 100644 index 0000000..a545370 --- /dev/null +++ b/scripts/isolated-package.d.mts @@ -0,0 +1 @@ +export function packIsolatedProject(repoRoot: string, work: string): string; diff --git a/scripts/isolated-package.mjs b/scripts/isolated-package.mjs new file mode 100644 index 0000000..c1bed80 --- /dev/null +++ b/scripts/isolated-package.mjs @@ -0,0 +1,81 @@ +import { + copyFileSync, + existsSync, + mkdirSync, + readdirSync, + readFileSync, + realpathSync, +} from "node:fs"; +import path from "node:path"; +import { runConsumerCommand } from "./consumer-command.mjs"; + +/** Build and lifecycle-pack current source without rewriting a shared checkout. */ +export function packIsolatedProject(repoRoot, work) { + const root = realpathSync(repoRoot); + const fixture = realpathSync(work); + const relative = path.relative(root, fixture); + if (!relative || (!path.isAbsolute(relative) && !relative.startsWith(`..${path.sep}`))) + throw new Error("Package fixture must be outside the source checkout"); + const source = path.join(fixture, "package-source"); + mkdirSync(source); + const pnpmCli = process.env.npm_execpath; + const manifest = JSON.parse(readFileSync(path.join(root, "package.json"), "utf8")); + const expectedAgent = manifest.packageManager.replace("@", "/"); + if ( + !pnpmCli || + !existsSync(pnpmCli) || + !process.env.npm_config_user_agent?.startsWith(`${expectedAgent} `) + ) + throw new Error("Run package validation through the repository's pinned pnpm"); + const run = (command, args, options = {}) => + runConsumerCommand(command, args, { cwd: root, ...options }, [ + [fixture, ""], + [root, ""], + ]); + const inputs = [ + "src", + "templates", + "schemas", + "package.json", + "pnpm-lock.yaml", + "pnpm-workspace.yaml", + "tsconfig.json", + "tsconfig.build.json", + "extensions/vscode/package.json", + "scripts/generate-schemas.mjs", + "README.md", + "CHANGELOG.md", + "LICENSE", + ]; + const files = run("git", [ + "ls-files", + "--cached", + "--others", + "--exclude-standard", + "-z", + "--", + ...inputs, + ]) + .split("\0") + .filter(Boolean); + for (const file of files) { + const origin = realpathSync(path.resolve(root, file)); + const destination = path.resolve(source, file); + if (!origin.startsWith(`${root}${path.sep}`) || !destination.startsWith(`${source}${path.sep}`)) + throw new Error("Package input escapes its export boundary"); + mkdirSync(path.dirname(destination), { recursive: true }); + copyFileSync(origin, destination); + } + if (existsSync(path.join(source, "dist")) || existsSync(path.join(source, "node_modules"))) + throw new Error("Package export must start without ignored runtime files"); + run( + process.execPath, + [pnpmCli, "install", "--frozen-lockfile", "--ignore-scripts", "--filter", manifest.name], + { cwd: source }, + ); + // Do not skip prepack: its real build/schema hooks run in the private export. + run(process.execPath, [pnpmCli, "pack", "--pack-destination", fixture], { cwd: source }); + const tarball = readdirSync(fixture).find((file) => file.endsWith(".tgz")); + if (!tarball) throw new Error("Isolated pack produced no tarball"); + return path.join(fixture, tarball); +} diff --git a/scripts/package-smoke.mjs b/scripts/package-smoke.mjs index bc196b7..b73c189 100644 --- a/scripts/package-smoke.mjs +++ b/scripts/package-smoke.mjs @@ -1,26 +1,22 @@ #!/usr/bin/env node // Packs the project and installs the tarball into a temp dir, then smokes the // installed CLI: --version / --help / config check / doctor / scan on a fixture. -// Usage: node scripts/package-smoke.mjs (requires prior `pnpm build`) +// Usage: pnpm run smoke:package (build/pack run in a private source export). import { execFileSync, spawnSync } from "node:child_process"; -import { - existsSync, - mkdirSync, - mkdtempSync, - readdirSync, - readFileSync, - rmSync, - writeFileSync, -} from "node:fs"; +import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import path from "node:path"; +import { fileURLToPath } from "node:url"; +import { packIsolatedProject } from "./isolated-package.mjs"; -const repoRoot = path.resolve( - path.dirname(new URL(import.meta.url).pathname.replace(/^\/([A-Za-z]:)/, "$1")), - "..", -); +const repoRoot = fileURLToPath(new URL("../", import.meta.url)); const pkg = JSON.parse(readFileSync(path.join(repoRoot, "package.json"), "utf8")); const work = mkdtempSync(path.join(tmpdir(), "ackit-pkg-smoke-")); +if ( + path.dirname(work) !== path.resolve(tmpdir()) || + !path.basename(work).startsWith("ackit-pkg-smoke-") +) + throw new Error("Unsafe package-smoke cleanup boundary"); function run(cmd, args, opts = {}) { const res = spawnSync(cmd, args, { encoding: "utf8", ...opts }); @@ -32,16 +28,9 @@ function run(cmd, args, opts = {}) { return res; } -// 1) Pack. -const PNPM = process.platform === "win32" ? "pnpm.cmd" : "pnpm"; -execFileSync(PNPM, ["pack", "--pack-destination", work], { - cwd: repoRoot, - encoding: "utf8", - shell: process.platform === "win32", -}); -const tarballName = readdirSync(work).find((entry) => entry.endsWith(".tgz")); -if (!tarballName) throw new Error("pack produced no tarball"); -const tarball = path.join(work, tarballName); +// 1) Preserve lifecycle coverage without mutating sibling tests' dist/schemas. +const tarball = packIsolatedProject(repoRoot, work); +const tarballName = path.basename(tarball); if (!existsSync(tarball)) throw new Error(`tarball not found: ${tarball}`); // 2) Install into an isolated consumer project. diff --git a/tests/e2e/tarball/tarball-smoke.test.ts b/tests/e2e/tarball/tarball-smoke.test.ts index 8f14da1..889a119 100644 --- a/tests/e2e/tarball/tarball-smoke.test.ts +++ b/tests/e2e/tarball/tarball-smoke.test.ts @@ -1,8 +1,9 @@ import { execFileSync } from "node:child_process"; -import { mkdtempSync, readdirSync, rmSync } from "node:fs"; +import { mkdtempSync, rmSync, statSync } from "node:fs"; import { tmpdir } from "node:os"; import path from "node:path"; import { describe, expect, it } from "vitest"; +import { packIsolatedProject } from "../../../scripts/isolated-package.mjs"; import { renderMarkdownReport } from "../../../src/core/reporting/index.js"; import { getPackageIdentity } from "../../../src/shared/version.js"; @@ -29,18 +30,24 @@ function listTarball(tarball: string): string[] { .map((line) => line.replace(/^package\//, "")); } +function checkoutBuildStamps() { + return ["dist/core/policy/tiers.js", "schemas/ackit.schema.json"].map((file) => ({ + file, + modified: statSync(path.join(REPO_ROOT, file)).mtimeMs, + })); +} + describe("tarball contents inspection (REQ-PKG-001)", () => { it("packed tarball fits the files allowlist with no tests/cache/artifacts", () => { const work = mkdtempSync(path.join(tmpdir(), "ackit-inspect-")); + const before = checkoutBuildStamps(); try { - execFileSync(PNPM, ["pack", "--pack-destination", work], { - cwd: REPO_ROOT, - encoding: "utf8", - shell: PNPM_SHELL, - }); - const tarballName = readdirSync(work).find((entry) => entry.endsWith(".tgz")); - expect(tarballName).toBeDefined(); - const files = listTarball(path.join(work, tarballName as string)); + const tarball = packIsolatedProject(REPO_ROOT, work); + expect( + checkoutBuildStamps(), + "pack must not rewrite modules read by parallel CLI tests", + ).toEqual(before); + const files = listTarball(tarball); const violations = files.filter((file) => { if (file.endsWith("/")) return false; @@ -80,6 +87,7 @@ describe("version identity triple-check (REQ-ARCH-009)", () => { it("real tarball installs into a temp consumer and the installed CLI passes smoke", () => { const work = mkdtempSync(path.join(tmpdir(), "ackit-tar-e2e-")); + const before = checkoutBuildStamps(); try { execFileSync(PNPM, ["run", "smoke:package"], { cwd: REPO_ROOT, @@ -87,6 +95,9 @@ describe("version identity triple-check (REQ-ARCH-009)", () => { shell: PNPM_SHELL, timeout: 300000, }); + expect(checkoutBuildStamps(), "package smoke must preserve the shared CLI build").toEqual( + before, + ); } finally { rmSync(work, { recursive: true, force: true }); }