Skip to content

Decompose runWriteGate (583 lines) into ordered verdict steps #220

Closed as not planned

Description

@abogartz

Finding

runWriteGate (src/gates.ts:248) is 583 lines. Gate order - size/type floor, dedup, quarantine, schema, ref freshness, rate limit, tombstone, merge gate - is the plugin's central invariant, expressed as one function's local control flow. createInjectionEpochs (src/injection-epochs.ts:28, 287 lines) is the second candidate.

Fix direction

Split into ordered steps that each return a verdict; reduce runWriteGate to the composer. Every step becomes independently testable, and the composer gives viewer writes (see the gate-bypass ticket) a reusable entry point.

Source

Architecture review 2026-10-31, finding O1. Prerequisite for the viewer-write gate ticket.

Activity

  1. added
    enhancement
    severity:medium
    agent:ready
    on Nov 1, 2026
  2. added
    spec:incomplete
    on Nov 3, 2026
  3. ocsi-triager commented on Nov 3, 2026

    @ocsi-triager

    Not agent-ready: src/gates.ts and src/injection-epochs.ts no longer exist on main (the gate now lives at src/gate/gate.ts), and no measurable acceptance criterion is stated. Either add it or close this.

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:readyenhancementseverity:mediumspec:incomplete

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions