@davesheffer/hunch 1.8.2 → 1.9.2
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 +96 -1
- package/dist/cli/index.js +1238 -396
- package/dist/constitution/adapters.js +31 -14
- package/dist/constitution/behaviorEvaluator.js +20 -7
- package/dist/constitution/behaviorProof.js +3 -2
- package/dist/constitution/canonical.js +7 -1
- package/dist/constitution/card.js +7 -2
- package/dist/constitution/compiler.js +71 -1
- package/dist/constitution/correctionPolicyMaterializer.js +496 -0
- package/dist/constitution/delta.js +3 -2
- package/dist/constitution/evaluator.js +29 -3
- package/dist/constitution/experiment.js +96 -5
- package/dist/constitution/experimentRunner.js +43 -14
- package/dist/constitution/g2BehaviorCandidates.js +49 -26
- package/dist/constitution/g2BehaviorDependencies.js +203 -14
- package/dist/constitution/g2Candidates.js +1 -1
- package/dist/constitution/lifecycle.js +17 -0
- package/dist/constitution/plan.js +26 -9
- package/dist/constitution/replacementFreeGit.js +67 -0
- package/dist/constitution/replay.js +6 -0
- package/dist/constitution/replayCache.js +1 -1
- package/dist/constitution/replayWorker.js +1 -1
- package/dist/constitution/repository.js +141 -5
- package/dist/constitution/safeCheckout.js +75 -0
- package/dist/constitution/schema.js +30 -5
- package/dist/constitution/service.js +74 -14
- package/dist/constitution/sourceMutation.js +65 -12
- package/dist/constitution/staticGraphBaseline.js +44 -0
- package/dist/constitution/structural.js +60 -4
- package/dist/core/autoreview.js +1 -1
- package/dist/core/canonicalOrder.js +6 -0
- package/dist/core/conformance.js +68 -27
- package/dist/core/docscan.js +2 -1
- package/dist/core/escalations.js +11 -0
- package/dist/core/io.js +44 -9
- package/dist/core/overlaySafety.js +178 -0
- package/dist/core/paths.js +13 -2
- package/dist/core/safeRepoFile.js +74 -0
- package/dist/extractors/comments.js +6 -8
- package/dist/extractors/git.js +1631 -82
- package/dist/extractors/indexer.js +86 -47
- package/dist/extractors/repoSource.js +390 -0
- package/dist/integrations/ciAction.js +10 -2
- package/dist/integrations/gitignore.js +44 -5
- package/dist/integrations/mergeDriver.js +23 -5
- package/dist/integrations/sync.js +61 -5
- package/dist/integrations/team.js +666 -23
- package/dist/mcp/server.js +261 -34
- package/dist/store/db.js +57 -7
- package/dist/store/hunchStore.js +92 -11
- package/dist/store/jsonStore.js +350 -63
- package/dist/store/schema.js +27 -11
- package/dist/synthesis/provider.js +13 -4
- package/dist/synthesis/synthesize.js +56 -19
- package/dist/wiki/graph.js +5 -4
- package/dist/wiki/wiki.js +16 -10
- package/package.json +15 -3
- package/tooling/competitive-watch.mjs +108 -0
- package/tooling/md1-benchmark.mjs +628 -0
package/README.md
CHANGED
|
@@ -13,6 +13,14 @@ relevant context before it makes a change.
|
|
|
13
13
|
Memory starts **advisory**. Nothing blocks until you explicitly trust a precise rule and choose
|
|
14
14
|
strict enforcement.
|
|
15
15
|
|
|
16
|
+
**Memory is the input. The product boundary is the receipt:** relevant evidence before an edit,
|
|
17
|
+
then a deterministic check of the change against the rules your team has explicitly trusted.
|
|
18
|
+
|
|
19
|
+
> **New in v1.9.2:** Matrix mode gives the whole team one live, private Git memory across fresh
|
|
20
|
+
> clones, worktrees, CLI checks, and MCP assistants. npm publishes with short-lived OIDC
|
|
21
|
+
> credentials, while the editor companion ships as one immutable, publicly verified Open VSX
|
|
22
|
+
> artifact.
|
|
23
|
+
|
|
16
24
|
## Start in five minutes
|
|
17
25
|
|
|
18
26
|
Requires Node 22.13+ and a git repository.
|
|
@@ -66,6 +74,81 @@ hunch firmness strict
|
|
|
66
74
|
hunch check --staged --strict
|
|
67
75
|
```
|
|
68
76
|
|
|
77
|
+
## Share one living team memory
|
|
78
|
+
|
|
79
|
+
Matrix mode keeps the team's decisions, corrections, constraints, and proofs in one dedicated Git
|
|
80
|
+
repository, separate from the code repository. Hunch does not host that repository: create a private
|
|
81
|
+
Git repo that every teammate can access, install the Matrix release on team machines and CI, then
|
|
82
|
+
have one maintainer run:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
npm i -g @davesheffer/hunch@1.9.2
|
|
86
|
+
hunch shared --repo git@github.com:acme/project-hunch-memory.git
|
|
87
|
+
git add .gitignore .hunch/team.json
|
|
88
|
+
git commit -m "chore: connect shared Hunch memory"
|
|
89
|
+
git push
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Use a credential-free URL in the command; keep tokens in your Git credential helper or use SSH.
|
|
93
|
+
If this project already publishes memory in `.hunch/` and you want to move it into the dedicated
|
|
94
|
+
repo, add `--migrate`, review the reported untrack/ignore changes, and follow the commit instructions
|
|
95
|
+
printed by Hunch. Omit `--migrate` for a new setup.
|
|
96
|
+
|
|
97
|
+
After the pointer commit lands, teammates need Hunch installed and Git access to the memory repo:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
npm i -g @davesheffer/hunch@1.9.2
|
|
101
|
+
git pull
|
|
102
|
+
hunch init
|
|
103
|
+
hunch doctor
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
`hunch init` validates and connects an ignored local clone of the memory repo. Memory-reading and
|
|
107
|
+
writing CLI operations attempt a bounded refresh at startup; connected MCP sessions check for new
|
|
108
|
+
team memory at each tool-request boundary and rebuild their local index only when the JSON changed.
|
|
109
|
+
New captures route to that repo and are committed and synchronized automatically by default. If a
|
|
110
|
+
push cannot complete, a later capture or `hunch shared --sync` retries it.
|
|
111
|
+
|
|
112
|
+
The committed `.hunch/team.json` contains only the credential-free memory-repo locator and canonical
|
|
113
|
+
branch. The ignored `.hunch/local.json` contains local paths and preferences, not credentials;
|
|
114
|
+
authentication stays in SSH or the normal Git credential helper. Shared memory records,
|
|
115
|
+
`.hunch/local.json`, and `.hunch-private/` stay out of code history. Use
|
|
116
|
+
`hunch check --base origin/main --strict --public-only --format markdown` for output that may be
|
|
117
|
+
posted publicly; omit `--public-only` for an internal check that should enforce team memory.
|
|
118
|
+
|
|
119
|
+
For a correction that Hunch can express as a deterministic policy, create and inspect its
|
|
120
|
+
proof-backed proposal:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
hunch policy upgrade-correction con_...
|
|
124
|
+
hunch policy card pol_...
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
The upgrade creates evidence, a plan, and a proof but leaves the policy proposed with
|
|
128
|
+
`authority: none`. In v1.9 its source-currentness activation gate is deliberately blocked, so even a
|
|
129
|
+
human cannot activate an upgraded correction yet. Other proved policy types still require an
|
|
130
|
+
explicit audited human acceptance before they can become advisory or blocking; Hunch never grants
|
|
131
|
+
that authority automatically.
|
|
132
|
+
|
|
133
|
+
Need to pause or roll back without deleting memory?
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
hunch firmness off
|
|
137
|
+
hunch shared --repo git@github.com:acme/project-hunch-memory.git --no-auto-commit
|
|
138
|
+
# Later, publish any pending local memory explicitly:
|
|
139
|
+
hunch shared --sync
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The first command turns off agent-hook enforcement; the second keeps shared reads and local captures
|
|
143
|
+
but stops automatic memory commits and pushes. As a team-coordinated rollback, revert the setup
|
|
144
|
+
commit to stop discovery after teammates pull the revert. Existing machines retain their ignored
|
|
145
|
+
local overlay until they are deliberately disconnected; do not delete the memory repo as part of a
|
|
146
|
+
rollback. For this rollout, reinstall the previous published package with
|
|
147
|
+
`npm i -g @davesheffer/hunch@1.8.5`; the release receipt resolves and records that exact rollback
|
|
148
|
+
target from the npm registry instead of trusting Git tags. Version 1.8.5 fails closed when it sees a
|
|
149
|
+
v1.9 source-gated correction policy, so pause enforcement first as shown above and upgrade every
|
|
150
|
+
team client to v1.9 before resuming Matrix policy workflows.
|
|
151
|
+
|
|
69
152
|
## Synthesis without surprise billing
|
|
70
153
|
|
|
71
154
|
Hunch can draft structured memory through:
|
|
@@ -97,12 +180,24 @@ hunch private --repo git@github.com:you/project-memory.git
|
|
|
97
180
|
|
|
98
181
|
Local tools see the combined graph; public CI and committed documentation stay public-only.
|
|
99
182
|
|
|
183
|
+
## Releases you can trace to source
|
|
184
|
+
|
|
185
|
+
Hunch releases are built and tested without publication credentials. The resulting npm tarball or
|
|
186
|
+
VSIX is content-addressed, carried unchanged into a minimal publisher, and checked again against the
|
|
187
|
+
registry after publication. The npm path also runs native, atomic-write, and Matrix safety checks on
|
|
188
|
+
Windows and macOS and verifies provenance back to the exact source tag.
|
|
189
|
+
|
|
190
|
+
The editor companion is published from an exact `vscode-v*` tag to
|
|
191
|
+
[Open VSX](https://open-vsx.org/extension/davesheffer/hunch-vscode). The workflow verifies the
|
|
192
|
+
downloaded public VSIX has the same digest as the credential-free release candidate.
|
|
193
|
+
|
|
100
194
|
## Learn more
|
|
101
195
|
|
|
102
196
|
- [Full documentation](https://hunch-pi.vercel.app/docs)
|
|
103
197
|
- [Copy-paste cookbook](https://hunch-pi.vercel.app/cookbook)
|
|
104
|
-
- [VS Code extension](vscode-extension/README.md)
|
|
198
|
+
- [VS Code extension guide](vscode-extension/README.md)
|
|
105
199
|
- [Contributing](CONTRIBUTING.md)
|
|
106
200
|
- [Architecture benchmark](bench/architectural-conformance.md)
|
|
201
|
+
- [Competitive landscape (dated; re-verify before quoting)](docs/competitive-landscape.md)
|
|
107
202
|
|
|
108
203
|
Apache-2.0
|