Skip to content

T2: Register hyp policy set/show/unset/list command group#322

Merged
philcunliffe merged 1 commit into
integration/hyp-policy-verbfrom
task/hyp-policy-verb/T2
Jul 17, 2026
Merged

T2: Register hyp policy set/show/unset/list command group#322
philcunliffe merged 1 commit into
integration/hyp-policy-verbfrom
task/hyp-policy-verb/T2

Conversation

@philcunliffe

Copy link
Copy Markdown
Contributor

Implements task T2 of the hyp-policy-verb change set (LLP 0110/0111/0112).

  • Registers the hyp policy command group via makeGroupCommand plus
    policy set / show / unset / list entries in
    src/core/cli/core_commands.js.
  • Adds thin runners in src/core/commands/policy.js that parse argv
    (required path for set, optional for show, required path + optional
    trailing class for unset) and delegate to the T1 internals.
  • Generalizes runMarkMachineLocal / runUnmarkMachineLocal /
    runIgnoreCheck in src/core/commands/clients.js: exported, and the
    mark/unmark internals now take a component attribute so telemetry
    still names the dispatching verb (cmd-ignore/cmd-unignore vs
    cmd-policy-set/cmd-policy-unset).
  • policy unset <path> with no trailing token is class-neutral: removes
    every machine-local entry governing the path regardless of class.
    policy unset <path> <class> stays class-scoped, shared with the
    existing unignore aliases.
  • CLI-edge token mapping (sync/local-only/ignore -> full/local-only/ignore)
    with unknown-token usage errors (exit 2) naming all three valid tokens.
  • policy list enumerates the machine-local store with --json {entries, path}.
  • policy show --json stays byte-compatible with ignore --check --json.
  • New test/core/policy-command.test.js (24 tests) mirroring
    test/core/ignore-private-sync-command.test.js for the new spellings,
    plus list enumeration and class-neutral unset coverage.

Test plan

  • npm install (runs prepare -> build:types, 0 errors)
  • npm run typecheck
  • npm test (2284 passed, 1 pre-existing skip, 0 failed)

Task-Id: T2

…rnals

Adds the hyp policy command group (LLP 0110/0111) as the class-neutral
successor to the ignore --sync/--local-only/--private aliases: thin
runners in src/core/commands/policy.js parse CLI args and delegate to
the shared runMarkMachineLocal/runUnmarkMachineLocal/runIgnoreCheck
internals in clients.js, now exported and parameterized by a
`component` attribute so telemetry still names the dispatching verb.

runUnmarkMachineLocal gains a class-neutral mode (targetClass
undefined) backing `policy unset <path>` with no trailing token,
removing every machine-local entry governing a path regardless of
class, alongside the existing class-scoped removal used by both
`unignore` and `policy unset <path> <class>`.

`policy list` enumerates the machine-local store directly with a
--json {entries, path} shape; `policy show` reuses runIgnoreCheck so
its --json output stays byte-compatible with `ignore --check --json`.

New test/core/policy-command.test.js mirrors the existing
ignore-private-sync-command coverage for the new spellings, plus list
enumeration and class-neutral unset across multiple governing
entries.

Task-Id: T2
@philcunliffe
philcunliffe merged commit 7cbd2ee into integration/hyp-policy-verb Jul 17, 2026
4 checks passed
@philcunliffe
philcunliffe deleted the task/hyp-policy-verb/T2 branch July 17, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant