@davesheffer/hunch 1.31.1 → 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 +1 -0
- 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/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/stateDelivery.d.ts +78 -0
- package/dist/core/stateRecords.d.ts +383 -0
- 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 +74 -22
- 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/config.d.ts +100 -0
- package/dist/serve/writelock.d.ts +22 -0
- package/dist/store/changeLedger.d.ts +132 -0
- 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 +6 -3
- package/dist/store/jsonStore.d.ts +125 -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/stateCapture.d.ts +15 -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,58 @@
|
|
|
1
|
+
import type { EvaluationSummary, HistoryDisposition, HistoryDispositionClassification, PolicyProof, PolicySpec, ProofClass } from "./schema.js";
|
|
2
|
+
import type { ShadowPrecisionReport } from "./shadow.js";
|
|
3
|
+
export interface ProofCard {
|
|
4
|
+
card_hash: string;
|
|
5
|
+
policy: {
|
|
6
|
+
id: string;
|
|
7
|
+
statement: string;
|
|
8
|
+
state: PolicySpec["state"];
|
|
9
|
+
severity: PolicySpec["severity"];
|
|
10
|
+
data_class: PolicySpec["data_class"];
|
|
11
|
+
assertion: PolicySpec["assertion"];
|
|
12
|
+
scope: PolicySpec["scope"];
|
|
13
|
+
evidence: string[];
|
|
14
|
+
candidate: PolicySpec["candidate"];
|
|
15
|
+
exception_of: string | null;
|
|
16
|
+
activation_gate: PolicySpec["activation_gate"];
|
|
17
|
+
};
|
|
18
|
+
proof: {
|
|
19
|
+
id: string;
|
|
20
|
+
proof_class: ProofClass;
|
|
21
|
+
plan_hash: string;
|
|
22
|
+
generated_at: string;
|
|
23
|
+
};
|
|
24
|
+
evidence_vector: {
|
|
25
|
+
current: EvaluationSummary;
|
|
26
|
+
known_bad: EvaluationSummary;
|
|
27
|
+
known_good: EvaluationSummary;
|
|
28
|
+
accepted_history: PolicyProof["accepted_history"];
|
|
29
|
+
mutations: PolicyProof["mutations"];
|
|
30
|
+
mutation_controls: PolicyProof["mutation_controls"];
|
|
31
|
+
};
|
|
32
|
+
project_checks: PolicyProof["project_checks"];
|
|
33
|
+
composition: PolicyProof["composition"] | null;
|
|
34
|
+
shadow_precision: ShadowPrecisionReport | null;
|
|
35
|
+
history_dispositions: {
|
|
36
|
+
current: HistoryDisposition[];
|
|
37
|
+
counts: Record<HistoryDispositionClassification, number>;
|
|
38
|
+
missing_commits: string[];
|
|
39
|
+
unresolved_count: number;
|
|
40
|
+
};
|
|
41
|
+
uncertainty: {
|
|
42
|
+
unclassified_history_hits: number;
|
|
43
|
+
unknown_results: number;
|
|
44
|
+
error_results: number;
|
|
45
|
+
limitations: string[];
|
|
46
|
+
compiler_uncertainty: string[];
|
|
47
|
+
candidate_conflicts: string[];
|
|
48
|
+
};
|
|
49
|
+
authority: {
|
|
50
|
+
current: PolicySpec["authority"];
|
|
51
|
+
eligible_for_human_blocking_approval: boolean;
|
|
52
|
+
can_block_now: boolean;
|
|
53
|
+
blocking_evidence_error: string | null;
|
|
54
|
+
};
|
|
55
|
+
actions: string[];
|
|
56
|
+
}
|
|
57
|
+
export declare function buildProofCard(policy: PolicySpec, proof: PolicyProof, dispositions?: HistoryDisposition[], composition?: PolicySpec[], shadowPrecision?: ShadowPrecisionReport | null): ProofCard;
|
|
58
|
+
export declare function renderProofCard(card: ProofCard): string;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Constraint, Decision } from "../core/types.js";
|
|
2
|
+
import type { HunchStore } from "../store/hunchStore.js";
|
|
3
|
+
import { type CandidateContext, type DataClass, type PolicyAssertion, type PolicySpec } from "./schema.js";
|
|
4
|
+
export interface CompilePolicyOptions {
|
|
5
|
+
through?: string;
|
|
6
|
+
private?: boolean;
|
|
7
|
+
now?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function compileDecisionRecord(store: HunchStore, source: Decision, isPrivate: boolean, opts?: Omit<CompilePolicyOptions, "private">): {
|
|
10
|
+
policy: PolicySpec;
|
|
11
|
+
private: boolean;
|
|
12
|
+
source: Decision;
|
|
13
|
+
};
|
|
14
|
+
/** Deterministic compatibility compiler: one structured legacy conformance
|
|
15
|
+
* predicate becomes one Policy IR candidate. It never interprets prose into a
|
|
16
|
+
* nearest available rule. */
|
|
17
|
+
export declare function compileDecisionPolicy(store: HunchStore, decisionId: string, opts?: CompilePolicyOptions): {
|
|
18
|
+
policy: PolicySpec;
|
|
19
|
+
private: boolean;
|
|
20
|
+
source: Decision;
|
|
21
|
+
};
|
|
22
|
+
export interface StructuralPolicyInput {
|
|
23
|
+
source: Decision;
|
|
24
|
+
evidenceId: string;
|
|
25
|
+
commit: string;
|
|
26
|
+
assertion: PolicyAssertion;
|
|
27
|
+
scope: PolicySpec["scope"];
|
|
28
|
+
dataClass: DataClass;
|
|
29
|
+
candidate?: CandidateContext;
|
|
30
|
+
now?: string;
|
|
31
|
+
}
|
|
32
|
+
/** Compile one already-enumerated structural assertion. This function does not
|
|
33
|
+
* infer or rank semantics; callers must pass an exact supported candidate. */
|
|
34
|
+
export declare function compileStructuralPolicy(store: HunchStore, input: StructuralPolicyInput): {
|
|
35
|
+
policy: PolicySpec;
|
|
36
|
+
private: boolean;
|
|
37
|
+
};
|
|
38
|
+
export interface CorrectionPolicyInput {
|
|
39
|
+
source: Constraint;
|
|
40
|
+
evidenceId: string;
|
|
41
|
+
assertion: PolicyAssertion;
|
|
42
|
+
scope: PolicySpec["scope"];
|
|
43
|
+
dataClass: DataClass;
|
|
44
|
+
candidate?: CandidateContext;
|
|
45
|
+
now?: string;
|
|
46
|
+
}
|
|
47
|
+
/** Compile one already-bound correction projection. The caller must first prove
|
|
48
|
+
* that the projection has exactly one supported structural interpretation. */
|
|
49
|
+
export declare function compileCorrectionPolicy(store: HunchStore, input: CorrectionPolicyInput): {
|
|
50
|
+
policy: PolicySpec;
|
|
51
|
+
private: boolean;
|
|
52
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type PolicyCompositionBinding, type PolicySpec } from "./schema.js";
|
|
2
|
+
export declare function oppositeExceptionAssertions(child: PolicySpec, parent: PolicySpec): boolean;
|
|
3
|
+
export declare function exceptionScopeIsNarrower(child: PolicySpec, parent: PolicySpec): boolean;
|
|
4
|
+
export declare function validateExceptionRelationship(child: PolicySpec, parent: PolicySpec): void;
|
|
5
|
+
/** Return every explicit descendant of a broad root. Parent links define the
|
|
6
|
+
* precedence tree; stable policy-id ordering keeps the binding canonical. */
|
|
7
|
+
export declare function compositionDescendants(root: PolicySpec, policies: PolicySpec[]): PolicySpec[];
|
|
8
|
+
export declare function policyCompositionBinding(root: PolicySpec, members: PolicySpec[]): PolicyCompositionBinding | undefined;
|
|
9
|
+
export declare function policyProofHash(root: PolicySpec, members?: PolicySpec[]): string;
|
|
10
|
+
export declare function assertCompositionBinding(root: PolicySpec, members: PolicySpec[], binding: PolicyCompositionBinding | undefined): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type PolicySpec, type ProofCorpus } from "./schema.js";
|
|
2
|
+
/** Resolve human-authored Git refs once, then persist an immutable, policy-bound
|
|
3
|
+
* fixture manifest. No checkout, evaluator, model, provider, or project command runs. */
|
|
4
|
+
export declare function compileProofCorpus(root: string, policy: PolicySpec, raw: unknown, opts?: {
|
|
5
|
+
now?: string;
|
|
6
|
+
}): ProofCorpus;
|
|
7
|
+
export declare function proofCorpusContentHash(corpus: ProofCorpus): string;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { HunchStore } from "../store/hunchStore.js";
|
|
2
|
+
import type { PolicyRepository } from "./repository.js";
|
|
3
|
+
import { type EvidenceEvent, type PolicyProof, type PolicySpec, type ProofPlan } from "./schema.js";
|
|
4
|
+
export interface CorrectionUpgradeOptions {
|
|
5
|
+
publicOnly?: boolean;
|
|
6
|
+
privateOnly?: boolean;
|
|
7
|
+
now?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CorrectionReview {
|
|
10
|
+
status: "ready_for_review";
|
|
11
|
+
rule: string;
|
|
12
|
+
meaning: string;
|
|
13
|
+
why: string;
|
|
14
|
+
catches: string;
|
|
15
|
+
does_not_catch: string;
|
|
16
|
+
authority: "none" | "existing_human";
|
|
17
|
+
next_action: string;
|
|
18
|
+
}
|
|
19
|
+
export interface CorrectionPolicyUpgrade {
|
|
20
|
+
status: "proved" | "already_proved" | "legacy_only" | "pending" | "conflicted";
|
|
21
|
+
correction_id: string;
|
|
22
|
+
reason: string;
|
|
23
|
+
evidence: EvidenceEvent;
|
|
24
|
+
policy: PolicySpec | null;
|
|
25
|
+
plan: ProofPlan | null;
|
|
26
|
+
proof: PolicyProof | null;
|
|
27
|
+
review: CorrectionReview | null;
|
|
28
|
+
authority: "none";
|
|
29
|
+
effects: "proposal_only";
|
|
30
|
+
activation: "not_available_in_this_operation";
|
|
31
|
+
}
|
|
32
|
+
export interface CorrectionPolicySweep {
|
|
33
|
+
scanned: number;
|
|
34
|
+
proved: number;
|
|
35
|
+
already_proved: number;
|
|
36
|
+
legacy_only: number;
|
|
37
|
+
pending: number;
|
|
38
|
+
conflicted: number;
|
|
39
|
+
failed: Array<{
|
|
40
|
+
correction_id: string;
|
|
41
|
+
home: Home;
|
|
42
|
+
error: string;
|
|
43
|
+
}>;
|
|
44
|
+
upgrades: CorrectionPolicyUpgrade[];
|
|
45
|
+
authority: "none";
|
|
46
|
+
}
|
|
47
|
+
type Home = "public" | "private";
|
|
48
|
+
/** Upgrade one safe correction projection into a proved proposal. This operation
|
|
49
|
+
* cannot activate, warn, or block; unsupported corrections retain only their
|
|
50
|
+
* immediate legacy Constraint. */
|
|
51
|
+
export declare function materializeCorrectionPolicy(store: HunchStore, root: string, repository: PolicyRepository, correctionId: string, opts?: CorrectionUpgradeOptions): CorrectionPolicyUpgrade;
|
|
52
|
+
/** Durable retry queue: the captured Constraints are the source of truth, so a
|
|
53
|
+
* crashed process needs no in-memory job record. Normal indexing and post-commit
|
|
54
|
+
* sync can safely rescan both exact homes; every artifact is deterministic and
|
|
55
|
+
* no result grants authority. */
|
|
56
|
+
export declare function materializeCorrectionPolicies(store: HunchStore, root: string, repository: PolicyRepository, opts?: CorrectionUpgradeOptions): CorrectionPolicySweep;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type StructuralDelta } from "./schema.js";
|
|
2
|
+
/** Compare exact git blobs at a commit and its first parent. No checkout,
|
|
3
|
+
* worktree, hook, or model/provider is involved. */
|
|
4
|
+
export declare function extractStructuralDelta(root: string, commit: string): StructuralDelta;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type HistoryDisposition, type HistoryDispositionClassification, type PolicyProof, type PolicySpec, type ReplayReceipt } from "./schema.js";
|
|
2
|
+
export declare function historyDispositionContentHash(disposition: HistoryDisposition): string;
|
|
3
|
+
export declare function historyDispositionJudgmentHash(disposition: HistoryDisposition): string;
|
|
4
|
+
export declare function compileHistoryDisposition(policy: PolicySpec, proof: PolicyProof, receipt: ReplayReceipt, classification: HistoryDispositionClassification, actor: string, reason: string, opts?: {
|
|
5
|
+
now?: string;
|
|
6
|
+
supersedes?: string | null;
|
|
7
|
+
composition?: PolicySpec[];
|
|
8
|
+
}): HistoryDisposition;
|
|
9
|
+
/** Resolve the append-only supersession chain without trusting timestamps.
|
|
10
|
+
* Missing parents, cross-hit links, branches, and cycles fail visibly. */
|
|
11
|
+
export declare function currentHistoryDispositions(records: HistoryDisposition[]): HistoryDisposition[];
|
|
12
|
+
export interface HistoryDispositionAssessment {
|
|
13
|
+
current: HistoryDisposition[];
|
|
14
|
+
bound: HistoryDisposition[];
|
|
15
|
+
missing_commits: string[];
|
|
16
|
+
unresolved_count: number;
|
|
17
|
+
counts: Record<HistoryDispositionClassification, number>;
|
|
18
|
+
blocking_error: string | null;
|
|
19
|
+
}
|
|
20
|
+
export declare function assessHistoryDispositions(proof: PolicyProof, records: HistoryDisposition[]): HistoryDispositionAssessment;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Component, Edge, Symbol } from "../core/types.js";
|
|
2
|
+
import type { HunchStore } from "../store/hunchStore.js";
|
|
3
|
+
import { type BehaviorEvaluationOptions } from "./behaviorEvaluator.js";
|
|
4
|
+
import { type PolicyEvaluation, type PolicySpec } from "./schema.js";
|
|
5
|
+
export interface GraphSnapshot {
|
|
6
|
+
root: string;
|
|
7
|
+
head: string;
|
|
8
|
+
symbols: Symbol[];
|
|
9
|
+
edges: Edge[];
|
|
10
|
+
components: Component[];
|
|
11
|
+
graph_hash: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function graphSnapshotFromRecords(root: string, head: string, symbols: Symbol[], edges: Edge[], components?: Component[]): GraphSnapshot;
|
|
14
|
+
/** Bind a filesystem-derived graph to its content, never to a Git commit whose
|
|
15
|
+
* tree may not contain the scanned bytes. The graph hash is independent of the
|
|
16
|
+
* receipt head, so it is safe to use as the explicit checkout identity. */
|
|
17
|
+
export declare function checkoutGraphSnapshot(root: string, symbols: Symbol[], edges: Edge[], components?: Component[]): GraphSnapshot;
|
|
18
|
+
/** Bind a semantic check receipt to both the selected source surface and the
|
|
19
|
+
* exact raw source bytes. The graph hash remains explicit because two source
|
|
20
|
+
* bodies can differ while producing the same topology. */
|
|
21
|
+
export declare function sourceGraphSnapshot(root: string, source: {
|
|
22
|
+
kind: string;
|
|
23
|
+
revision?: string;
|
|
24
|
+
content_hash: string;
|
|
25
|
+
}, symbols: Symbol[], edges: Edge[], components?: Component[]): GraphSnapshot;
|
|
26
|
+
export declare function graphSnapshot(store: HunchStore, root: string, opts?: {
|
|
27
|
+
publicOnly?: boolean;
|
|
28
|
+
head?: string;
|
|
29
|
+
}): GraphSnapshot;
|
|
30
|
+
export declare function evaluatePolicyOnSnapshot(policy: PolicySpec, snapshot: GraphSnapshot): PolicyEvaluation;
|
|
31
|
+
export declare function selectedPolicyForComposition(root: PolicySpec, members: PolicySpec[], snapshot: GraphSnapshot): PolicySpec;
|
|
32
|
+
/** Evaluate explicit scope precedence as one receipt. The deepest applicable
|
|
33
|
+
* linked exception wins; severity and adapter order never participate. */
|
|
34
|
+
export declare function evaluateCompositePolicyOnSnapshot(root: PolicySpec, members: PolicySpec[], snapshot: GraphSnapshot): PolicyEvaluation;
|
|
35
|
+
export declare function evaluatePolicy(store: HunchStore, root: string, policy: PolicySpec, opts?: {
|
|
36
|
+
publicOnly?: boolean;
|
|
37
|
+
composition?: PolicySpec[];
|
|
38
|
+
behavior?: BehaviorEvaluationOptions;
|
|
39
|
+
snapshot?: GraphSnapshot;
|
|
40
|
+
}): PolicyEvaluation;
|
|
41
|
+
export declare function policyIsActive(policy: PolicySpec): boolean;
|
|
42
|
+
export declare function policyBlocks(policy: PolicySpec, evaluation: PolicyEvaluation): boolean;
|
|
43
|
+
export declare function mutationOperatorForPolicy(policy: PolicySpec): string;
|
|
44
|
+
export declare function mutateSnapshotForPolicy(policy: PolicySpec, snapshot: GraphSnapshot): {
|
|
45
|
+
snapshot: GraphSnapshot;
|
|
46
|
+
operator: string;
|
|
47
|
+
} | null;
|