feat: support shared pstack and mstack project workflows - #14
Conversation
3metaJun
left a comment
There was a problem hiding this comment.
Reviewed against current main (after #10–#13). Verified locally on Windows: npm test passes with 164 passing tests and the one expected Unix-only skip, including the new Windows-path-alias, CRLF-handoff, lock-ownership, evidence-tamper, and stale-receipt regressions. No version bump, so the release rule isn't triggered here.
The design is strong where it matters most. The structural checker has real teeth: path validation rejects Unix escapes, drive/UNC paths, device names, and .git casing on every OS; symlinks are refused at every component; markdown parsing is fence-aware so code examples can't satisfy required sections; the feature index check understands code spans and reference links; duplicate discovery names are caught across Cursor's dual .cursor/.agents roots; and frontmatter decoding prevents renamed legacy directories from hiding a verify-* name. The receipt design is honest throughout — it binds feature, base, head, policy digest, command logs, and evidence digests, re-verifies that the recorded commands did not modify the evidence, and every surface repeats that runtime review remains required. The adaptedArtifacts addition pins both the transformed source baseline and the adapted target with a review reason, and sync refuses to overwrite an adapted target — that closes a real drift gap, and the test covers both refusal and preservation. Exporting the checker with the project plus check-package requiring those files in the tarball keeps CI free of an unpublished package, consistent with the no-release scope.
One functional bug to fix before the released CLI ships:
- The CLI entry guard silently no-ops through a symlinked bin.
scripts/check-harness-policy.mjsgates onimport.meta.url === pathToFileURL(resolve(process.argv[1])).hrefwithout resolving symlinks. I reproduced it: running the script through a directory junction exits 0 with no output, while the real path prints usage. On POSIX, bothnpm i -gandnpx --package @3metajun/mstack@<version>exec the bin through a symlink, so the guide's primary team invocation would silently do nothing. Windows is unaffected because npm uses.cmdshims, which is presumably why the suite stays green. This is the same bug class #11 fixed inskills/recall/scripts/history.mjs— comparerealpathSync(process.argv[1])against the realpath ofimport.meta.url(with anexistsSyncguard), and add a linked-entry regression test like history's.
One hygiene nit:
- The three new test files pick their scratch directory with
existsSync("G:/agents_temp") ? "G:/agents_temp" : tmpdir(). That path exists on the authoring machine (it's a personal scratch drive with unrelated projects), so fixtures land there instead of the OS temp dir, and other machines silently take the fallback. Dropping the personal fallback keeps the tests' location predictable for everyone.
Smaller observations, no action required: the validate.mjs and skill-integrity.test.mjs relaxations are scoped to exactly the two files that legitimately document native pstack/Cursor compatibility, which reads as deliberate rather than loosening; and checkReceipt requiring a branch checkout (rejecting detached HEAD) is explicitly documented in the guide, though CI adopting receipts will need a real branch checkout rather than the usual detached PR checkout.
GPT-6 RESPONDING ON BEHALF OF 3metajunAddressed both findings in e060c1c:
Pre-merge verification: PASS. All nine checks pass on the latest head, including Node 18 and 22 on Linux, macOS, and Windows. Independent verification packed and installed the actual npm archive, exercised its npm shim and linked entry points, and confirmed installed runtime bytes match the source. Verified head |
Native pstack and mstack can otherwise create competing project verification maps, including duplicate skills visible to Cursor through
.cursorand.agents. Add one canonical project contract, neutral discovery wrappers, and shared project entry instructions for both workflows.The
mstack-policyCLI initializes adoption, checks structure and linked-worktree ownership, and records executed commands with commit/base and evidence digests. Initialization exports a standalone CI checker. Verification creation, maintenance, setup, and Benny now use the same canonical map. Reviewed upstream adaptations pin both source and target content so future drift still fails.Validation: the full local suite passed with one Unix-only test skipped on Windows. Additional regressions cover Windows path casing, CRLF handoff, duplicate discovery, altered evidence, stale receipts, and lock ownership. Pinned upstream checks, package checks, and installation from a local tarball passed.
Real pilot: https://github.com/3metaJun/inkScroll/pull/5 migrates five existing feature maps. Its CI passes the structural gate, lint/typecheck/build, and a real Chromium flow that creates a book, reloads its saved state, and opens its Editor deep link. CI retains screenshots and reports. A local Codex/mstack run and independent Grok run loading unchanged pinned pstack source use the same contract; the latter is direct source loading, not a marketplace-discovery test.
Receipt PASS covers recorded commands and evidence integrity; runtime review remains required. Repository policy does not enable forge branch protection or attest to an installed plugin version. This PR does not publish an npm version.
Agent: GPT-6 via Codex