Commit 66feddb
hyp policy: class-neutral machine-local marking verb (LLP 0110/0111) (#327)
* Design: hyp policy verb (covers LLP 0110)
Generated-by: neutral
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Plan: hyp policy verb (LLP 0112, implements LLP 0111)
Generated-by: neutral
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Hoist ignore/unignore marking internals into verb-agnostic shared impls
Extract runMarkMachineLocal, runUnmarkMachineLocal, and runIgnoreCheck in
src/core/commands/clients.js so they take an explicit resolved targetDir
instead of computing it from parsed argv, and add repoRootDefaultTarget as
the one shared repo-root-default placement rule. This is a pure refactor
with zero behavior change: the flag branches in runIgnore/runUnignore now
resolve the target and delegate, but stdout/stderr/exit codes are unchanged,
so all existing ignore/unignore tests pass unmodified. This sets up both
the flag forms and the future hyp policy runners (LLP 0112 T2) to call one
implementation instead of drifting. Carries the existing @ref LLP 0103#cli
annotations along with the moved code; gloss updates come in T6.
Task-Id: T1
* Register hyp policy set/show/unset/list, delegating to shared T1 internals
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
* Turn ignore/unignore marking flags into deprecated policy aliases
The --sync/--local-only/--private/--check branches in runIgnore/runUnignore
already delegate to the T1 hoisted internals (runMarkMachineLocal,
runUnmarkMachineLocal, runIgnoreCheck) that the T2 policy runners call, so
the delegation seam is single-implementation by construction and alias
behavior cannot drift from the verb's. This task makes the compatibility
posture explicit:
- Annotate the delegation seam in both runners with
// @ref LLP 0111#aliases [implements], noting the flag forms' repo-root
defaulting is preserved at the alias edge (and unignore's cwd-relative
no-default target likewise).
- Mark the --local-only/--private/--sync/--check flags "deprecated: use
hyp policy ..." in the hyp ignore / hyp unignore registry help, while
stating the bare dotfile verbs are not deprecated. No runtime stderr
warning (LLP 0111 #aliases).
Zero behavior change: every existing alias test passes unchanged (stdout,
stderr, exit codes, JSON fields, usage_policy.mark log event), the
compatibility proof LLP 0110's exit criteria require. npm test (2284),
typecheck, and build:types all green.
@ref LLP 0111#aliases [implements]
Task-Id: T3
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Migrate classification hook copy to hyp policy set (LLP 0106, 0110, 0111)
Swap the consent-sensitive classification hook copy off the deprecated
`hyp ignore --sync`/`--local-only`/`--private` misnomer and onto the
class-neutral `hyp policy set <path> <token>` verb (registered since T2).
- CLASSIFICATION_CHOICES: replace the `flag` field with the CLI-edge class
`token` (`sync`/`local-only`/`ignore`).
- verbArgvForClass now returns ['policy', 'set', targetPath, token], dispatched
against the registry's two-word `policy set` path.
- buildClassificationPrompt prints `hyp policy set <cwd> <token>`.
- Pinned consent-copy tests updated in the same commit, plus an exit-criterion
assertion that no ignore-spelled command is taught for a non-ignore class.
- @ref glosses cite LLP 0111#teaching for the verb surface; the store and class
rationale keeps citing LLP 0103#cli.
Task-Id: T4
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* T5: migrate skill and status/help teaching copy to the hyp policy verb
Both hypaware-privacy SKILL.md bodies (claude + codex) now teach the
machine-local marking surface as `hyp policy set/show/unset` instead of
the `hyp ignore --sync/--local-only/--private/--check` and
`hyp unignore --<class>` misnomer. The bare `.hypignore` dotfile verbs
are left untouched. Both bodies stay byte-consistent with each other.
Swept the remaining runtime help strings that pointed users at the
marking flags: the login durable-command hint (DURABLE_HINT) and the
purge durability tip now name `hyp policy set ...`, with their pinned
teaching-copy test assertions moved in the same commit. The alias
behavior tests (hyp ignore --*/hyp unignore --*) are untouched and still
pass as the compatibility proof.
No product surface teaches an ignore-spelled command for a non-ignore
class. Classification hook copy (classification.js) is out of scope here
(T4); the JSDoc on the alias runners keeps naming the old flags because
those functions are the aliases.
@ref LLP 0111#teaching [implements]
@ref LLP 0110 [implements]
Task-Id: T5
* Ref hygiene sweep for hyp policy verb (LLP 0110/0111)
Ran ref-check across the touched hyp-policy-verb surface (clients.js,
policy.js, classification.js, core_commands.js, both hypaware-privacy
SKILL.md bodies, and LLP 0103/0110/0111/0112) and found the verb-surface
@ref citations already correct from T2-T5. The remaining stale spots
were three doc comments left over from T1's carry-forward
(repoRootDefaultTarget, runMarkMachineLocal, runIgnoreCheck) that still
described the policy set/show runners as "a future task" and described
repoRootDefaultTarget as shared with the future policy verb, when in
fact policy set/show now exist and policy set deliberately never calls
repoRootDefaultTarget (it marks the resolved path exactly as pointed at,
per LLP 0111 #set). Corrected those glosses to state the current,
already-landed relationship instead of a stale forward-looking one.
Verified LLP 0103's Extended-by: LLP 0110 forward-ref still reads
correctly against the final shipped verb surface. ref-check's only
remaining findings in touched files are two pre-existing false
positives against LLP 0086's HTML-anchor sections (the tool only scans
markdown headings), unrelated to this change set and present before
T1-T5 touched this file.
No behavior change. npm test (2284 tests) and npm run typecheck both
pass.
Task-Id: T6
* Complete hyp policy doc sweep: hyp ignore --check -> hyp policy show in sibling skills
Folds in the deferred minor review finding from PR #327 review round 1
(the sensitive-scan and reference skills still taught the deprecated
hyp ignore --check alias). Doc-only; no behavior change.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: neutral-loop <neutral-loop@localhost>1 parent 8185f65 commit 66feddb
18 files changed
Lines changed: 1248 additions & 133 deletions
File tree
- hypaware-core/plugins-workspace
- claude/skills
- hypaware-privacy
- hypaware-sensitive-scan
- codex/skills
- hypaware-privacy
- hypaware-reference
- hypaware-sensitive-scan
- llp
- src/core
- cli
- commands
- usage-policy
- test/core
Lines changed: 11 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | | - | |
96 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
Lines changed: 11 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
0 commit comments