Skip to content

feat: enforce the write gate and command gate #378

Open

Description

@pacphi

Why

Report-only becomes enforcing (design: Making it stick).

In scope

OutOfScopeWrite throws; the command gate refuses; the lint rule errors.

Out of scope

New exceptions.

Acceptance criteria

  • An out-of-scope write fails the operation
  • The contract tests have no baseline exceptions left

Dependencies

Blocked by: #358, #373

Blocks: #379, #384, #388

Plan

Verification

  • pnpm test
  • pnpm run lint

Activity

  1. added this to the 4.0.0-beta.4 milestone on Oct 1, 2026
  2. added
    v4.0.0Routing: v4.0.0 board
    size:MA few modules; one to three days
    ws:project-scopeThe project-scoped management redesign
    on Oct 1, 2026
  3. pacphi commented on Oct 7, 2026

    @pacphi
    OwnerAuthor

    Decision: enforce in 4.0.0-beta.4 (option A)

    Decided by the maintainer on 2026-10-07. P7-01 keeps its place in 4.0.0-beta.4.

    Why

    • P7-01 is blocked by P5-04 (uninstall on project state) and P6-11 (Maintenance writes only in opted-in projects). The gates cannot enforce earlier without new exceptions, and this card rules new exceptions out.
    • Betas 1 to 3 run report-only. The contract tests in test: contract tests with the current violations as baseline #328 already fail CI on any new user-level write from beta.1.
    • The real-machine upgrade test (GA-06) in rc.1 is blocked by this card, so it runs on an enforcing build.

    This card is not the install cutover. Global installs are removed by P2-03 in beta.1, and latest moves at 4.0.0 GA. This card only starts refusing writes and commands. It relies on P2-03 having removed every npm install -g.

    Open points to settle in this card (found in the review of #467, where the report-only gates landed):

    • Should npm uninstall -g and npm update -g be reported or refused? Today the gate reports install forms only. ak itself runs npm uninstall -g in uninstall, so enforcement needs a deliberate rule.
    • What is the default scope of a claude mcp|plugin change with no -s? claude --help does not say, so the gate does not classify it today.
    • 26 files call child_process directly and bypass the command gate, which only covers run(). Decide whether enforcement covers them.

    Related: #327 (report-only gates, merged in #467), #328 (contract tests).

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

    size:MA few modules; one to three daysv4.0.0Routing: v4.0.0 boardws:project-scopeThe project-scoped management redesign

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions