Skip to content

refactor(registry): extract shared descriptor traits and the first command families #4053

Closed

Description

@thymikee

Parent: #4045

Purpose

registry.ts is 2192 lines and changed nine times in the audited window. It remains one large edit surface despite ADR0027 allowing statement-neutral extraction.

Owner and scope

packages/command-registry/src/registry.ts, named descriptor-family modules and source-coupled tests. ADR0027 eager-closure rule is unchanged.

Required behavior

Extract cohesive command-family descriptor declarations inside command-registry. Retain the one synchronous typed composer, literal unions, exhaustive derived views and eager-loading semantics. Keep raw descriptor data and its named family tests together. Do not add async construction, broad barrels, a generator or growth waivers. Split into independently reviewable sequential PRs if the gross diff exceeds repo limits. This is PR1: shared trait/timeout bundles and a bounded first family batch only. Do not attempt the entire >1200-line extraction in one gross diff.

API or evidence example

PR1 relocates shared trait/timeout declarations and first descriptor family tuples into narrowly named modules; canonical assembly stays synchronous.

Observable completion

  • A coherent first extraction reduces registry.ts without changing any combined descriptor sequence or semantics.
  • All extracted runtime statements are relocated; ADR0027 containment, new-module novelty and flat weight pass against this PR's own base.
  • Literal inference, synchronous composition and exhaustive derived views remain intact.
  • Gross diff fits repository review limits; remaining families are explicitly left to D1b.

Dependencies and sequencing

Blocked by: none.

Validation

Registry tests, typecheck, eager-closure and package-size checks, pnpm format; broad refactor requires pnpm check serialized. Stage new modules before layering. Independent review at named commit.

Base audit SHA: 144bd59890277fd4717995588ad817597c9d6552. Re-read the issue and all Decision: comments before work. Read applicable AGENTS.md routes. Keep one owner boundary per PR. Independent review and serialized exact-head validation are coordinated by the umbrella orchestrator.

Activity

  1. thymikee commented on Oct 29, 2026

    @thymikee
    MemberAuthor

    Decision: accept both Terra findings at 010e608669. R66 now includes descriptor-traits.ts and has a conditional-spread capability-bucket probe. Command explanation attribution derives the local-cli declaration path from the existing catalog group, with web positive and public-command negative pins; no second command list. Corrections 32f91d768b and fixture correction 28d1d6e538 retain all admission invariants in the probes. Parent97 registry/explanation tests and8R66 tests pass; lint/typecheck/full format pass. The first probe run failed because both new probe fixtures omitted the required admission module; the fixture correction adds that module rather than suppressing the failure. Full affected/full broad, eager closure, bundle-owner-files and package-size proof remain pending. No publication yet.

  2. thymikee commented on Oct 29, 2026

    @thymikee
    MemberAuthor

    Current state: Lower-layer draft PR #4075 is published at 28d1d6e5388e7819b2330a5a6663847a594079d1, base audit 144bd59890. Terra's R66 and command-explanation findings are corrected. Registry/explanation 97 tests and eight R66 tests passed. The serialized full gate is running: tooling and Fallow passed so far; no full-pass claim. Upper layer #4076 explicitly targets this branch.

  3. thymikee commented on Oct 29, 2026

    @thymikee
    MemberAuthor

    Current state: Full validation at 28d1d6e538 passed tooling and Fallow, then failed unit with 16,228 passed, three failed and one skipped. All failures timed out at 5 seconds: macos-helper-package-contents.test.ts, fallow-fixture-policy.test.ts, and the snapshotMissingInteractiveFlag help-falsification case. Receipt .tmp/validation/run-E46Oxu/receipt.json, exactCommit true. These failures are not attributed to #4060. Their cause remains unproven until the same failing check is compared on unchanged base 144bd59890. Draft #4075 is not merge-ready.

  4. thymikee commented on Oct 29, 2026

    @thymikee
    MemberAuthor

    Current state: The fresh unchanged-base comparison at 144bd59890277fd4717995588ad817597c9d6552 passed the same unit check resolved through pnpm gate unit (pnpm run check:unit), with default worker configuration. Results: 1,836 Vitest files passed, 16,231 tests passed and one skipped; smoke 76 passed / six skipped. This does not reproduce the three head timeouts and does not prove host contention. The head's full receipt remains failed; causality remains unproven. The disposable checkout had a frozen install/build and was removed; reviewed heads/statuses were preserved. Next proof: identify the slow subprocess phases for the three failures before changing an owner or budget.

  5. thymikee commented on Oct 29, 2026

    @thymikee
    MemberAuthor

    Current state: Both registry stack layers are merged externally at the heads validated in this review round: #4075 at 7fe445bc687ec3a6c5c50c0e80602f61f01ab64a, and #4076 at 2b0c79b50cfecef206ea6f465fe8827116b5bc29. Full local validation passed tooling, Fallow and unit at both heads. Receipts: lower .tmp/validation/run-4I5ydK/receipt.json; upper .tmp/validation/run-2x6jaj/receipt.json; both exactCommit true. Upper validation used its own lower-layer base. The attempted ready transition found the PRs already closed; no merge was performed by the orchestrator.

    The guidance budget remains 40,000 bytes; both heads use 39,987 bytes. Five guidance tests and ten R66 tests pass. Range-diff is retained locally and shows the expected ownership-row conflict resolutions. Historical failed provider/time-budget checks remain historical failures; these full-command passes do not establish their cause or imply skipped CI lanes passed.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions