@holdyourvoice/hyv 3.4.0 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +66 -127
- package/dist/cli.js +365 -327
- package/dist/fact-linter.js +107 -98
- package/dist/mcp.js +43 -192
- package/dist/rebuild-task.test.js +1 -1
- package/dist/stage1-evaluation.js +74 -48
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/Readme.md
CHANGED
|
@@ -2,179 +2,118 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@holdyourvoice/hyv)
|
|
4
4
|
|
|
5
|
-
Hold Your Voice is a local
|
|
5
|
+
Hold Your Voice (`hyv`) is a local writing checker. It helps you edit AI-assisted writing without losing your own writing patterns.
|
|
6
6
|
|
|
7
|
-
It runs two checks
|
|
7
|
+
It runs two independent checks:
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
9
|
+
- VoiceDNA compares a draft with a profile built from your writing samples.
|
|
10
|
+
- AI Editor finds deterministic patterns that often make writing generic or formulaic.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
The package also checks hidden Unicode, source-backed facts, document logic, and protected claims. All checks run locally, without model calls, automatic draft changes, or runtime network requests.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
## install
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
**Requirements:** Node.js 20+, npm, and at least two writing samples you have the right to use.
|
|
19
|
-
|
|
20
|
-
### Install
|
|
16
|
+
You need Node.js 20 or newer and at least two writing samples you have the right to use.
|
|
21
17
|
|
|
22
18
|
```bash
|
|
23
19
|
npm install --global @holdyourvoice/hyv
|
|
24
|
-
hyv patterns
|
|
25
20
|
```
|
|
26
21
|
|
|
27
|
-
|
|
22
|
+
For a one-off command, replace `hyv` with `npx @holdyourvoice/hyv`.
|
|
23
|
+
|
|
24
|
+
## basic workflow
|
|
28
25
|
|
|
29
|
-
|
|
26
|
+
1. Build a local profile from your samples.
|
|
30
27
|
|
|
31
28
|
```bash
|
|
32
|
-
hyv profile profile.json samples/one.md samples/two.md
|
|
29
|
+
hyv profile profile.json samples/one.md samples/two.md
|
|
33
30
|
```
|
|
34
31
|
|
|
35
|
-
|
|
32
|
+
Add `--avoid=phrase` for wording that must block a draft. Repeat the option for more phrases.
|
|
36
33
|
|
|
37
|
-
|
|
34
|
+
2. Check a draft against that profile.
|
|
38
35
|
|
|
39
36
|
```bash
|
|
40
37
|
hyv analyze draft.md profile.json
|
|
41
38
|
```
|
|
42
39
|
|
|
43
|
-
The result
|
|
44
|
-
|
|
45
|
-
```json
|
|
46
|
-
{
|
|
47
|
-
"voiceDna": { "score": 93, "passed": true, "findings": [] },
|
|
48
|
-
"aiEditor": { "score": 88, "passed": true, "findings": [] },
|
|
49
|
-
"hygiene": { "suspiciousCount": 0, "fixableCount": 0, "hits": [] },
|
|
50
|
-
"passed": true
|
|
51
|
-
}
|
|
52
|
-
```
|
|
40
|
+
The result contains separate VoiceDNA and AI Editor reports. The top-level `passed` value is true only when every required check passes.
|
|
53
41
|
|
|
54
|
-
|
|
42
|
+
3. Create an editing brief, edit the draft, and verify the candidate.
|
|
55
43
|
|
|
56
44
|
```bash
|
|
57
45
|
hyv rewrite-prompt draft.md profile.json > rewrite-brief.md
|
|
58
46
|
hyv verify draft.md candidate.md profile.json
|
|
59
47
|
```
|
|
60
48
|
|
|
61
|
-
|
|
49
|
+
Send the brief to a human editor or a model you choose. Delivery stays under your control.
|
|
62
50
|
|
|
63
|
-
|
|
51
|
+
4. Check the exact text before delivery.
|
|
64
52
|
|
|
65
53
|
```bash
|
|
54
|
+
hyv final-check candidate.md
|
|
66
55
|
producer | hyv final-check -
|
|
67
|
-
hyv final-check final-response.md
|
|
68
56
|
```
|
|
69
57
|
|
|
70
|
-
`final-check`
|
|
58
|
+
`final-check` writes accepted text to stdout. It withholds output and exits with code `2` when unresolved hidden Unicode remains.
|
|
71
59
|
|
|
72
|
-
|
|
60
|
+
## commands
|
|
73
61
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
hyv
|
|
77
|
-
|
|
62
|
+
| Command | Purpose |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| `hyv profile <profile.json> <sample...>` | Build a local profile from two or more samples. |
|
|
65
|
+
| `hyv analyze <draft> <profile.json>` | Run VoiceDNA, AI Editor, and hygiene checks. |
|
|
66
|
+
| `hyv hygiene <draft> [--fix]` | Inspect hidden Unicode or write a conservative cleaned copy. |
|
|
67
|
+
| `hyv inspect-hidden-text <draft> [policy.json]` | Inspect hidden text with an optional policy. |
|
|
68
|
+
| `hyv apply-hidden-text-policy <draft> <policy.json> <output>` | Apply approved hidden-text removals. |
|
|
69
|
+
| `hyv final-check <path\|->` | Gate the exact text before delivery. |
|
|
70
|
+
| `hyv fact-lint <draft\|-> --source=id:path` | Check claims against local source files. |
|
|
71
|
+
| `hyv logic-lint <draft\|-> [brief.json]` | Check deterministic document logic. |
|
|
72
|
+
| `hyv batch-analyze <draft...>` | Find repeated openings and endings across drafts. |
|
|
73
|
+
| `hyv rewrite-prompt <draft> <profile.json>` | Create a constrained editing brief. |
|
|
74
|
+
| `hyv prepare-rewrite ...` | Create a fingerprint-bound edit task. |
|
|
75
|
+
| `hyv apply-rewrite ...` | Apply and verify a response to an edit task. |
|
|
76
|
+
| `hyv prepare-judgment ...` | Create a pre-edit or post-candidate judgment task. |
|
|
77
|
+
| `hyv reduce-judgment <envelope...>` | Reduce judgments to SHIP, EDIT, REBUILD, CLEAR, or ESCALATE. |
|
|
78
|
+
| `hyv prepare-rebuild ...` | Create an authorized whole-document rebuild task. |
|
|
79
|
+
| `hyv rebuild-writer-request ...` | Create the writer-only part of a rebuild task. |
|
|
80
|
+
| `hyv apply-rebuild ...` | Apply and verify an authorized rebuild response. |
|
|
81
|
+
| `hyv verify <original> <candidate> <profile.json>` | Verify a candidate without changing learning state. |
|
|
82
|
+
| `hyv verify-spec ...` | Verify a candidate and a CopySpec. |
|
|
83
|
+
| `hyv lifecycle ...` | Run semantic review and final approval steps. |
|
|
84
|
+
| `hyv learning ...` | Inspect or change local profile learning. |
|
|
85
|
+
| `hyv patterns` | Print the active AI Editor rule catalog. |
|
|
86
|
+
| `hyv agent list\|validate\|describe\|emit` | Inspect or emit portable agent contracts. |
|
|
87
|
+
| `hyv mcp` | Start the local MCP server on standard input/output. |
|
|
78
88
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
## The editing loop
|
|
82
|
-
|
|
83
|
-
```mermaid
|
|
84
|
-
flowchart LR
|
|
85
|
-
S[Your samples] --> P[Build profile]
|
|
86
|
-
P --> D[VoiceDNA profile]
|
|
87
|
-
T[Draft] --> A[Analyze]
|
|
88
|
-
D --> A
|
|
89
|
-
A --> V[VoiceDNA report]
|
|
90
|
-
A --> E[AI Editor report]
|
|
91
|
-
V --> B[Tiered brief]
|
|
92
|
-
E --> B
|
|
93
|
-
B --> C[Human or chosen model]
|
|
94
|
-
T --> G[Verify candidate]
|
|
95
|
-
C --> G
|
|
96
|
-
D --> G
|
|
97
|
-
G --> R[Errors block; findings stay visible]
|
|
98
|
-
R --> H[final-check before output]
|
|
99
|
-
```
|
|
89
|
+
Most commands return JSON. Exit code `0` means the command completed, `2` means a content or policy gate failed, and `1` means the command or input was invalid.
|
|
100
90
|
|
|
101
|
-
|
|
91
|
+
Run `hyv <command>` without enough arguments to see its exact usage. Read the [CLI reference](docs/wiki/CLI-Reference.md) for every option.
|
|
102
92
|
|
|
103
|
-
##
|
|
93
|
+
## portable agents and MCP
|
|
104
94
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
| `hyv prepare-rewrite` / `apply-rewrite` | Fingerprint-bound sentence or range edits. |
|
|
111
|
-
| `hyv prepare-rebuild` / `apply-rebuild` | Whole-document rebuild after an authorized recommendation. |
|
|
112
|
-
| `hyv prepare-judgment` / `reduce-judgment` | Reduce findings to SHIP, EDIT, or REBUILD. |
|
|
113
|
-
| `hyv lifecycle` | Semantic and human-review lifecycle steps. |
|
|
114
|
-
| `hyv learning show` | Inspect local voice-memory preferences. |
|
|
115
|
-
|
|
116
|
-
## Commands
|
|
117
|
-
|
|
118
|
-
| Command | Input | Output |
|
|
119
|
-
| --- | --- | --- |
|
|
120
|
-
| `hyv profile <profile.json> <sample...>` | Two or more text files | Profile JSON |
|
|
121
|
-
| `hyv analyze <draft> <profile.json>` | Draft and profile | Analysis JSON |
|
|
122
|
-
| `hyv hygiene <draft> [--fix] [--output=path]` | Draft | Hygiene report or cleaned copy plus receipt |
|
|
123
|
-
| `hyv inspect-hidden-text <draft> [policy.json]` | Draft and optional policy | Hidden-text inspection report |
|
|
124
|
-
| `hyv apply-hidden-text-policy <draft> <policy.json> <output.md>` | Draft and approved policy | Sanitized output plus receipt |
|
|
125
|
-
| `hyv final-check <path\|->` | Any final text | Accepted text on stdout or a withheld-output report |
|
|
126
|
-
| `hyv logic-lint <draft\|-> [writing-brief.json]` | Draft and optional brief | Deterministic logic-lint report |
|
|
127
|
-
| `hyv rewrite-prompt <draft> <profile.json>` | Draft and profile | Markdown editing brief |
|
|
128
|
-
| `hyv prepare-rewrite <draft> <profile.json> <task.json>` | Draft and profile | Versioned task file |
|
|
129
|
-
| `hyv apply-rewrite <task.json> <response.json> <profile.json>` | Task, response, profile | Candidate evaluation JSON |
|
|
130
|
-
| `hyv prepare-judgment <pre-edit\|post-candidate> <kind> <draft> <profile.json> <task.json> [candidate.md]` | Draft, profile, optional candidate | Versioned judgment task |
|
|
131
|
-
| `hyv reduce-judgment <envelope.json> ...` | Signed judgment envelopes | Recommendation JSON |
|
|
132
|
-
| `hyv prepare-rebuild <draft> <profile.json> <reduction.json> <copy-spec.json> <task.json> [--recomposition-policy policy.json]` | Draft, recommendation, CopySpec, capability, optional policy | Versioned rebuild task |
|
|
133
|
-
| `hyv rebuild-writer-request <task.json> <writer-request.json>` | Rebuild task | Writer-only rebuild request |
|
|
134
|
-
| `hyv apply-rebuild <task.json> <response.json> <profile.json>` | Task, response, profile, capability | Candidate evaluation JSON |
|
|
135
|
-
| `hyv verify <original> <candidate> <profile.json>` | Original, candidate, profile | Verification JSON and exit code |
|
|
136
|
-
| `hyv verify-spec <original> <candidate> <profile.json> <copy-spec.json>` | Original, candidate, profile, CopySpec | Verification JSON with hard claim gate |
|
|
137
|
-
| `hyv learning <show\|inspect\|add\|record\|record-approved\|ratify\|supersede\|migrate\|clear> ...` | Profile, operation, bounded metadata | Preferences or a text-free receipt |
|
|
138
|
-
| `hyv lifecycle <prepare-semantic\|submit-verdict\|inspect\|validate-final-approval\|finalize> ...` | Versioned lifecycle artifacts | Lifecycle artifact or metadata |
|
|
139
|
-
| `hyv patterns` | None | Ruleset JSON |
|
|
140
|
-
| `hyv mcp` | None | Local MCP server on stdio |
|
|
141
|
-
| `hyv agent list\|validate\|describe\|emit <id> [--host HOST] [--mode prompt\|json] [--output FILE]` | Optional agent id | Portable agent contract (see below) |
|
|
142
|
-
|
|
143
|
-
Every file argument can be `-` when the command accepts input on standard input. Use `npx @holdyourvoice/hyv <command>` if you have not installed the CLI globally.
|
|
144
|
-
|
|
145
|
-
## Portable agents
|
|
146
|
-
|
|
147
|
-
The 23 writing and runtime commands are also model-neutral portable agent packages under `skills/hyv-*/` (an `agent.json` contract, a `SKILL.md`, and an `agents/openai.yaml` interface), mirroring the clean-code portable-agent pattern. `hyv agent list` prints every package; `hyv agent validate [id]` checks the contract schema; `hyv agent describe <id> --host HOST` resolves permissions against a host catalog; and `hyv agent emit <id> --mode prompt|json --host HOST` emits a host-aware contract. The subcommand stays local. `emit --output` creates a new contract file and refuses an existing target. Read the [portable agents guide](docs/wiki/Portable-Agents.md) for the package contract, host model, and examples.
|
|
148
|
-
|
|
149
|
-
## Privacy
|
|
150
|
-
|
|
151
|
-
Your samples, drafts, profiles, and candidates stay on your machine. Verification is read-only. Learning commands can write text-free local events under `~/.hyv/learning/` — profile fingerprint, finding IDs, counts, and an opaque digest. No writing text is uploaded, and the package makes no runtime network requests.
|
|
152
|
-
|
|
153
|
-
Keep writing samples, edit histories, and client text out of public commits unless you hold the rights and a provenance record. A profile is aggregated JSON and can still reveal vocabulary, so store private profiles outside public repositories.
|
|
154
|
-
|
|
155
|
-
## Documentation
|
|
156
|
-
|
|
157
|
-
| Read this | When you need |
|
|
158
|
-
| --- | --- |
|
|
159
|
-
| [The Wiki](https://github.com/shashank-sn/holdyourvoice/wiki) | Product and contributor docs. |
|
|
160
|
-
| [Architecture](docs/ARCHITECTURE.md) | Source boundaries and extension rules. |
|
|
161
|
-
| [Prompt contract](docs/PROMPT-CONTRACT.md) | The tier order and editing constraints. |
|
|
162
|
-
| [VoiceDNA](docs/VOICE-DNA.md) | The 13 profile elements. |
|
|
163
|
-
| [Fact linter](docs/wiki/Fact-Linter.md) | The source-consistency checker. |
|
|
164
|
-
| [Portable agents](docs/wiki/Portable-Agents.md) | Load or emit a host-aware contract for one HYV command. |
|
|
165
|
-
| [Support](SUPPORT.md) | Funding without a feature gate. |
|
|
95
|
+
The `skills/hyv-*` directories package the CLI workflows as portable agent contracts. Use `hyv agent validate` to check them and `hyv agent emit` to create a host-specific prompt or JSON contract.
|
|
96
|
+
|
|
97
|
+
The MCP server exposes the same local engine for compatible hosts. Read [Portable Agents](docs/wiki/Portable-Agents.md), [Claude Desktop setup](docs/CLAUDE-DESKTOP.md), or [Claude Code setup](docs/CLAUDE-CODE.md).
|
|
98
|
+
|
|
99
|
+
## privacy and safety
|
|
166
100
|
|
|
167
|
-
|
|
101
|
+
Drafts, samples, profiles, candidates, and source files stay on your machine. The package has no accounts, telemetry, hosted analysis, or runtime network requests.
|
|
102
|
+
|
|
103
|
+
Learning commands can write text-free events under `~/.hyv/learning/`. A manually added learning instruction is stored as entered. Keep private writing, profiles, and client data out of public repositories.
|
|
104
|
+
|
|
105
|
+
VoiceDNA fit, AI-pattern findings, fact consistency, and human approval are separate results. A clean report only states that its configured checks passed. Authorship, factual truth, and publication quality still need separate evidence or review.
|
|
106
|
+
|
|
107
|
+
## development
|
|
168
108
|
|
|
169
109
|
```bash
|
|
110
|
+
npm ci
|
|
170
111
|
npm test
|
|
171
112
|
npm run check:release
|
|
172
113
|
```
|
|
173
114
|
|
|
174
|
-
Read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request.
|
|
175
|
-
|
|
176
|
-
`@holdyourvoice/hyv` publishes automatically when a change reaches `main`. Bump the version in `package.json` in the same pull request as a release-worthy change; the workflow publishes only if that version is not already on npm.
|
|
115
|
+
Read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request. The main design boundaries are in [Architecture](docs/ARCHITECTURE.md) and the full user guides are in the [wiki](https://github.com/shashank-sn/holdyourvoice/wiki).
|
|
177
116
|
|
|
178
|
-
##
|
|
117
|
+
## license
|
|
179
118
|
|
|
180
|
-
[MIT](LICENSE). Third-party writing and data
|
|
119
|
+
[MIT](LICENSE). Third-party writing and data keep their own rights.
|