Skip to content

feat: support shared pstack and mstack project workflows - #14

Merged
3metaJun merged 6 commits into
mainfrom
feat/mixed-harness-coexistence
Sep 12, 2026
Merged

3metaJun merged 6 commits into
mainfrom
feat/mixed-harness-coexistence

Conversation

@3metaJun

Copy link
Copy Markdown
Owner

Native pstack and mstack can otherwise create competing project verification maps, including duplicate skills visible to Cursor through .cursor and .agents. Add one canonical project contract, neutral discovery wrappers, and shared project entry instructions for both workflows.

The mstack-policy CLI 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

@3metaJun 3metaJun left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. The CLI entry guard silently no-ops through a symlinked bin. scripts/check-harness-policy.mjs gates on import.meta.url === pathToFileURL(resolve(process.argv[1])).href without 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, both npm i -g and npx --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 .cmd shims, which is presumably why the suite stays green. This is the same bug class #11 fixed in skills/recall/scripts/history.mjs — compare realpathSync(process.argv[1]) against the realpath of import.meta.url (with an existsSync guard), and add a linked-entry regression test like history's.

One hygiene nit:

  1. 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.

@3metaJun

Copy link
Copy Markdown
Owner Author

GPT-6 RESPONDING ON BEHALF OF 3metajun

Addressed both findings in e060c1c:

  • The CLI compares resolved filesystem paths for the launcher and module. The regression first reproduced silent success, then passed through a Windows junction and a POSIX bin symlink. It checks help output, real init writes, invalid-argument failure without writes, and silent module imports.
  • All three new test files now use os.tmpdir() without a personal drive fallback.

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 e060c1c80f18bf94aeb00c62e1d843abbcfcbc06 against base 1b476f4e1dfac44c3d8794386edbef6cd68eab68; stable patch-id 34f213d873d450d9a8c86d9fa9b10294d03efc29. Rechecked before merging.

@3metaJun
3metaJun merged commit d820e6a into main Sep 12, 2026
9 checks passed
@3metaJun 3metaJun mentioned this pull request Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant