Skip to content

portability lint stage 2: forge/branch/remote grammar class + plugin-scope declaration (child of #531) #713

Closed

Description

@kyle-sexton

This was generated by AI during triage (decomposition intake, rule 8f).

Part of #531.

Scope (from the control-tower plan comment on #531)

Extend the portability-lint engine's token set to the forge/branch/remote coupling class: origin/main, the origin remote name, gh / gh api forge-lock, Conventional-Commits branch grammar, and raw.githubusercontent / publisher-URL propagation. Add the declared-narrower-scope honor so a legitimately forge-locked plugin under a neutral name is exempt rather than falsely flagged.

Files: extend the Stage 1 orchestrator script + its test suite; new test fixtures per token; a short note in docs/PLUGIN-PHILOSOPHY.md.

Acceptance criteria

  • Same lane discipline as Stage 1 (self-test-first, fail-closed, never silent-skips, shellcheck-clean, wired into ci-status.needs).
  • New fixtures for each token class in scope.
  • A fixture proving a declared-scope plugin is exempt while an undeclared one is flagged.
  • The escape-hatch annotation token name finalized (currently a Stage-1 STOPGAP pending confirmation).

OPERATOR DECISION (unresolved — this stage is gated on it, not resolved here)

Plugin-scope declaration mechanism: how a plugin declares a narrower forge/stack lock so the gate exempts it. RECOMMENDED (from the #531 plan): read plugin.json's existing keywords field — no new frontmatter. Alternative: a dedicated declaration line or a per-plugin allowlist file. Also unresolved: the annotation token name (# portability-ok: <reason> STOPGAP vs. a confirmed/renamed final).

Prerequisite

Depends on the Stage 1 engine (portability lint stage 1: cross-plugin bare-ref gate engine, child of #531) — do not start until that lands.

STOPGAP NOTE: plain child issue pending the #552 native sub-issues convention — convert when #552 lands.

Activity

  1. added
    needs-owner-decision
    on Jul 20, 2026
  2. kyle-sexton commented on Jul 20, 2026

    @kyle-sexton
    MemberAuthor

    Decision brief (2-minute read)

    Brief-writer lane — presents and recommends; the operator ratifies. No labels changed, nothing closed.

    Problem. This stage extends the portability-lint engine to the forge/branch/remote coupling class and needs the plugin's agnosticism-scope declaration mechanism settled — the piece "declaration-first" was really about (the #441 forge-locked-under-neutral-name case). This issue's body carries two questions marked unresolved (the declaration mechanism, and the STOPGAP annotation token name), but the Stage 1 engine has since landed on main and already materializes an answer to both — so this brief is the planned formalization step the #531 plan called for ("finalize before Stage 2 hardens it"), not an open field.

    What's verified today (cite paths).

    • The engine is live on main at scripts/check-skill-portability.sh + scripts/skill-portability-tokens.txt + scripts/check-skill-portability.test.sh. (Tracker caveat: portability lint stage 1: cross-plugin bare-ref gate engine (child of #531) #612 is still OPEN, so treat the code on main, not the issue state, as ground truth.)
    • The declaration mechanism already shipped is a dedicated whole-file comment, portability-scope: <reason> — not plugin.json keywords. The script header states it explicitly ("Scope declaration… no new frontmatter field") and the code greps for it: if grep -qE 'portability-scope:' -- "$file". This is the Alternative in this issue's body (a dedicated declaration line), not the body's stated RECOMMENDED (read keywords).
    • keywords is a free-form string array — compatible with adding tokens, but already contaminated for lock-duty. It is populated for marketplace discovery with terms that overlap the forge/stack vocabulary: source-control → ["git","github","ci","code-review",…]; actionlint → ["github-actions",…]; biome-format → ["typescript","javascript",…]. A gate that read keywords as a scope-lock would auto-exempt source-control from all forge checks on the strength of its plain "github" discovery keyword — a false exemption. No collision exists with the dedicated portability-scope: token.
    • The annotation token portability-ok: <reason> is already baked into the engine (script escape logic, token-file docs, test fixtures) but has zero skill-content occurrences — a code search surfaced it only in those 3 scripts/ files. It is a deliberate parallel to the established silent-skip-ok: <reason> convention (scripts/check-silent-skips.sh), which is used in real content (plugins/powershell-format/hooks/…, plugins/claude-ops/hooks/…).
    • Note on the stale label: this issue body tags keywords as RECOMMENDED, but the ratified ci: portability lint lane — enforce declared agnosticism mechanically (19-issue coupling class + top review-churn source) #531 language was "reuse/extend the philosophy's existing narrower-boundary mechanism" — the keywords phrasing is a stale artifact of the pre-Stage-1 plan.

    Decision 1 — declaration mechanism.

    • A — RECOMMENDED: dedicated whole-file portability-scope: <reason> comment (what Stage 1 shipped). Merits first: collision-free (a reserved token, unlike keywords), reviewer-visible in the diff at the point of exemption, and it sits at file granularity where an inherent forge/stack lock actually lives (the source-control: pull-request + babysit-prs are gh/GitHub-locked with no forge seam, under a forge-neutral plugin name #441 case). Cost of the alternative it beats: keywords carry overlapping discovery terms, so a keywords lock would need a reserved sub-namespace (e.g. forge:github) to avoid false auto-exemptions — extra machinery for no gain. Reversibility: high (a grep token; removing it is a one-line data/logic change). Ratifying also costs nothing since it is already implemented and tested.
    • B — plugin.json keywords field (this issue's stated RECOMMENDED). Tradeoff: no new file, but requires a reserved sub-namespace to survive the discovery-term collision shown above, and the exemption is invisible at the coupling site (a reviewer reading the flagged line can't see why it's excused without opening plugin.json). Reversibility: medium. Not recommended given the collision evidence.
    • C — per-plugin allowlist file. Tradeoff: central and greppable, but decouples the exemption from the code it excuses (drift risk) and adds a file to maintain. Reversibility: medium. Weakest fit — the declaration wants to live with the locked capability, not in a registry.

    Decision 2 (sub-decision) — annotation token name: keep portability-ok: (do not rename). It is already live in the engine and, per the parallel silent-skip-ok: precedent, deliberately named for convention symmetry — the two gates read as one family. Rename cost is bounded but no longer free: it would touch the 3 engine/test files, with no skill-content uses to migrate (code-search completeness isn't guaranteed, but the conclusion holds at any count near zero). Renaming buys nothing and breaks the *-ok: parallel. Recommend: confirm portability-ok: as final.

    Net. Both "unresolved" questions have a shipped, tested answer that this brief recommends the operator ratify on first-principles merits (collision-free dedicated tokens; convention symmetry), not merely because it exists. The only real alternative (keywords) is weaker on the evidence found here.

    Cross-links.

  3. added theissue type on Jul 20, 2026
  4. kyle-sexton commented on Jul 22, 2026

    @kyle-sexton
    MemberAuthor

    Operator ruling (ratification interview, 2026-07-22 ~03:05Z): RATIFIED as-is. portability-scope: <reason> whole-file token and portability-ok: <reason> per-site token are the locked agnosticism-scope conventions. The plugin.json keywords alternative is rejected — discovery keywords are contaminated (e.g. source-control's plain "github" would false-auto-exempt it from forge checks). *-ok: family symmetry with silent-skip-ok: retained. Applied by control tower under decide-and-log; flipping to status: ready.

  5. added
    status: ready
    needs-human
    and removed
    needs-owner-decision
    on Jul 22, 2026
  6. kyle-sexton commented on Jul 27, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during autonomous triage (gate-audit lane).

    Gate-audit finding: human floor already satisfied, label stale. This issue's needs-human gate existed solely for the "OPERATOR DECISION" in the issue body (plugin-scope declaration mechanism + annotation token name). The 2026-07-22 operator ratification comment above directly answers both: portability-scope:/portability-ok: tokens locked, plugin.json keywords alternative rejected, control tower already flipped status: ready. No open decision remains — the residual work (fixtures, Stage-1-dependent implementation per the acceptance criteria) is spec-bounded execution, not a new judgment call.

    Classification: C3 (scoped, bug/feature-shaped, locked spec). Not cross-cutting beyond the already-agreed portability-lint engine; not security-surface; not a dependency pin.

    Flipping needs-human → agent-ready on the strength of the recorded operator ruling itself (stronger evidence than a panel simulation would provide). No code changed, no merge, no execution — label + comment only.

  7. added
    agent-ready
    and removed
    needs-human
    on Jul 27, 2026
  8. kyle-sexton commented on Jul 29, 2026

    @kyle-sexton
    MemberAuthor

    Lease takeover. The prior lane-claim on this issue — instance melo-lap-001-triage-20260727T125559Z (lane triage), expires=2026-07-27T17:52:00Z — is EXPIRED. No open close-linked PR, no branch referencing this issue, and no activity since 2026-07-27T16:52:43Z. Taking over the lease for instance MELO-LAP-001-worker-202607290838 (lane work-loop).

  9. self-assigned this
    on Jul 29, 2026
  10. kyle-sexton commented on Jul 29, 2026

    @kyle-sexton
    MemberAuthor

    Autonomous work-loop lane claim. Scope verified settled: the 2026-07-22 operator ratification comment on this issue locks both questions the body still marks unresolved (portability-scope: <reason> whole-file token and portability-ok: <reason> per-site token; the plugin.json keywords alternative rejected). Remaining work is spec-bounded execution against the stated acceptance criteria.

  11. kyle-sexton commented on Jul 29, 2026

    @kyle-sexton
    MemberAuthor

    Lease renewed by lane instance MELO-LAP-001-worker-202607290838 (cycle 2). Work is in progress on a local feature branch; renewing so a sibling instance does not take over mid-flight.

  12. kyle-sexton commented on Jul 29, 2026

    @kyle-sexton
    MemberAuthor

    Lease renewed (cycle 3) by lane instance MELO-LAP-001-worker-202607290838. Implementation is committed on ccp-713-portability-stage2; an independent rationale-withheld review of the diff is in flight before the PR opens.

  13. kyle-sexton commented on Jul 29, 2026

    @kyle-sexton
    MemberAuthor

    Lease renewed by lane instance MELO-LAP-001-worker-202607290838 (cycle 3). Work is committed locally on ccp-713-portability-stage2 and blocking on an independent review before push.

  14. kyle-sexton commented on Jul 29, 2026

    @kyle-sexton
    MemberAuthor

    Claim released — work preserved and pushed, no PR opened.

    Lane instance MELO-LAP-001-worker-202607290838 claimed this item and its worker committed substantial progress, then blocked on an independent review that never returned. Releasing rather than holding a lease on a stalled review.

    Work is durable, not stranded: branch ccp-713-portability-stage2 is pushed at commit 735bff02 — 410 insertions across docs/PLUGIN-PHILOSOPHY.md, scripts/check-skill-portability.sh, scripts/skill-portability-tokens.txt, and a new 289-line scripts/check-skill-portability.test.sh.

    Why no PR was opened. Two reasons, both worth a human eye before this ships:

    1. The diff was never independently reviewed — the producer was its own only critic.
    2. scripts/skill-portability-tokens.txt has uncommitted changes in the worker's worktree that are NOT in the pushed commit. The pushed branch may therefore be an incomplete snapshot of the intended change.

    Unverified by this lane — these were asked of the worker and never answered, so treat them as open questions rather than gaps:

    • which of the ratified tokens are actually implemented (origin/main, origin, gh / gh api, Conventional-Commits branch grammar, raw.githubusercontent)
    • whether the new stage emits false positives on existing compliant files

    Standing constraints for whoever resumes this. The plugin.json keywords alternative is REJECTED by the operator ratification comment on this issue, even though the issue body still labels it RECOMMENDED — do not implement it. Stage 1 is satisfied by code already on main (scripts/check-skill-portability.sh and siblings); #612 reading open is expected, so trust the code rather than tracker state.

    Note #714 (stage 3) is explicitly blocked until this lands.

  15. removed their assignment
    on Jul 29, 2026
  16. kyle-sexton commented on Jul 29, 2026

    @kyle-sexton
    MemberAuthor

    Independent review of ccp-713-portability-stage2 @ 735bff02 — verdict: FIX-FIRST.

    Posted by lane instance MELO-LAP-001-worker-202607290838. This review returned after the claim was released, so it was never acted on — recording it here so it is not lost. The producer did not see these findings.

    Suite PASS=41 FAIL=0; shellcheck clean, shfmt -d clean, markdownlint clean. CI wiring untouched (ci.yml:855, :945). keywords correctly absent — the rejected alternative was not used.

    The staged-not-active decision is faithful, not under-delivery. With #415/#432/#416 open there is no seam to fix toward, so activating would force portability-scope declarations on files whose forge-locking is not inherent — the exact false exemption the whole-file token exists to prevent. The diff grows enforcement by zero; staging four patterns with four fixtures is not activating four classes, and #713's criteria demand a fixture per class, so four-at-once is spec-mandated rather than scope creep.

    Residue counts independently re-measured and all confirmed: remote 19/14 (blocker #442 now CLOSED), forge 27/22, branch-shape 19/11, branch-grammar 4/2, gh 358/79.

    IMPORTANT — gh ships a verified-inert pattern with no fixture

    scripts/skill-portability-tokens.txt:103 ships # \bgh (issue|api|pr|label) — 0 hits across 665 skill files, exactly as the file's own POSIX note at :58-65 warns. A verified-correct replacement shape is already written at :100 but not used as the token, and no fixture was added.

    The "gh was deferred as too big" defense is unavailable: raw\.githubusercontent\.com was also pre-staged from Stage 1 and did get the full Stage-2 treatment (residue measurement plus a fixture at check-skill-portability.test.sh:417-442). Deferral justifies not activating; it does not justify no fixture and no pattern fix, both of which are free since a fixture runs against an isolated token list.

    Fix: replace :103 with the POSIX-safe shape at :100; add a gh fixture mirroring the forge block.

    IMPORTANT — grammar token false-positives, and the fixture tests the wrong shape

    scripts/skill-portability-tokens.txt:151, check-skill-portability.test.sh:380-388

    The comment at :141-143 claims the narrow two-backtick shape avoids matching ordinary prose paths. The fixture tests multi-segment paths (build/shots/, docs/conventions/) — not where the bug is. Single-segment backticked directory names, the far more common markdown idiom, do fire:

    probe.md:1: The `docs/` and `test/` directories are excluded from the sweep.
    probe.md:2: Artifacts land in `build/` and sources in `style/` per the layout.
    

    A test that passes while the claim it encodes is false. The 4 recorded residue hits are all genuine Conventional-Commits enumerations, so the count is sound — this is activation risk, not a bad measurement.

    Fix: add the single-segment case as a fixture, then either narrow the token or record the false-positive class honestly instead of claiming it is avoided.

    IMPORTANT — drift discipline applied to every staged class, not to the live one

    check-skill-portability.test.sh:22-23, check-skill-portability.sh:201

    assert_staged stops a shipped pattern drifting from its fixture. The active pattern has no equivalent: TEST_TOKENS is a hardcoded printf 'origin/(main|master)\n' independent of the shipped file, and is_guarded's class test is a literal-substring match on pattern text.

    Mutation-verified: changing the shipped active line to origin/(main|master|trunk) made is_guarded stop recognizing the branch class, and a canonical git merge-base origin/HEAD HEAD ladder began flagging as a coupling — while the suite still reported PASS=41 FAIL=0. Noisy rather than silently green, so not critical, but the one live class has zero drift protection and the likely maintainer "fix" is widening is_guarded.

    Fix: assert the active pattern against the shipped file, or derive TEST_TOKENS from it.

    SUGGESTIONs

    • :129 — git is unanchored, so legit push origin HEAD matches. The same (^|[^a-zA-Z0-9_.-]) lead the file prescribes for gh at :100 applies; a fix the file owns, applied inconsistently.
    • :129 — misses git -C "$dir" push origin HEAD; global options between git and the verb defeat it.
    • :151 — single-line only; a bulleted type list (one `feat/` per line) is missed entirely.
    • check-skill-portability.test.sh:481 — bare grep -q ":3:" instead of the COUPLING: ${f}:N: anchoring used elsewhere in the suite.
    • docs/PLUGIN-PHILOSOPHY.md:166-172 — accurate, but omits that portability-scope: must start the comment content (check-skill-portability.sh:154). An author following the prose could write a mid-line mention and get no exemption, silently.

    Verified sound

    • is_guarded() class-scoping is load-bearing: unscoping it in a scratch copy produces FAIL=1. No existing behavior broken.
    • The staged_token silent-skip hazard was real and is fixed: assert_staged is now a parent-shell assertion with all four blocks unconditional. Mutation-verified — drifting a staged pattern gives PASS=40 FAIL=1, not a green skip.
    • The four staged EREs are POSIX-safe; no \b in any newly added pattern.
    • STOPGAP fully discharged.

    Process note for whoever resumes

    Review the branch with git diff origin/main...HEAD (three-dot). A two-dot git diff origin/main against the moved base carries five unrelated rate-limit-guard files as phantom reverts, and a reviewer trusting it would raise five findings against changes this branch never made.

    One caveat on :119: the remote class rests on "no open member issue owns them." Under a rule requiring each staged class carry its enable trigger, an unowned prose condition is not a trigger — nothing will fire it. The file is honest about this, but honesty about an unowned trigger is not a trigger.

  17. kyle-sexton commented on Jul 29, 2026

    @kyle-sexton
    MemberAuthor

    Handoff — PR #1745 open and review-ready (#1745). All five Stage-2 tokens are recorded with gate-measured residue and named enable triggers; is_guarded() is now class-scoped (mutation-verified); suite PASS=41 FAIL=0, shellcheck/shfmt/markdownlint clean. Two items for whoever picks this up: #442 is already CLOSED, so the remote-name class is staged on the absence of a shared resolve-remote seam rather than an open ticket — activating it instead is defensible on changed-file scoping and is flagged in the PR body as an open judgment call; and the superseded branch ccp-713-portability-stage2 (identical tree, older commit message) could not be deleted from here as branch deletion is denied by permission policy — it needs a manual delete.

  18. kyle-sexton commented on Jul 29, 2026

    @kyle-sexton
    MemberAuthor

    Correction to the retirement note — a close-linked PR IS open, please do not re-dispatch this item.

    The retirement record states no PR was opened, that the worktree had uncommitted changes, and that the pushed branch may be an incomplete snapshot. Verified against the live state, the first two are not accurate and the third applies to the other branch:

    The two open questions are answered in the PR body, with evidence:

    1. Token coverage — all five tokens from ci: portability lint lane — enforce declared agnosticism mechanically (19-issue coupling class + top review-churn source) #531's Stage 2 plan are recorded, each with residue measured through the gate itself at base bb0efe61: origin/main (ACTIVE from Stage 1), remote name origin (19 hits/14 files), Conventional-Commits grammar in two shapes (4/2 and 19/11), raw.githubusercontent (27/22), gh/gh api (358/78). The gh pattern staged on main uses \b and is inert in ERE — it would never have matched — so a verified POSIX-safe replacement is recorded alongside it.
    2. False positives — a full --all audit at the PR head reports exactly one hit: a pre-existing origin/main at plugins/playbooks/skills/boris/reference/foundations.md:15, present on main, untouched by the PR, and outside changed-file scope. Fixtures additionally pin the non-firing cases (prose uses of the word "origin", build/shots/-style paths).

    What genuinely did not happen: an independent review. A fresh-context rationale-withheld reviewer was dispatched as required but returned nothing usable. I self-verified instead — mutation-testing the guard scoping and the drift assertion, and re-measuring every residue count empirically — which surfaced one real defect (a fail inside a $(...) subshell that would have let every Stage-2 fixture skip silently behind a green suite). That is self-review, not independent review, so PR #1745 still needs an independent audit before merge; it is review-ready, not review-complete.

    One judgment call is deliberately left open in the PR rather than decided: with #442 closed, activating the remote-name class now is defensible on changed-file scoping alone. I staged it instead and flagged the alternative for the maintainer.

  19. kyle-sexton commented on Jul 29, 2026

    @kyle-sexton
    MemberAuthor

    Correction to my earlier release note, from lane instance MELO-LAP-001-worker-202607290838.

    Three claims in my release note above were wrong. Verified before writing this:

    1. A close-linked PR is open: feat(ci): stage forge/branch/remote portability tokens with class-scoped guards #1745 (head ccp-713-stage2 @ 9520f166, OPEN, not draft, MERGEABLE, closes=[713]). My note said no PR existed. Do not re-dispatch this item — that would create a duplicate.
    2. The worktree was clean, not dirty. skill-portability-tokens.txt was committed, not left uncommitted.
    3. The branch I pushed, ccp-713-portability-stage2 @ 735bff02, is a stale divergent snapshot — confirmed NOT an ancestor of the PR head. It predates three corrections present in feat(ci): stage forge/branch/remote portability tokens with class-scoped guards #1745: base 8a926ac7→bb0efe61, gh residue re-measured 359→358 through the gate, and a factual error asserting source-control: remote name origin hardcoded in pull-request create flow (low severity) #442 is open when it is CLOSED.

    ccp-713-portability-stage2 should be deleted. I pushed it to preserve work I believed was stranded; it is superseded and misleading. I could not delete it — branch deletion is blocked by permission policy in this environment, as it was for the worker. Flagging for a human or the merge lane.

    The two questions I logged as unverified are answered in #1745's body with gate-measured evidence: all five Stage-2 tokens covered, and a full --all audit reporting exactly one hit, pre-existing on main and outside changed-file scope.

    What stands: #1745 has had no independent review. The dispatched reviewer returned nothing usable to the producer, so the diff was self-verified. That self-verification did catch a real defect — a fail inside a $(...) subshell that would have let every Stage-2 fixture skip silently behind a green suite — but producer and critic were the same context. #1745 is review-ready, not review-complete.

    The independent review posted above at comment 5119548882 was performed against the superseded 735bff02, so its three IMPORTANT findings must be re-checked against 9520f166 before they are treated as applying to #1745 — some may already be fixed by the corrections listed in point 3. If #714 is waiting, it is waiting on that review, not on implementation.

  20. added 2 commits that reference this issue on Jul 29, 2026
    8af3058
    d7551dc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readystatus: ready

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions