Publish tracker syncs without workflow setup artifacts
Fixes #168
Reusable sync installed its extension and configured attributes in the caller checkout, then rejected its own .gitattributes and managed-registry changes at the fail-closed publication scope gate. A tracked registry could also expose setup-only paths to an earlier privacy scan.
Both sync and closeout now require a clean baseline for those artifacts, save their runtime setup outside the publication tree, and restore the baseline before scans. Strict health temporarily reinstates the saved files inside a bounded step with an exit cleanup trap. Scope checks explicitly reject later edits to either path, including ignored files. Callers adopt the fix through Dependabot workflow pins; this PR changes no caller repositories or dependency pins.
Regression setup artifacts never enter tracker publication covers missing/outdated attributes and tracked/untracked registries with a real extension install, nonempty synthetic import, identical repeat import, exact item/history publication, and byte preservation. Caller edits before setup, from caller scripts, and immediately before commit remain refused. Health cleanup on failure and the shared closeout path are covered too.
Validation:
- 20 distinct targeted tests passed, plus typecheck, test typecheck, lint, changelog check and isolated strict project health. All four linked pm test commands passed.
- Behavioural revert: disabled only
restore_workflow_setup_artifacts, retaining the test and guards. The outdated-attributes/untracked-registry regression failed after nonempty and repeat imports with the.gitattributesscope refusal (0/1 passed); restoring the function made the same test pass (1/1). The pm item records the exact command. - CI run 40066235349 passed at commit
a502bfa7793799266b4bf402f163b15a5a81528c: all 4 jobs green.npm run release:checkandbun run release:checkpassed on Node 22 and 26, each with 1,105/1,105 tests, zero failures/skips/cancellations and exact 100/100/100/100 coverage across 19 authored modules. The additional native Bun suites also passed 1,105/1,105 tests on each Node lane across 50 test files, with zero failures or skips. CodeQL and Semgrep passed. Automated review services skipped or reported unavailable access; maintainer review remains pending.
PM: pm-github-sync-setup-artifacts (in progress, released for orchestrator verification).
Summary by cubic
Fixes the publication scope gate rejecting workflow setup changes so tracker syncs and closeouts can publish imported items.
Reusable sync setup installed the pinned extension and configured merge attributes in the caller checkout, then failed its own fail-closed scope check; tracked registries could also reach earlier privacy scans. Both workflows now require .gitattributes and extensions/.managed-extensions.json to match the checkout baseline, save runtime setup outside the publication tree after setup, and restore the baseline before every scan. Strict health temporarily reinstates the saved files inside a bounded step with an exit cleanup trap, and scope checks reject later edits to either path, including ignored files.
No caller repositories or dependency pins change; callers adopt the fix through their Dependabot workflow pins.
Summary by Sourcery
Ensure reusable tracker sync and closeout workflows publish only caller and tracker changes by isolating and restoring workflow setup artifacts.
Bug Fixes:
- Prevent workflow-owned
.gitattributesand managed-extension registry setup artifacts from entering tracker sync or closeout publications and privacy scans. - Fail closed when callers have pre-existing or later edits to either setup artifact, including staged, unstaged, and ignored changes.
- Restore the caller baseline after strict health, including when health fails.
Enhancements:
- Isolate runtime workflow setup outside the publication tree while retaining bounded strict-health verification.
- Document the setup-artifact publication and cleanup guarantees for reusable workflows.
- Add regression coverage for tracked and untracked registries, missing and outdated attributes, repeated imports, caller edits, and failed health cleanup.
Documentation:
- Document setup-artifact isolation, baseline restoration, and fail-closed behavior in the README.
Tests:
- Expand workflow and import-gate tests to verify setup artifacts are excluded from publication and restored byte-for-byte.
Chores:
- Record the work item and history for the setup-artifact publication fix.
- Add an unreleased changelog entry for restoring workflow-owned setup artifacts before tracker publication.