Skip to content

feat(perps-review-pr): generate a machine-readable rule pack - #264

Merged
abretonc7s merged 2 commits into
mainfrom
feat/perps-review-pack
Nov 18, 2026
Merged

abretonc7s merged 2 commits into
mainfrom
feat/perps-review-pack

Conversation

@abretonc7s

Copy link
Copy Markdown
Contributor

Description

perps-review-pr gains references/pack.json, a rule pack a machine can read. The generator builds it from the same families it already turns into the checklist and references. It follows ADR-0073 Amendment 1 (MetaMask/decisions#320).

The pack lists each criterion family with:

  • its anchor id, which is what its checklist row links;
  • its reference file;
  • its areas (each client's owned paths);
  • its class and status.

Each rule is listed with its cause. That is pre-0073 until an edit records the real one.

A family from a client file names that client in clients. A hosted review of one client then never expects another client's rows in its checklist.

The generator now refuses two families that share an anchor across files, and a client that has families but no owned paths.

The pack is inert for anyone using the skill directly. The checklist, the overlays and the references are unchanged, and a direct invocation does not read pack.json. Farmslot reads it once a project declares it, to freeze and validate the pack with the skill.

Generated output

  • 50 families and 157 rules, from recipe-perps f8b9642.
  • 17 families are shared. The rest are client families: Extension 11, Core 9, Mobile 8, Terminal 5.
  • No other generated file changes.

Tests

  • The two new tests in test/perps-review-generation.test.mjs failed before the generator change and pass after it:
    • the pack lists every family, and on each installed client checklist every family in that client's scope owns exactly one step;
    • a client without owned paths is refused.
  • The older fixtures now give every client its owned paths and give their two body families distinct titles.
  • yarn test passes, except source-sync-concurrency, which times out under local host load and is untouched here. yarn lint:changelog passes.
  • The real pack passes Farmslot's pack and selection decoders on all four installed checklists.

The generator writes references/pack.json beside the checklist: one
entry per criterion family with its anchor, reference file, areas,
class and status, and each rule with its cause. A family from a client
file names that client, so a hosted review of one client never expects
another client's rows. A direct invocation does not read the pack.
@abretonc7s
abretonc7s marked this pull request as ready for review November 18, 2026 14:48
@abretonc7s
abretonc7s requested a review from a team as a code owner November 18, 2026 14:48
@abretonc7s
abretonc7s enabled auto-merge (squash) November 18, 2026 14:49

@juanmigdr juanmigdr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

VERDICT: COMMENT
COMMIT: beb7412

references/pack.json is exactly the generator's output for this head: 50 families and 157 rules, every field consistent with the references and owned-paths.json, and each family linked by exactly one step of every checklist that carries it. One metadata gap against the pack contract, plus one wording nit.

Severity file:line Problem Ask
⚠️ Minor domains/perps/skills/perps-review-pr/scripts/materialize-review.mjs:209 No family uses the contract's always area, so the blocking-checks family is path-gated. On a diff that matches no owned path the selector may return every family unselected — including mobile-controller-integration-mocks, whose own rule is "Controller bump treated as lockfile-only". Emit { "always": true } for blocking-review-checks (client families must keep globs, since always takes no clients), decide where the cross-client parity trigger lives, then re-measure selection.
Nit domains/perps/skills/perps-review-pr/scripts/materialize-review.mjs:194 The message fires for a client that has no families of its own, because every shared family calls ownedPaths for all four clients. Reword to "which the pack needs paths for".
Details for agents
Status Item Evidence or gap Ask
⚠️ NOT_CHECKED Farmslot selector behaviour The pack contract's "Shipped so far" lists the decoders, declaration and freeze, but not the selectors or the per-family review children, so the live effect of the missing always marker could not be observed. Confirm the marker before this pack runs at level 3.
⚠️ NOT_CHECKED Canonical library at f8b9642 The committed pack was verified byte-for-byte against the head's own generated inputs (references/*.md, owned-paths.json, review-sources.json revision); matching the recipe library itself needs --check with that repository, which was not readable here. Run --check with the library before release.

➖ 157 Perps rules and 2 conformity steps not applicable to this diff; full ledger in the run artifacts: artifacts/review-ledger.md.

@abretonc7s
abretonc7s disabled auto-merge November 18, 2026 15:02
…ule pack

The blocking review checks apply to every diff, so the pack marks that
family { always: true } instead of gating it on the clients' code
paths. The owned-paths error now says the pack needs the client's
paths, since shared families need every client's.

@juanmigdr juanmigdr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@abretonc7s
abretonc7s merged commit a675bdf into main Nov 18, 2026
29 checks passed
@abretonc7s
abretonc7s deleted the feat/perps-review-pack branch November 18, 2026 15:48
cursor Bot pushed a commit that referenced this pull request Nov 18, 2026
Folds the post-branch merges into the curated 0.4.0 changelog per review:
#258/#262 (mm-harness 0.96.33) into the recipe entry, #260/#261 into the
perps-review-pr entry, #264 rule pack and #231 CV lint checklist as new
entries, drops the inaccurate analytics-move BREAKING entry, and links

Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
#207 on the tsc-blindspots entry.
@cursor cursor Bot mentioned this pull request Nov 18, 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.

2 participants