@davesheffer/hunch 1.39.1 → 1.39.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/dist/cli/index.js +67 -5
- package/dist/client/state.d.ts +2 -1
- package/dist/client/state.js +1 -0
- package/dist/core/agenthook.js +7 -3
- package/dist/core/capturetoken.d.ts +30 -3
- package/dist/core/capturetoken.js +29 -3
- package/dist/core/correction.d.ts +10 -4
- package/dist/core/correction.js +7 -4
- package/dist/core/countersign.d.ts +28 -0
- package/dist/core/countersign.js +50 -0
- package/dist/core/reviewqueue.js +6 -1
- package/dist/core/spawnCommand.js +41 -9
- package/dist/core/stateHttp.d.ts +1 -1
- package/dist/core/stateHttp.js +3 -1
- package/dist/core/taskReportEvidence.js +25 -5
- package/dist/core/topics.js +1 -1
- package/dist/integrations/scaffold.js +1 -1
- package/dist/mcp/server.js +110 -51
- package/dist/serve/app.d.ts +4 -0
- package/dist/serve/app.js +56 -36
- package/dist/store/stateBinding.js +28 -7
- package/dist/wiki/wiki.d.ts +7 -0
- package/dist/wiki/wiki.js +19 -8
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/wiki/wiki.js
CHANGED
|
@@ -33,6 +33,7 @@ import { writeFileAtomic } from "../core/io.js";
|
|
|
33
33
|
import { compareCodeUnits } from "../core/canonicalOrder.js";
|
|
34
34
|
import { hunchPaths, toPosixTarget } from "../core/paths.js";
|
|
35
35
|
import { isLive } from "../core/topics.js";
|
|
36
|
+
import { confirmCommand, isAgentTestimony } from "../core/countersign.js";
|
|
36
37
|
import { scanRepoDocs } from "../core/docscan.js";
|
|
37
38
|
import { adoptedSlug, adoptionHash, renderAdoptedDoc } from "./adopt.js";
|
|
38
39
|
import { assembleGraphData, renderGraphPage } from "./graph.js";
|
|
@@ -396,6 +397,10 @@ const NOW_ID = "_now";
|
|
|
396
397
|
const GRAPH_ID = "_graph";
|
|
397
398
|
/** Manifest component-id prefix for adopted (wiki-managed) doc copies. */
|
|
398
399
|
const ADOPTED_PREFIX = "doc:";
|
|
400
|
+
/** Marker for an unconfirmed roadmap item, naming the human countersign command. */
|
|
401
|
+
export function unconfirmedRoadmapMarker(item, opts = {}) {
|
|
402
|
+
return item.unconfirmed ? `⚠ unconfirmed agent testimony — confirm: ${confirmCommand(item.id, opts)}` : "";
|
|
403
|
+
}
|
|
399
404
|
/** The hot view's inputs: last `recentLimit` decisions by date (any status — a
|
|
400
405
|
* supersession IS activity), and every live PROPOSED decision (the roadmap:
|
|
401
406
|
* record intent as a proposed decision; accepting or superseding it removes it
|
|
@@ -405,15 +410,21 @@ export function nowData(decisions, recentLimit = 10) {
|
|
|
405
410
|
const byDateDesc = (a, b) => compareCodeUnits(b.valid_from ?? b.date, a.valid_from ?? a.date) || compareCodeUnits(a.id, b.id);
|
|
406
411
|
const recent = [...decisions].sort(byDateDesc).slice(0, recentLimit)
|
|
407
412
|
.map((d) => ({ id: d.id, topic: d.topic, title: d.title, status: d.status, date: (d.valid_from ?? d.date).slice(0, 10), note: clip1(d.decision) }));
|
|
408
|
-
// Roadmap = INTENT
|
|
409
|
-
//
|
|
410
|
-
//
|
|
413
|
+
// Roadmap = deliberately recorded INTENT: human-vouched, or recorded by an agent
|
|
414
|
+
// (hunch_record_decision, e.g. at the end of /capture) and not yet confirmed. The latter
|
|
415
|
+
// is shown MARKED with the human confirm command — never hidden, and never routed to
|
|
416
|
+
// `adopt-drafts` (which would accept it). Auto-synthesized drafts are also status
|
|
417
|
+
// "proposed", but they describe work already done and belong to the review queue
|
|
418
|
+
// (`hunch review`) — surfacing them here would bury real plans.
|
|
411
419
|
const live = decisions.filter((d) => d.status === "proposed" && !d.superseded_by && !d.valid_to);
|
|
412
|
-
const
|
|
413
|
-
const roadmap =
|
|
420
|
+
const intent = live.filter((d) => d.provenance.source.includes("human_confirmed") || isAgentTestimony(d.provenance.source));
|
|
421
|
+
const roadmap = intent
|
|
414
422
|
.sort(byDateDesc)
|
|
415
|
-
.map((d) => ({
|
|
416
|
-
|
|
423
|
+
.map((d) => ({
|
|
424
|
+
id: d.id, topic: d.topic, title: d.title, status: d.status, date: (d.valid_from ?? d.date).slice(0, 10), note: clip1(d.context || d.decision),
|
|
425
|
+
...(isAgentTestimony(d.provenance.source) ? { unconfirmed: true } : {}),
|
|
426
|
+
}));
|
|
427
|
+
return { recent, roadmap, pendingReview: live.length - intent.length };
|
|
417
428
|
}
|
|
418
429
|
/** The hot file — a DERIVED view like every other page: what just happened
|
|
419
430
|
* (last N decisions) and what's next (live proposed decisions). No topic pins
|
|
@@ -436,7 +447,7 @@ export function renderNowPage(recent, roadmap, home, pendingReview = 0) {
|
|
|
436
447
|
if (!roadmap.length)
|
|
437
448
|
L.push("_Empty. Record what's next as a PROPOSED decision (`/capture`, status: proposed) and it appears here._", "");
|
|
438
449
|
for (const r of roadmap)
|
|
439
|
-
L.push(`- **${r.title}** — ${r.note || "(no context)"} _(${r.id}${r.topic ? `, topic \`${r.topic}\`` : ""}, since ${r.date})_`);
|
|
450
|
+
L.push(`- **${r.title}** — ${r.note || "(no context)"} _(${r.id}${r.topic ? `, topic \`${r.topic}\`` : ""}, since ${r.date})_${r.unconfirmed ? ` — ${unconfirmedRoadmapMarker(r, { private: home.kind === "private" })}` : ""}`);
|
|
440
451
|
if (roadmap.length)
|
|
441
452
|
L.push("");
|
|
442
453
|
if (pendingReview > 0)
|
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
9
|
"websiteUrl": "https://www.hunchmemory.com",
|
|
10
|
-
"version": "1.39.
|
|
10
|
+
"version": "1.39.2",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
15
15
|
"identifier": "@davesheffer/hunch",
|
|
16
|
-
"version": "1.39.
|
|
16
|
+
"version": "1.39.2",
|
|
17
17
|
"runtimeHint": "npx",
|
|
18
18
|
"packageArguments": [
|
|
19
19
|
{
|