Skip to content

mcpx: guard tests fail on clean main (settings chapters/scriptenv, defaults redeclaration/doc links) #8720

Closed

Description

@dezren39

🤖 Agent note · filed from lane any-c verification work (tasks 14963 / 14975).

Defect (pre-existing on main)

Guard tests in pkgs/mcpx fail on clean main 7c365ad7f0 (verified 2026-11-11):

  • internal/settings: TestEveryDocumentHasAChapter, TestTheScriptEnvironmentIsWhatTheCodeSets (MCPX_PARENT_SESSION_ID set by internal/daemon/scriptview.go but not listed in ScriptEnv).
  • internal/defaults: TestNoPackageRedeclaresADefault, TestEveryDocumentationLinkResolves (observed in a full go test ./... run during task 14963; not re-verified individually).

All reproduce on the untouched primary clone, unrelated to any in-flight change. These guards keep docs/settings/defaults honest, so a red main here trains everyone to ignore them.

Fix: reconcile each guard with the code/docs it watches (add the missing compendium chapters or roles, list MCPX_PARENT_SESSION_ID as a setter, and clear the defaults redeclarations / dead documentation links), or record why a guard's expectation is wrong and correct the guard.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)
    on Nov 11, 2026
  2. developing-today commented on Nov 11, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Released to the queue under Drew's 2026-11-13 unblock-all order (main chat, 23:53 CT). Task(s) 15294 moved from blocked/parked to queued in the fleet unblock-all pass (worker main-unblock-all-2026-11-13). Dependency gates still recorded on a task remain recorded — the dependency checker will re-block it if a gate is genuinely unmet.

  4. added a commit that references this issue on Nov 14, 2026
  5. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: triaged
    task: 15294 (repo-health-code-pilot, lane code-d)
    state: triaged — two of three remaining guards FIXED and merged (PR #9986); redeclaration guard routed as task 16870

    Fresh reproduction this shift (laptop, main e202485, go test ./internal/settings/ ./internal/defaults/):

    • The two settings guards named as filed (TestEveryDocumentHasAChapter, TestTheScriptEnvironmentIsWhatTheCodeSets) already PASS — fixed since the 2026-11-11 filing at 7c365ad.
    • Still failing at claim: settings TestTheEnvironmentDocIsCurrent (docs/environment.md stale) and both defaults guards.

    Fixed in-session, PR #9986 (merged, 491defc):

    • Environment doc regenerated via the guard's own -update mechanism; go test ./internal/settings/ now passes in full.
    • TestEveryDocumentationLinkResolves: 25 references to plugin/opencode/mcpx/daemon.ts / ops.gen.ts repointed to plugin/core/daemon.ts / plugin/core/ops.gen.ts — the files moved in the plugin-core relocation (9dd72a5, WIP: move shared mcpx daemon files into plugin core #7166) and the docs were never updated; plus one Go symbol in docs/public-client.md reworded so the checker no longer reads it as a path. That test now passes.

    Remaining: TestNoPackageRedeclaresADefault — 11 inline constants (cli adapter-import timeouts x2, daemon scriptWaitDelay, mcpauth failover token lifetimes x4, testsupport x4). Each needs a per-site call (move to defaults.json vs allowlist-with-reason); routed as task 16870 with the full inventory and that disposition rule in its packet. This issue stays open until task 16870 lands.

  6. added
    priority/normalOrdinary priority (the default)
    effort/mMedium: expected under 1 day of work
    and removed on Nov 14, 2026
  7. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · task 16870 parked with the fix scoped per-site — guard failure reproduced, mechanism identified

    Reproduced on clean main this claim: go test ./internal/defaults/ -run TestNoPackageRedeclaresADefault -count=1 (from pkgs/mcpx) FAILS with exactly the 11 findings in this task's title. Note #8720 itself is CLOSED (PR #9986's keyword) while this remainder is open work — the fix PR should reference #8720 and this task; reopen or re-file if the landing process needs a live issue.

    Mechanism (verified in tree): the guard (internal/defaults/guard_test.go) regex-scans packages for inline durations/shifts/limits/octal modes. Constants belong in internal/defaults/defaults.json (sections exist: pool, logging, daemon, secrets, cli, catalog, script, …), consumed via the internal/defaults package (already imported by internal/cli). Deliberate exceptions go in the guard's allowed map (guard_test.go ~line 52), keyed by the exact match, each with a stated reason — an allowlist, deliberately, so widening a pattern can't widen an exemption.

    Per-site disposition for the executing claim:

    1. internal/cli/adapter_import.go:685 + adapter_import_parse.go:444 — the same 10s import timeout twice: a product default. Add to defaults.json (cli section), reference via the defaults package at both sites.
    2. internal/daemon/scriptview.go:29 — scriptWaitDelay = 2s: daemon timing; defaults.json daemon section + reference.
    3. internal/mcpauth/failover.go:90 (60s), :273 (−5m refresh skew), :499 (−60s iat backdate), :500 (9m exp): token-lifetime parameters. Judge per value: lifetimes/skews a deployment could conceivably tune belong in defaults.json; values fixed by the token format's semantics belong in allowed with that reason stated. Do not move all four by reflex.
    4. internal/testsupport/eramcp/main.go:226 (2s), internal/testsupport/sweep.go:113 (10s grace), :115 (100ms poll): test-harness timing, not product defaults — allowed with reasons, unless the executing claim prefers defaults; either way the reason must be written.
    5. internal/testsupport/seed/seed.go:89 — (1<<63 - 1) is a non-negative-int64 bitmask, not a tunable default: allowed with that reason (the inlineShift pattern catches it incidentally).

    Acceptance for the executing claim: the named test passes; full pkgs/mcpx test suite run (the guard package plus affected packages at minimum); no behaviour change beyond constant sourcing (same values); PR references #8720 + task 16870. Parked from this claim because the remaining lease is minutes and items 3–4 require judgement, not haste.

  8. added a commit that references this issue on Nov 14, 2026
  9. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Agent note — task 16870 remainder COMPLETE (lane any-c, 2026-11-14)

    TestNoPackageRedeclaresADefault now passes in full — verified on the branch and again on merged main (151dc4a5c2, go test ./internal/defaults/ ok). All 11 inventoried sites dispositioned:

    Moved to defaults.json (real defaults):

    • cli import probes 10s (runCapture / runCaptureEnv) → preflight.probeTimeout (defaults.PreflightProbeTimeout)
    • daemon scriptview WaitDelay 2s → plumbing.scriptWait (defaults.ScriptWait)
    • mcpauth failover cooldown fallback ("zero means 60") → plumbing.failoverCooldown (defaults.FailoverCooldown)

    Allowlisted in the guard with reasons (no pattern widened, no outOfScope additions): mcpauth App JWT iat backdate 60s + lifetime 9m + installation-token refresh margin 5m (GitHub platform arithmetic: 10-minute JWT cap, 1-hour token life); testsupport eramcp reply window 2s, sweep leftover grace 10s / poll 100ms (harness timing); seed shuffle (1<<63 - 1) MaxInt63 mask (definition).

    Package evidence: go build ./... ok; daemon PASS (120.9s); mcpauth PASS; testsupport/... PASS. internal/settings and internal/cli failure sets are identical to clean main at the same base — pre-existing reds only (settings: TestEveryDocumentHasAChapter on docs/changes/research-and-findings-nix-slice.md, landed without a compendium chapter; cli: six manual/parity reds) — the family already tracked by #9017 / #8900, not regressions from this change and outside this packet's scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/mMedium: expected under 1 day of workepic/mcpx-platformReprioritization program epic (2026-11-12)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)status:done

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions