@davesheffer/hunch 1.31.0 → 1.32.0
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 +3 -6
- package/dist/cli/automaticReviewMemory.d.ts +13 -0
- package/dist/cli/dna.d.ts +2 -0
- package/dist/cli/index.d.ts +16 -0
- package/dist/cli/index.js +602 -43
- package/dist/cli/integrations.d.ts +2 -0
- package/dist/cli/integrations.js +5 -2
- package/dist/cli/invocation.d.ts +35 -0
- package/dist/cli/preflight.d.ts +1 -0
- package/dist/cli/reviewMemory.d.ts +4 -0
- package/dist/cli/reviewMemoryProvider.d.ts +14 -0
- package/dist/cli/serve.d.ts +2 -0
- package/dist/cli/taskReport.d.ts +6 -0
- package/dist/cli/taskReport.js +124 -0
- package/dist/cli/update.d.ts +14 -0
- package/dist/client/state.d.ts +248 -0
- package/dist/client/state.js +2 -0
- package/dist/constitution/adapters.d.ts +29 -0
- package/dist/constitution/behaviorAttestationBinding.d.ts +3 -0
- package/dist/constitution/behaviorEvaluator.d.ts +8 -0
- package/dist/constitution/behaviorProof.d.ts +9 -0
- package/dist/constitution/behaviorWorkspace.d.ts +25 -0
- package/dist/constitution/bootstrap.d.ts +30 -0
- package/dist/constitution/canonical.d.ts +15 -0
- package/dist/constitution/card.d.ts +58 -0
- package/dist/constitution/compiler.d.ts +52 -0
- package/dist/constitution/composition.d.ts +10 -0
- package/dist/constitution/corpus.d.ts +7 -0
- package/dist/constitution/correctionPolicyMaterializer.d.ts +57 -0
- package/dist/constitution/delta.d.ts +4 -0
- package/dist/constitution/disposition.d.ts +20 -0
- package/dist/constitution/evaluator.d.ts +47 -0
- package/dist/constitution/experiment.d.ts +466 -0
- package/dist/constitution/experimentRunner.d.ts +7 -0
- package/dist/constitution/g2.d.ts +209 -0
- package/dist/constitution/g2BehaviorAttestation.d.ts +45 -0
- package/dist/constitution/g2BehaviorCandidates.d.ts +123 -0
- package/dist/constitution/g2BehaviorDependencies.d.ts +83 -0
- package/dist/constitution/g2BehaviorMaterialization.d.ts +77 -0
- package/dist/constitution/g2BehaviorPolicyMaterializer.d.ts +48 -0
- package/dist/constitution/g2CandidateAttestation.d.ts +43 -0
- package/dist/constitution/g2Candidates.d.ts +80 -0
- package/dist/constitution/g2Drills.d.ts +33 -0
- package/dist/constitution/g3.d.ts +311 -0
- package/dist/constitution/g3Conformance.d.ts +33 -0
- package/dist/constitution/lifecycle.d.ts +25 -0
- package/dist/constitution/mutation.d.ts +15 -0
- package/dist/constitution/nodeTestEvidence.d.ts +13 -0
- package/dist/constitution/plan.d.ts +18 -0
- package/dist/constitution/policyRuntime.d.ts +5 -0
- package/dist/constitution/proof.d.ts +11 -0
- package/dist/constitution/repairPolicies.d.ts +34 -0
- package/dist/constitution/replacementFreeGit.d.ts +14 -0
- package/dist/constitution/replay.d.ts +40 -0
- package/dist/constitution/replayCache.d.ts +14 -0
- package/dist/constitution/replayWorker.d.ts +1 -0
- package/dist/constitution/repository.d.ts +129 -0
- package/dist/constitution/safeCheckout.d.ts +9 -0
- package/dist/constitution/schema.d.ts +1763 -0
- package/dist/constitution/scorecard.d.ts +219 -0
- package/dist/constitution/service.d.ts +398 -0
- package/dist/constitution/shadow.d.ts +54 -0
- package/dist/constitution/sourceMutation.d.ts +15 -0
- package/dist/constitution/staticGraphBaseline.d.ts +13 -0
- package/dist/constitution/structural.d.ts +64 -0
- package/dist/core/agenthook.d.ts +63 -0
- package/dist/core/agenthook.js +1 -0
- package/dist/core/automaticReviewMemory.d.ts +60 -0
- package/dist/core/autoreview.d.ts +66 -0
- package/dist/core/canonicalOrder.d.ts +3 -0
- package/dist/core/capturetoken.d.ts +19 -0
- package/dist/core/changeIdentity.d.ts +22 -0
- package/dist/core/changeProof.d.ts +14 -0
- package/dist/core/checkreport.d.ts +140 -0
- package/dist/core/commitrepair.d.ts +171 -0
- package/dist/core/commitrepair.js +238 -0
- package/dist/core/compare.d.ts +21 -0
- package/dist/core/config.d.ts +20 -0
- package/dist/core/conformance.d.ts +35 -0
- package/dist/core/constraintmatch.d.ts +54 -0
- package/dist/core/correction.d.ts +42 -0
- package/dist/core/correctionStage.d.ts +224 -0
- package/dist/core/declarationClusters.d.ts +149 -0
- package/dist/core/delivery.d.ts +110 -0
- package/dist/core/docanchors.d.ts +32 -0
- package/dist/core/docscan.d.ts +26 -0
- package/dist/core/drift.d.ts +13 -0
- package/dist/core/drift.js +31 -1
- package/dist/core/dupdetect.d.ts +43 -0
- package/dist/core/escalations.d.ts +129 -0
- package/dist/core/escalations.js +165 -0
- package/dist/core/events.d.ts +29 -0
- package/dist/core/evidenceMap.d.ts +164 -0
- package/dist/core/externalImports.d.ts +8 -0
- package/dist/core/format.d.ts +13 -0
- package/dist/core/glob.d.ts +9 -0
- package/dist/core/groundingLag.d.ts +84 -0
- package/dist/core/groundingLag.js +16 -2
- package/dist/core/groundingMerge.d.ts +15 -0
- package/dist/core/groundingMerge.js +95 -0
- package/dist/core/hookcache.d.ts +10 -0
- package/dist/core/hookpolicy.d.ts +47 -0
- package/dist/core/ids.d.ts +36 -0
- package/dist/core/importReview.d.ts +30 -0
- package/dist/core/io.d.ts +23 -0
- package/dist/core/jsonc.d.ts +4 -0
- package/dist/core/landscapeAdoption.d.ts +66 -0
- package/dist/core/landscapeDelivery.d.ts +76 -0
- package/dist/core/memorylog.d.ts +37 -0
- package/dist/core/migrate.d.ts +28 -0
- package/dist/core/outcomeExperience.d.ts +89 -0
- package/dist/core/overlaySafety.d.ts +24 -0
- package/dist/core/overlaySafety.js +7 -1
- package/dist/core/paths.d.ts +31 -0
- package/dist/core/pipeline.d.ts +289 -0
- package/dist/core/premises.d.ts +43 -0
- package/dist/core/provenance.d.ts +21 -0
- package/dist/core/publication.d.ts +54 -0
- package/dist/core/refrepair.d.ts +24 -0
- package/dist/core/refrepair.js +1 -1
- package/dist/core/relativeImports.d.ts +11 -0
- package/dist/core/repair.d.ts +44 -0
- package/dist/core/repairqueue.d.ts +40 -0
- package/dist/core/repairqueue.js +133 -0
- package/dist/core/reviewMemory.d.ts +40 -0
- package/dist/core/reviewqueue.d.ts +54 -0
- package/dist/core/safeRepoFile.d.ts +20 -0
- package/dist/core/served.d.ts +57 -0
- package/dist/core/served.js +14 -0
- package/dist/core/stateContract.d.ts +979 -0
- package/dist/core/stateContract.js +87 -4
- package/dist/core/stateDelivery.d.ts +78 -0
- package/dist/core/stateRecords.d.ts +383 -0
- package/dist/core/stateRecords.js +16 -1
- package/dist/core/stats.d.ts +88 -0
- package/dist/core/strictgate.d.ts +33 -0
- package/dist/core/taskReport.d.ts +226 -0
- package/dist/core/taskReport.js +514 -0
- package/dist/core/taskReportCapture.d.ts +8 -0
- package/dist/core/taskReportCapture.js +36 -0
- package/dist/core/taskReportEvidence.d.ts +26 -0
- package/dist/core/taskReportEvidence.js +268 -0
- package/dist/core/taskReportHook.d.ts +20 -0
- package/dist/core/taskReportHook.js +76 -0
- package/dist/core/taskReportPaths.d.ts +3 -0
- package/dist/core/taskReportPaths.js +23 -0
- package/dist/core/taskReportPublic.d.ts +31 -0
- package/dist/core/taskReportPublic.js +45 -0
- package/dist/core/taskReportRender.d.ts +6 -0
- package/dist/core/taskReportRender.js +97 -0
- package/dist/core/topics.d.ts +73 -0
- package/dist/core/types.d.ts +1239 -0
- package/dist/core/version.d.ts +10 -0
- package/dist/eval/guards.d.ts +45 -0
- package/dist/eval/harness.d.ts +58 -0
- package/dist/extractors/adrImport.d.ts +59 -0
- package/dist/extractors/comments.d.ts +7 -0
- package/dist/extractors/correctionSources.d.ts +11 -0
- package/dist/extractors/diff.d.ts +40 -0
- package/dist/extractors/git.d.ts +304 -0
- package/dist/extractors/git.js +208 -20
- package/dist/extractors/helm.d.ts +31 -0
- package/dist/extractors/indexer.d.ts +55 -0
- package/dist/extractors/landscapeDiscovery.d.ts +41 -0
- package/dist/extractors/languages.d.ts +77 -0
- package/dist/extractors/nativeTreeSitter.d.ts +16 -0
- package/dist/extractors/parse.d.ts +54 -0
- package/dist/extractors/php.d.ts +26 -0
- package/dist/extractors/repoSource.d.ts +53 -0
- package/dist/extractors/testreport.d.ts +36 -0
- package/dist/integrations/ciAction.d.ts +8 -0
- package/dist/integrations/claudeConfig.d.ts +44 -0
- package/dist/integrations/claudemd.d.ts +13 -0
- package/dist/integrations/claudemd.js +11 -2
- package/dist/integrations/gitignore.d.ts +16 -0
- package/dist/integrations/gitignore.js +7 -0
- package/dist/integrations/health.d.ts +74 -0
- package/dist/integrations/hooks.d.ts +41 -0
- package/dist/integrations/hooks.js +92 -66
- package/dist/integrations/madrExport.d.ts +39 -0
- package/dist/integrations/madrManifest.d.ts +69 -0
- package/dist/integrations/mergeDriver.d.ts +3 -0
- package/dist/integrations/mergeDriver.js +25 -8
- package/dist/integrations/probe.d.ts +4 -0
- package/dist/integrations/providers.d.ts +103 -0
- package/dist/integrations/scaffold.d.ts +29 -0
- package/dist/integrations/sync.d.ts +30 -0
- package/dist/integrations/sync.js +3 -2
- package/dist/integrations/team.d.ts +70 -0
- package/dist/integrations/worktree.d.ts +8 -0
- package/dist/mcp/roots.d.ts +16 -0
- package/dist/mcp/server.d.ts +36 -0
- package/dist/mcp/server.js +114 -25
- package/dist/mcp/taskReportTools.d.ts +3 -0
- package/dist/mcp/taskReportTools.js +106 -0
- package/dist/serve/app.d.ts +36 -0
- package/dist/serve/app.js +20 -0
- package/dist/serve/config.d.ts +100 -0
- package/dist/serve/writelock.d.ts +22 -0
- package/dist/store/changeLedger.d.ts +132 -0
- package/dist/store/changeLedger.js +40 -9
- package/dist/store/compact.d.ts +33 -0
- package/dist/store/db.d.ts +9 -0
- package/dist/store/embedder.d.ts +32 -0
- package/dist/store/hunchStore.d.ts +624 -0
- package/dist/store/hunchStore.js +13 -5
- package/dist/store/jsonStore.d.ts +125 -0
- package/dist/store/jsonStore.js +15 -0
- package/dist/store/merge.d.ts +39 -0
- package/dist/store/privateMigrate.d.ts +24 -0
- package/dist/store/replay.d.ts +56 -0
- package/dist/store/schema.d.ts +17 -0
- package/dist/store/stateBinding.d.ts +145 -0
- package/dist/store/stateBinding.js +110 -15
- package/dist/store/stateCapture.d.ts +15 -0
- package/dist/store/stateCapture.js +145 -0
- package/dist/synthesis/cliAdapter.d.ts +22 -0
- package/dist/synthesis/initiator.d.ts +13 -0
- package/dist/synthesis/provider.d.ts +307 -0
- package/dist/synthesis/synthesize.d.ts +117 -0
- package/dist/synthesis/tripwires.d.ts +9 -0
- package/dist/taskReports.d.ts +76 -0
- package/dist/taskReports.js +67 -0
- package/dist/wiki/adopt.d.ts +22 -0
- package/dist/wiki/graph.d.ts +87 -0
- package/dist/wiki/wiki.d.ts +242 -0
- package/package.json +6 -5
- package/server.json +2 -2
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wiki memory graph — one self-contained, zero-dependency HTML page
|
|
3
|
+
* (<dir>/graph.html): the VISUAL KNOWLEDGE BASE over the wiki.
|
|
4
|
+
*
|
|
5
|
+
* • Components as circles — sized by code, colored by fragility, ringed when
|
|
6
|
+
* a blocking invariant guards them; dependencies as links.
|
|
7
|
+
* • Repo docs as squares wired to the components they describe — freshness is
|
|
8
|
+
* the color: grounded ✅ green, STALE ⚠ amber-red (pulsing), unverified ◻
|
|
9
|
+
* gray. A stale doc's click opens its wiki-managed healed copy.
|
|
10
|
+
* • An ACT-NOW panel: stale docs, drafts awaiting `hunch review`, unverified
|
|
11
|
+
* docs — each row highlights its nodes; nothing is ever mutated from here.
|
|
12
|
+
* • A time scrubber that replays the memory compounding, plus a this-week
|
|
13
|
+
* pulse on components whose decisions are fresh.
|
|
14
|
+
*
|
|
15
|
+
* Same doctrine as every wiki page: a derived VIEW, deterministic inputs only.
|
|
16
|
+
* The embedded JSON is the page's freshness hash input; the force layout and
|
|
17
|
+
* the "this week" cutoff run client-side at view time and are presentation.
|
|
18
|
+
* No CDN, no fetch — works as a local file in the private overlay repo
|
|
19
|
+
* (con_547fff76bd).
|
|
20
|
+
*/
|
|
21
|
+
export interface WikiGraphNode {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
/** Wiki page filename stem — clicking the node opens `<slug>.md`. */
|
|
25
|
+
slug: string;
|
|
26
|
+
responsibility: string;
|
|
27
|
+
fragility: number;
|
|
28
|
+
symbols: number;
|
|
29
|
+
blocking: number;
|
|
30
|
+
constraints: number;
|
|
31
|
+
bugs: number;
|
|
32
|
+
/** ISO dates (YYYY-MM-DD) of this component's decisions, sorted ascending —
|
|
33
|
+
* the scrubber's raw material and the this-week pulse. */
|
|
34
|
+
decisions: string[];
|
|
35
|
+
}
|
|
36
|
+
export interface WikiGraphDoc {
|
|
37
|
+
rel: string;
|
|
38
|
+
title: string;
|
|
39
|
+
status: "grounded" | "stale" | "unverified";
|
|
40
|
+
/** wiki-dir-relative path of the healed wiki-managed copy (stale docs only). */
|
|
41
|
+
adopted: string | null;
|
|
42
|
+
/** component ids whose files this doc references. */
|
|
43
|
+
components: string[];
|
|
44
|
+
}
|
|
45
|
+
export interface WikiGraphLink {
|
|
46
|
+
source: string;
|
|
47
|
+
target: string;
|
|
48
|
+
}
|
|
49
|
+
export interface WikiGraphData {
|
|
50
|
+
kind: "public" | "private";
|
|
51
|
+
nodes: WikiGraphNode[];
|
|
52
|
+
links: WikiGraphLink[];
|
|
53
|
+
docs: WikiGraphDoc[];
|
|
54
|
+
/** auto-drafted proposed decisions awaiting `hunch review` — actionable count. */
|
|
55
|
+
pendingReview: number;
|
|
56
|
+
}
|
|
57
|
+
/** Pure assembly from already-computed wiki inputs — sorted for a stable hash. */
|
|
58
|
+
export declare function assembleGraphData(kind: "public" | "private", entries: ReadonlyArray<{
|
|
59
|
+
slug: string;
|
|
60
|
+
pack: {
|
|
61
|
+
component: {
|
|
62
|
+
id: string;
|
|
63
|
+
name: string;
|
|
64
|
+
responsibility: string;
|
|
65
|
+
fragility: number;
|
|
66
|
+
};
|
|
67
|
+
symbols: unknown[];
|
|
68
|
+
decisions: Array<{
|
|
69
|
+
id: string;
|
|
70
|
+
}>;
|
|
71
|
+
constraints: Array<{
|
|
72
|
+
severity: string;
|
|
73
|
+
}>;
|
|
74
|
+
bugs: unknown[];
|
|
75
|
+
dependsOn: Array<{
|
|
76
|
+
id: string;
|
|
77
|
+
}>;
|
|
78
|
+
docs: Array<{
|
|
79
|
+
path: string;
|
|
80
|
+
}>;
|
|
81
|
+
};
|
|
82
|
+
}>, decisionDates: ReadonlyMap<string, string>, repoDocs?: ReadonlyArray<{
|
|
83
|
+
rel: string;
|
|
84
|
+
title: string;
|
|
85
|
+
status: string;
|
|
86
|
+
}>, adoptedPageByRel?: ReadonlyMap<string, string>, pendingReview?: number): WikiGraphData;
|
|
87
|
+
export declare function renderGraphPage(data: WikiGraphData): string;
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { type RepoDoc } from "../core/docscan.js";
|
|
2
|
+
import { type WikiGraphData } from "./graph.js";
|
|
3
|
+
import type { Decision } from "../core/types.js";
|
|
4
|
+
import type { HunchStore } from "../store/hunchStore.js";
|
|
5
|
+
import type { Component, Constraint } from "../core/types.js";
|
|
6
|
+
import type { DriftFinding } from "../core/drift.js";
|
|
7
|
+
export type WikiSource = "public" | "all";
|
|
8
|
+
export interface WikiHome {
|
|
9
|
+
kind: "public" | "private";
|
|
10
|
+
/** Repo the pages are written into (main repo root, or the overlay repo root). */
|
|
11
|
+
pagesRoot: string;
|
|
12
|
+
/** Output directory name under pagesRoot (manifest remembers it once adopted). */
|
|
13
|
+
dir: string;
|
|
14
|
+
manifestPath: string;
|
|
15
|
+
source: WikiSource;
|
|
16
|
+
}
|
|
17
|
+
export declare function publicHome(root: string, dirOverride?: string): WikiHome;
|
|
18
|
+
/** The private overlay's wiki home, or null when no overlay is configured.
|
|
19
|
+
* `store.privateDir` is the overlay's .hunch dir; pages go to the overlay repo
|
|
20
|
+
* root beside it (never inside .hunch/, which must stay memory-JSON-only for
|
|
21
|
+
* the overlay auto-commit guard), and the manifest rides the overlay store. */
|
|
22
|
+
export declare function privateHome(store: HunchStore, dirOverride?: string): WikiHome | null;
|
|
23
|
+
export interface WikiPack {
|
|
24
|
+
component: {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
kind: string;
|
|
28
|
+
responsibility: string;
|
|
29
|
+
paths: string[];
|
|
30
|
+
fragility: number;
|
|
31
|
+
};
|
|
32
|
+
/** repo-relative POSIX files the component owns (via its path globs). */
|
|
33
|
+
files: string[];
|
|
34
|
+
symbols: Array<{
|
|
35
|
+
name: string;
|
|
36
|
+
file: string;
|
|
37
|
+
kind: string;
|
|
38
|
+
fan_in: number;
|
|
39
|
+
fan_out: number;
|
|
40
|
+
loc: number;
|
|
41
|
+
}>;
|
|
42
|
+
decisions: Array<{
|
|
43
|
+
id: string;
|
|
44
|
+
topic: string | null;
|
|
45
|
+
title: string;
|
|
46
|
+
decision: string;
|
|
47
|
+
context: string;
|
|
48
|
+
consequences: string[];
|
|
49
|
+
alternatives_rejected: string[];
|
|
50
|
+
}>;
|
|
51
|
+
constraints: Array<{
|
|
52
|
+
id: string;
|
|
53
|
+
severity: string;
|
|
54
|
+
statement: string;
|
|
55
|
+
rationale: string;
|
|
56
|
+
}>;
|
|
57
|
+
bugs: Array<{
|
|
58
|
+
id: string;
|
|
59
|
+
title: string;
|
|
60
|
+
root_cause: string;
|
|
61
|
+
severity: string;
|
|
62
|
+
status: string;
|
|
63
|
+
}>;
|
|
64
|
+
/** Repo docs (specs) that reference this component's files, with their
|
|
65
|
+
* deterministic freshness grade — status changes re-hash the page. `adopted`
|
|
66
|
+
* is the wiki-dir-relative path of the doc's wiki-managed copy (stale docs
|
|
67
|
+
* only), assigned by wikiStatus — the single slug authority. */
|
|
68
|
+
docs: Array<{
|
|
69
|
+
path: string;
|
|
70
|
+
title: string;
|
|
71
|
+
status: string;
|
|
72
|
+
adopted: string | null;
|
|
73
|
+
}>;
|
|
74
|
+
/** `slug` is the related page's filename stem, assigned by wikiStatus (the
|
|
75
|
+
* slug authority) and HASHED with the pack — a sibling rename re-renders
|
|
76
|
+
* every page that links to it (closes the dec_c205c26472 residual). */
|
|
77
|
+
dependsOn: Array<{
|
|
78
|
+
id: string;
|
|
79
|
+
name: string;
|
|
80
|
+
slug: string | null;
|
|
81
|
+
}>;
|
|
82
|
+
usedBy: Array<{
|
|
83
|
+
id: string;
|
|
84
|
+
name: string;
|
|
85
|
+
slug: string | null;
|
|
86
|
+
}>;
|
|
87
|
+
}
|
|
88
|
+
/** Assemble one component's pack — pure graph queries, no LLM. `source` decides
|
|
89
|
+
* the leak boundary: "public" reads the committed store only; "all" unions the
|
|
90
|
+
* private overlay and must only ever feed a PRIVATE home's pages. `repoDocs`
|
|
91
|
+
* (pre-scanned specs) associate by the src files they mention. */
|
|
92
|
+
export declare function assemblePack(store: HunchStore, component: Component, source?: WikiSource, repoDocs?: readonly RepoDoc[], adoptedPageByRel?: ReadonlyMap<string, string>, slugById?: ReadonlyMap<string, string>): WikiPack;
|
|
93
|
+
export declare function packHash(pack: WikiPack): string;
|
|
94
|
+
export declare function slugFor(name: string, id: string, taken: Set<string>): string;
|
|
95
|
+
/** `docsLinkable`: pages in the MAIN repo can relative-link ../<doc>; a private
|
|
96
|
+
* home's pages live in the OVERLAY repo where those paths don't resolve, so
|
|
97
|
+
* they render doc paths as plain text instead. */
|
|
98
|
+
export declare function renderPage(pack: WikiPack, prose: string | null, docsLinkable?: boolean): string;
|
|
99
|
+
export declare function renderIndex(entries: Array<{
|
|
100
|
+
pack: WikiPack;
|
|
101
|
+
slug: string;
|
|
102
|
+
}>, repoWide: Constraint[], home: Pick<WikiHome, "kind">, docs?: readonly RepoDoc[]): string;
|
|
103
|
+
/** The specs ledger — every repo doc with its deterministic freshness grade.
|
|
104
|
+
* This page is what makes the wiki usable as the trusted READING surface over
|
|
105
|
+
* the repo's own documentation: grounded docs are safe, stale docs carry their
|
|
106
|
+
* exact drift, unverified docs show how to get grounded. Prose is never
|
|
107
|
+
* rewritten — healing a stale doc is a human edit guided by `hunch heal`. */
|
|
108
|
+
export declare function renderSpecsPage(docs: readonly RepoDoc[], home: Pick<WikiHome, "kind">, adoptedPageByRel?: ReadonlyMap<string, string>): string;
|
|
109
|
+
export interface WikiManifest {
|
|
110
|
+
version: 1;
|
|
111
|
+
dir: string;
|
|
112
|
+
/** `bytes` = hash of the page as WRITTEN — the hand-edit tripwire. Optional
|
|
113
|
+
* for forward-compat with manifests written before it existed. */
|
|
114
|
+
pages: Record<string, {
|
|
115
|
+
component: string;
|
|
116
|
+
hash: string;
|
|
117
|
+
generated: string;
|
|
118
|
+
bytes?: string;
|
|
119
|
+
}>;
|
|
120
|
+
}
|
|
121
|
+
export declare function readWikiManifestAt(manifestPath: string): WikiManifest | null;
|
|
122
|
+
export declare function writeWikiManifestAt(manifestPath: string, manifest: WikiManifest): void;
|
|
123
|
+
/** For the committed grounding docs (CLAUDE.md et al): is a PUBLIC wiki adopted
|
|
124
|
+
* here, and how big? Deliberately blind to the private home — committed docs
|
|
125
|
+
* must not advertise what the overlay holds. */
|
|
126
|
+
export declare function wikiSummary(root: string): {
|
|
127
|
+
dir: string;
|
|
128
|
+
pages: number;
|
|
129
|
+
} | null;
|
|
130
|
+
export interface WikiEntry {
|
|
131
|
+
pack: WikiPack;
|
|
132
|
+
slug: string;
|
|
133
|
+
/** pagesRoot-relative POSIX page path, e.g. "wiki/store-layer.md". */
|
|
134
|
+
page: string;
|
|
135
|
+
hash: string;
|
|
136
|
+
state: "fresh" | "stale" | "new";
|
|
137
|
+
reason: string;
|
|
138
|
+
}
|
|
139
|
+
/** One row of the NOW page — a decision reduced to its ledger-relevant surface.
|
|
140
|
+
* Everything here participates in the page's freshness hash. */
|
|
141
|
+
export interface NowItem {
|
|
142
|
+
id: string;
|
|
143
|
+
topic: string | null;
|
|
144
|
+
title: string;
|
|
145
|
+
status: string;
|
|
146
|
+
date: string;
|
|
147
|
+
/** decision text for recent items; CONTEXT (the why-it's-planned) for roadmap items. */
|
|
148
|
+
note: string;
|
|
149
|
+
}
|
|
150
|
+
/** The hot view's inputs: last `recentLimit` decisions by date (any status — a
|
|
151
|
+
* supersession IS activity), and every live PROPOSED decision (the roadmap:
|
|
152
|
+
* record intent as a proposed decision; accepting or superseding it removes it
|
|
153
|
+
* from the roadmap with zero file maintenance). Home-scoped like every read. */
|
|
154
|
+
export declare function nowData(decisions: readonly Decision[], recentLimit?: number): {
|
|
155
|
+
recent: NowItem[];
|
|
156
|
+
roadmap: NowItem[];
|
|
157
|
+
pendingReview: number;
|
|
158
|
+
};
|
|
159
|
+
/** The hot file — a DERIVED view like every other page: what just happened
|
|
160
|
+
* (last N decisions) and what's next (live proposed decisions). No topic pins
|
|
161
|
+
* by design: ledger entries going stale is history, not drift — the freshness
|
|
162
|
+
* hash alone re-renders the page when the graph moves. */
|
|
163
|
+
export declare function renderNowPage(recent: readonly NowItem[], roadmap: readonly NowItem[], home: Pick<WikiHome, "kind">, pendingReview?: number): string;
|
|
164
|
+
/** A stale doc the wiki takes over: a healed, wiki-managed copy under <dir>/docs/. */
|
|
165
|
+
export interface WikiAdoption {
|
|
166
|
+
doc: RepoDoc;
|
|
167
|
+
/** Source content the copy is healed from (read once during status). */
|
|
168
|
+
content: string;
|
|
169
|
+
/** pagesRoot-relative page path, e.g. "wiki/docs/docs-api.md". */
|
|
170
|
+
page: string;
|
|
171
|
+
hash: string;
|
|
172
|
+
state: WikiEntry["state"];
|
|
173
|
+
}
|
|
174
|
+
export interface WikiStatus {
|
|
175
|
+
home: WikiHome;
|
|
176
|
+
entries: WikiEntry[];
|
|
177
|
+
/** Every repo doc with its freshness grade (input to specs page + Docs sections). */
|
|
178
|
+
docs: RepoDoc[];
|
|
179
|
+
/** Stale docs the wiki adopts (copies in + heals + manages). */
|
|
180
|
+
adoptions: WikiAdoption[];
|
|
181
|
+
/** Adopted copies whose ORIGINAL healed or vanished — the copy retires. */
|
|
182
|
+
adoptionOrphans: string[];
|
|
183
|
+
/** The decisions the home may read (needed to heal adopted copies). */
|
|
184
|
+
decisions: Decision[];
|
|
185
|
+
/** The specs ledger page's own freshness (hashed over the doc-status snapshot). */
|
|
186
|
+
specs: {
|
|
187
|
+
page: string;
|
|
188
|
+
hash: string;
|
|
189
|
+
state: WikiEntry["state"];
|
|
190
|
+
};
|
|
191
|
+
/** The README index page's freshness (hashed over rows + repo-wide invariants). */
|
|
192
|
+
index: {
|
|
193
|
+
page: string;
|
|
194
|
+
hash: string;
|
|
195
|
+
state: WikiEntry["state"];
|
|
196
|
+
};
|
|
197
|
+
/** The NOW page (activity ledger + roadmap) — hashed over its item snapshot. */
|
|
198
|
+
now: {
|
|
199
|
+
page: string;
|
|
200
|
+
hash: string;
|
|
201
|
+
state: WikiEntry["state"];
|
|
202
|
+
recent: NowItem[];
|
|
203
|
+
roadmap: NowItem[];
|
|
204
|
+
pendingReview: number;
|
|
205
|
+
};
|
|
206
|
+
/** The interactive memory-graph page — hashed over its embedded data. */
|
|
207
|
+
graph: {
|
|
208
|
+
page: string;
|
|
209
|
+
hash: string;
|
|
210
|
+
state: WikiEntry["state"];
|
|
211
|
+
data: WikiGraphData;
|
|
212
|
+
};
|
|
213
|
+
/** Repo-wide (scope []) constraints — rendered on the index, hashed into it. */
|
|
214
|
+
repoWide: Constraint[];
|
|
215
|
+
/** Manifest pages no current artifact claims (deleted/renamed components, an
|
|
216
|
+
* abandoned --dir…) — removed on heal so nothing generated is ever stranded. */
|
|
217
|
+
orphans: string[];
|
|
218
|
+
}
|
|
219
|
+
/** Stable component order is part of page identity because slug collisions are
|
|
220
|
+
* resolved first-come. Keep it independent of the host's collation locale. */
|
|
221
|
+
export declare function compareWikiComponents(left: Pick<Component, "id" | "name">, right: Pick<Component, "id" | "name">): number;
|
|
222
|
+
export declare function wikiStatus(store: HunchStore, home: WikiHome, srcRoot: string): WikiStatus;
|
|
223
|
+
export interface GenerateOptions {
|
|
224
|
+
/** ISO instant recorded per page in the manifest (caller supplies the clock). */
|
|
225
|
+
now: string;
|
|
226
|
+
/** "all" regenerates every page; "stale" only new/stale ones (--heal). */
|
|
227
|
+
only: "all" | "stale";
|
|
228
|
+
/** Optional grounded-prose hook (guarded LLM provider). null/throw → template-only page. */
|
|
229
|
+
prose?: (pack: WikiPack, excerpts: string) => Promise<string | null>;
|
|
230
|
+
/** Optional prose-heal for ADOPTED copies (--prose-heal): an LLM "reconciled
|
|
231
|
+
* overview" under the banner. null/throw → deterministic copy, exactly as
|
|
232
|
+
* without the flag; output is never hashed (same doctrine as page prose). */
|
|
233
|
+
adoptionProse?: (doc: RepoDoc, content: string) => Promise<string | null>;
|
|
234
|
+
log?: (line: string) => void;
|
|
235
|
+
}
|
|
236
|
+
export declare function wikiPrompt(pack: WikiPack, excerpts: string): string;
|
|
237
|
+
export declare function generateWiki(store: HunchStore, srcRoot: string, home: WikiHome, opts: GenerateOptions): Promise<{
|
|
238
|
+
written: string[];
|
|
239
|
+
removed: string[];
|
|
240
|
+
unchanged: number;
|
|
241
|
+
}>;
|
|
242
|
+
export declare function computeWikiDrift(store: HunchStore, root: string): DriftFinding[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@davesheffer/hunch",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.0",
|
|
4
4
|
"mcpName": "io.github.davesheffer/hunch",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Dave Sheffer <dave.sheffer1@gmail.com>",
|
|
@@ -27,15 +27,16 @@
|
|
|
27
27
|
"default": "./dist/projectDna.js"
|
|
28
28
|
},
|
|
29
29
|
"./state": "./dist/client/state.js",
|
|
30
|
+
"./reports": {
|
|
31
|
+
"types": "./dist/taskReports.d.ts",
|
|
32
|
+
"default": "./dist/taskReports.js"
|
|
33
|
+
},
|
|
30
34
|
"./dist/*": "./dist/*",
|
|
31
35
|
"./package.json": "./package.json"
|
|
32
36
|
},
|
|
33
37
|
"files": [
|
|
34
38
|
"dist/**/*.js",
|
|
35
|
-
"dist
|
|
36
|
-
"dist/core/changeProofContract.d.ts",
|
|
37
|
-
"dist/projectDna.d.ts",
|
|
38
|
-
"dist/core/projectDna*.d.ts",
|
|
39
|
+
"dist/**/*.d.ts",
|
|
39
40
|
"contracts/change-proof/*.json",
|
|
40
41
|
"server.json",
|
|
41
42
|
"bench/constitution-exp03-v1.json",
|
package/server.json
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
9
|
"websiteUrl": "https://www.hunchmemory.com",
|
|
10
|
-
"version": "1.
|
|
10
|
+
"version": "1.32.0",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
15
15
|
"identifier": "@davesheffer/hunch",
|
|
16
|
-
"version": "1.
|
|
16
|
+
"version": "1.32.0",
|
|
17
17
|
"runtimeHint": "npx",
|
|
18
18
|
"packageArguments": [
|
|
19
19
|
{
|