@davesheffer/hunch 1.31.1 → 1.32.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 +2 -1
- 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 +606 -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 +128 -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/hookObservations.d.ts +9 -0
- package/dist/core/hookObservations.js +33 -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 +28 -0
- package/dist/core/taskReportEvidence.js +272 -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/health.js +32 -2
- 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 +188 -0
- package/dist/mcp/taskReportTools.js +147 -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 +79 -0
- package/dist/taskReports.js +69 -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,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* nuryel.state/1 — search and delivery of the five state kinds (receipts, commitments,
|
|
3
|
+
* derived, entities, relationships). Registered in 1.25 as store kinds, they were stored and
|
|
4
|
+
* counted but neither indexed nor delivered: `hunch_query("customer:Site:7")` could not surface
|
|
5
|
+
* a current summary, an open commitment or a verified receipt, and `hunch_context` had no
|
|
6
|
+
* "State" section. This module is the single place that says, per kind:
|
|
7
|
+
*
|
|
8
|
+
* - what text goes into the `search` FTS row (subject + content/title + actor + status, so a
|
|
9
|
+
* subject id and a human phrase both hit),
|
|
10
|
+
* - whether a record is LIVE (current / in_force / verified…) or HISTORY (superseded, done,
|
|
11
|
+
* cancelled, failed, retired) — history stays indexed and findable, it only ranks below,
|
|
12
|
+
* - the one-line render every reader gets (`[commitment/in_force] customer:Site:7 — …`),
|
|
13
|
+
* - the bounded, deterministically ordered "State" supplements for a context brief.
|
|
14
|
+
*
|
|
15
|
+
* Pure functions over records; no store or SQLite dependency, so the CLI, the MCP server and
|
|
16
|
+
* the store's own reindex/rank paths cannot drift from each other.
|
|
17
|
+
*/
|
|
18
|
+
import type { ActionReceipt, Commitment, DerivedState, ExternalEntity, StateRelationship } from "./stateRecords.js";
|
|
19
|
+
import type { DeliverySupplement } from "./delivery.js";
|
|
20
|
+
export declare const STATE_KINDS: readonly ["receipts", "commitments", "derived", "entities", "relationships"];
|
|
21
|
+
export type StateKind = (typeof STATE_KINDS)[number];
|
|
22
|
+
export declare function isStateKind(kind: string): kind is StateKind;
|
|
23
|
+
export type StateRecord = ActionReceipt | Commitment | DerivedState | ExternalEntity | StateRelationship;
|
|
24
|
+
export interface StateLiveness {
|
|
25
|
+
/** The contract's own word for the record's standing: current, in_force, verified, done, superseded … */
|
|
26
|
+
label: string;
|
|
27
|
+
/** True when the record is the state of record NOW; false for history (still indexed, ranked below). */
|
|
28
|
+
live: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** Liveness per kind, mirroring readState's state_of_record predicates exactly
|
|
31
|
+
* (derived `current` with an open window; commitment open/waiting with an open window;
|
|
32
|
+
* receipt succeeded/verified; entity active; a relationship is always current). */
|
|
33
|
+
export declare function stateLiveness(kind: StateKind, record: StateRecord): StateLiveness;
|
|
34
|
+
/** The subject key a reader would type: the commitment/derived subject, the receipt's target
|
|
35
|
+
* object (`event:10042`), the entity id, or the relationship's `from` endpoint. */
|
|
36
|
+
export declare function stateSubject(kind: StateKind, record: StateRecord): string;
|
|
37
|
+
/** The instant that orders "latest first": computed_at, valid_from, verified_at ?? occurred_at,
|
|
38
|
+
* updated_at. Relationships carry no clock and sort last among equals. */
|
|
39
|
+
export declare function stateObservedAt(kind: StateKind, record: StateRecord): string;
|
|
40
|
+
/** The FTS document for a state record: title = the subject key (so an id query hits the
|
|
41
|
+
* title column, which the snippet and LIKE fallback both prefer), body = the human words plus
|
|
42
|
+
* the actor/owner, the status label and the dates. Every reader's query — a subject id, a
|
|
43
|
+
* phrase from a summary, an action kind, a principal — lands on one of these. */
|
|
44
|
+
export declare function stateSearchDoc(kind: StateKind, record: StateRecord): {
|
|
45
|
+
title: string;
|
|
46
|
+
body: string;
|
|
47
|
+
};
|
|
48
|
+
/** The one-line render shared by hunch_query, `hunch query` and the context "State" section:
|
|
49
|
+
* [commitment/in_force] customer:Site:7 — "send report" due 2026-09-11 (owner sofia)
|
|
50
|
+
* [derived/current] customer:Site:7 — <first 120 chars of the summary>
|
|
51
|
+
* [receipt/verified] event:10042 — events_add_actions by sofia@david 2026-09-08 */
|
|
52
|
+
export declare function renderStateLine(kind: StateKind, record: StateRecord): string;
|
|
53
|
+
/** One ranked state hit, as the store's stateSlice() returns it. `score` is the search
|
|
54
|
+
* score (bm25: lower is better; 0 for the LIKE fallback and exact-subject matches). */
|
|
55
|
+
export interface StateHit<K extends StateKind = StateKind> {
|
|
56
|
+
kind: K;
|
|
57
|
+
record: StateRecord;
|
|
58
|
+
score: number;
|
|
59
|
+
}
|
|
60
|
+
/** Bounded caps for the context "State" section: current derived, in-force commitments,
|
|
61
|
+
* latest receipts. Deliberately small — a brief, not a dump; `nuryel_read` is the full view. */
|
|
62
|
+
export declare const STATE_SLICE_CAPS: {
|
|
63
|
+
readonly derived: 3;
|
|
64
|
+
readonly commitments: 5;
|
|
65
|
+
readonly receipts: 3;
|
|
66
|
+
};
|
|
67
|
+
export interface StateSlice {
|
|
68
|
+
derived: StateHit<"derived">[];
|
|
69
|
+
commitments: StateHit<"commitments">[];
|
|
70
|
+
receipts: StateHit<"receipts">[];
|
|
71
|
+
}
|
|
72
|
+
/** Deterministic order for a state slice: score (best first), then observed_at DESC (latest
|
|
73
|
+
* first), then id ASC. Applied after liveness filtering, before the cap. */
|
|
74
|
+
export declare function compareStateHits(a: StateHit, b: StateHit): number;
|
|
75
|
+
/** Render a state slice as delivery supplements (one header + one line per record) so the
|
|
76
|
+
* section shares the context brief's hard budget and receipt like every other grounding.
|
|
77
|
+
* Empty slice → no supplements at all: a store with zero state records is byte-identical. */
|
|
78
|
+
export declare function stateSupplements(slice: StateSlice, target: string): DeliverySupplement[];
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* nuryel.state/1 — the RECORD schemas (the facets that are new record kinds in the store).
|
|
3
|
+
*
|
|
4
|
+
* Kept separate from stateContract.ts (verbs, invariants, hashing) because the store's kind
|
|
5
|
+
* registry in types.ts must reference these schemas, and stateContract imports types.ts —
|
|
6
|
+
* this module imports only zod, the id helpers and the provenance leaf, so there is no cycle.
|
|
7
|
+
*
|
|
8
|
+
* Facets here: done (ActionReceipt), committed (Commitment), current (DerivedState with
|
|
9
|
+
* mandatory dependencies), entity / relationship (external, Landscape-shaped), plus the
|
|
10
|
+
* credential-free ExternalRef ("changed") and DependencyRef they share. Scope is the one
|
|
11
|
+
* graph's partition: organization › team › user › repository.
|
|
12
|
+
*/
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
import { edgeId, resourceId } from "./ids.js";
|
|
15
|
+
export declare const RECEIPT_SCHEMA_VERSION: "nuryel.receipt/1";
|
|
16
|
+
export declare const COMMITMENT_SCHEMA_VERSION: "nuryel.commitment/1";
|
|
17
|
+
export declare const DERIVED_SCHEMA_VERSION: "nuryel.derived/1";
|
|
18
|
+
export declare const ENTITY_SCHEMA_VERSION: "nuryel.entity/1";
|
|
19
|
+
export declare const RELATIONSHIP_SCHEMA_VERSION: "nuryel.relationship/1";
|
|
20
|
+
/** organization › team › user › repository — partitions of ONE graph, not separate stores. */
|
|
21
|
+
export declare const SCOPE_KINDS: readonly ["organization", "team", "user", "repository"];
|
|
22
|
+
export declare const ScopeSchema: z.ZodObject<{
|
|
23
|
+
kind: z.ZodEnum<{
|
|
24
|
+
repository: "repository";
|
|
25
|
+
organization: "organization";
|
|
26
|
+
team: "team";
|
|
27
|
+
user: "user";
|
|
28
|
+
}>;
|
|
29
|
+
id: z.ZodString;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
export type Scope = z.infer<typeof ScopeSchema>;
|
|
32
|
+
export declare const scopePath: (scope: Scope) => string;
|
|
33
|
+
/** "What changed" and "where this came from": a credential-free pointer to an object that
|
|
34
|
+
* stays authoritative in its own system. Nuryel never mirrors its content. */
|
|
35
|
+
export declare const ExternalRefSchema: z.ZodObject<{
|
|
36
|
+
system: z.ZodString;
|
|
37
|
+
object_type: z.ZodString;
|
|
38
|
+
object_key: z.ZodString;
|
|
39
|
+
version: z.ZodOptional<z.ZodString>;
|
|
40
|
+
content_hash: z.ZodOptional<z.ZodString>;
|
|
41
|
+
observed_at: z.ZodString;
|
|
42
|
+
locator: z.ZodOptional<z.ZodString>;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
export type ExternalRef = z.infer<typeof ExternalRefSchema>;
|
|
45
|
+
/** The external system's own key, canonicalized so two writers that copied it from the same
|
|
46
|
+
* system agree byte for byte: Unicode NFC, trimmed, internal whitespace collapsed. Case is
|
|
47
|
+
* preserved — the key belongs to the external system, and folding it could merge two of its
|
|
48
|
+
* records. No other guessing: identity here is explicit refs, never similarity. */
|
|
49
|
+
export declare function canonicalObjectKey(key: string): string;
|
|
50
|
+
/** The identity of an external record across writers: system, type and canonical key. Two
|
|
51
|
+
* entities in one partition that carry the same external key are the same thing. */
|
|
52
|
+
export declare function externalKey(ref: Pick<ExternalRef, "system" | "object_type" | "object_key">): string;
|
|
53
|
+
/** The subject an external record is known by, the convention the read verb already uses for
|
|
54
|
+
* receipts (`event:26904`): the object type and the canonical key. When an entity in the
|
|
55
|
+
* partition carries the ref, that entity's id is the subject and this form resolves to it. */
|
|
56
|
+
export declare function subjectOfRef(ref: Pick<ExternalRef, "object_type" | "object_key">): string;
|
|
57
|
+
/** What a derived statement rests on. Exactly what a currentness check re-validates. */
|
|
58
|
+
export declare const DependencyRefSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
59
|
+
kind: z.ZodLiteral<"record">;
|
|
60
|
+
id: z.ZodString;
|
|
61
|
+
record_hash: z.ZodString;
|
|
62
|
+
scope: z.ZodOptional<z.ZodObject<{
|
|
63
|
+
kind: z.ZodEnum<{
|
|
64
|
+
repository: "repository";
|
|
65
|
+
organization: "organization";
|
|
66
|
+
team: "team";
|
|
67
|
+
user: "user";
|
|
68
|
+
}>;
|
|
69
|
+
id: z.ZodString;
|
|
70
|
+
}, z.core.$strict>>;
|
|
71
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
72
|
+
kind: z.ZodLiteral<"external">;
|
|
73
|
+
ref: z.ZodObject<{
|
|
74
|
+
system: z.ZodString;
|
|
75
|
+
object_type: z.ZodString;
|
|
76
|
+
object_key: z.ZodString;
|
|
77
|
+
version: z.ZodOptional<z.ZodString>;
|
|
78
|
+
content_hash: z.ZodOptional<z.ZodString>;
|
|
79
|
+
observed_at: z.ZodString;
|
|
80
|
+
locator: z.ZodOptional<z.ZodString>;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
83
|
+
kind: z.ZodLiteral<"schema">;
|
|
84
|
+
name: z.ZodString;
|
|
85
|
+
fingerprint: z.ZodString;
|
|
86
|
+
}, z.core.$strict>], "kind">;
|
|
87
|
+
export type DependencyRef = z.infer<typeof DependencyRefSchema>;
|
|
88
|
+
/** done — a side effect that happened. Never replayable as a read; idempotency is explicit. */
|
|
89
|
+
export declare const ActionReceiptSchema: z.ZodObject<{
|
|
90
|
+
schema: z.ZodLiteral<"nuryel.receipt/1">;
|
|
91
|
+
id: z.ZodString;
|
|
92
|
+
scope: z.ZodObject<{
|
|
93
|
+
kind: z.ZodEnum<{
|
|
94
|
+
repository: "repository";
|
|
95
|
+
organization: "organization";
|
|
96
|
+
team: "team";
|
|
97
|
+
user: "user";
|
|
98
|
+
}>;
|
|
99
|
+
id: z.ZodString;
|
|
100
|
+
}, z.core.$strict>;
|
|
101
|
+
actor: z.ZodString;
|
|
102
|
+
action_kind: z.ZodString;
|
|
103
|
+
target: z.ZodObject<{
|
|
104
|
+
system: z.ZodString;
|
|
105
|
+
object_type: z.ZodString;
|
|
106
|
+
object_key: z.ZodString;
|
|
107
|
+
version: z.ZodOptional<z.ZodString>;
|
|
108
|
+
content_hash: z.ZodOptional<z.ZodString>;
|
|
109
|
+
observed_at: z.ZodString;
|
|
110
|
+
locator: z.ZodOptional<z.ZodString>;
|
|
111
|
+
}, z.core.$strict>;
|
|
112
|
+
request_fingerprint: z.ZodString;
|
|
113
|
+
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
114
|
+
state: z.ZodEnum<{
|
|
115
|
+
unknown: "unknown";
|
|
116
|
+
requested: "requested";
|
|
117
|
+
succeeded: "succeeded";
|
|
118
|
+
failed: "failed";
|
|
119
|
+
verified: "verified";
|
|
120
|
+
}>;
|
|
121
|
+
occurred_at: z.ZodString;
|
|
122
|
+
verified_at: z.ZodOptional<z.ZodString>;
|
|
123
|
+
result_fingerprint: z.ZodOptional<z.ZodString>;
|
|
124
|
+
invalidates: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
125
|
+
rests_on: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
126
|
+
kind: z.ZodLiteral<"record">;
|
|
127
|
+
id: z.ZodString;
|
|
128
|
+
record_hash: z.ZodString;
|
|
129
|
+
scope: z.ZodOptional<z.ZodObject<{
|
|
130
|
+
kind: z.ZodEnum<{
|
|
131
|
+
repository: "repository";
|
|
132
|
+
organization: "organization";
|
|
133
|
+
team: "team";
|
|
134
|
+
user: "user";
|
|
135
|
+
}>;
|
|
136
|
+
id: z.ZodString;
|
|
137
|
+
}, z.core.$strict>>;
|
|
138
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
139
|
+
kind: z.ZodLiteral<"external">;
|
|
140
|
+
ref: z.ZodObject<{
|
|
141
|
+
system: z.ZodString;
|
|
142
|
+
object_type: z.ZodString;
|
|
143
|
+
object_key: z.ZodString;
|
|
144
|
+
version: z.ZodOptional<z.ZodString>;
|
|
145
|
+
content_hash: z.ZodOptional<z.ZodString>;
|
|
146
|
+
observed_at: z.ZodString;
|
|
147
|
+
locator: z.ZodOptional<z.ZodString>;
|
|
148
|
+
}, z.core.$strict>;
|
|
149
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
150
|
+
kind: z.ZodLiteral<"schema">;
|
|
151
|
+
name: z.ZodString;
|
|
152
|
+
fingerprint: z.ZodString;
|
|
153
|
+
}, z.core.$strict>], "kind">>>;
|
|
154
|
+
provenance: z.ZodObject<{
|
|
155
|
+
source: z.ZodString;
|
|
156
|
+
confidence: z.ZodNumber;
|
|
157
|
+
evidence: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
158
|
+
last_verified: z.ZodOptional<z.ZodString>;
|
|
159
|
+
}, z.core.$strip>;
|
|
160
|
+
}, z.core.$strict>;
|
|
161
|
+
export type ActionReceipt = z.infer<typeof ActionReceiptSchema>;
|
|
162
|
+
/** committed — an obligation with a due date and an in-force window. */
|
|
163
|
+
export declare const CommitmentSchema: z.ZodObject<{
|
|
164
|
+
schema: z.ZodLiteral<"nuryel.commitment/1">;
|
|
165
|
+
id: z.ZodString;
|
|
166
|
+
scope: z.ZodObject<{
|
|
167
|
+
kind: z.ZodEnum<{
|
|
168
|
+
repository: "repository";
|
|
169
|
+
organization: "organization";
|
|
170
|
+
team: "team";
|
|
171
|
+
user: "user";
|
|
172
|
+
}>;
|
|
173
|
+
id: z.ZodString;
|
|
174
|
+
}, z.core.$strict>;
|
|
175
|
+
subject: z.ZodString;
|
|
176
|
+
title: z.ZodString;
|
|
177
|
+
owner: z.ZodString;
|
|
178
|
+
due: z.ZodString;
|
|
179
|
+
status: z.ZodEnum<{
|
|
180
|
+
open: "open";
|
|
181
|
+
waiting: "waiting";
|
|
182
|
+
done: "done";
|
|
183
|
+
cancelled: "cancelled";
|
|
184
|
+
}>;
|
|
185
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
186
|
+
system: z.ZodString;
|
|
187
|
+
object_type: z.ZodString;
|
|
188
|
+
object_key: z.ZodString;
|
|
189
|
+
version: z.ZodOptional<z.ZodString>;
|
|
190
|
+
content_hash: z.ZodOptional<z.ZodString>;
|
|
191
|
+
observed_at: z.ZodString;
|
|
192
|
+
locator: z.ZodOptional<z.ZodString>;
|
|
193
|
+
}, z.core.$strict>>;
|
|
194
|
+
evidence_excerpt: z.ZodOptional<z.ZodString>;
|
|
195
|
+
closed_by: z.ZodOptional<z.ZodString>;
|
|
196
|
+
valid_from: z.ZodString;
|
|
197
|
+
valid_to: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
198
|
+
provenance: z.ZodObject<{
|
|
199
|
+
source: z.ZodString;
|
|
200
|
+
confidence: z.ZodNumber;
|
|
201
|
+
evidence: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
202
|
+
last_verified: z.ZodOptional<z.ZodString>;
|
|
203
|
+
}, z.core.$strip>;
|
|
204
|
+
}, z.core.$strict>;
|
|
205
|
+
export type Commitment = z.infer<typeof CommitmentSchema>;
|
|
206
|
+
/** current — a statement that is true now, and on what it rests. Dependencies are mandatory:
|
|
207
|
+
* a derived statement without them cannot be invalidated and therefore cannot be trusted. */
|
|
208
|
+
export declare const DerivedStateSchema: z.ZodObject<{
|
|
209
|
+
schema: z.ZodLiteral<"nuryel.derived/1">;
|
|
210
|
+
id: z.ZodString;
|
|
211
|
+
scope: z.ZodObject<{
|
|
212
|
+
kind: z.ZodEnum<{
|
|
213
|
+
repository: "repository";
|
|
214
|
+
organization: "organization";
|
|
215
|
+
team: "team";
|
|
216
|
+
user: "user";
|
|
217
|
+
}>;
|
|
218
|
+
id: z.ZodString;
|
|
219
|
+
}, z.core.$strict>;
|
|
220
|
+
subject: z.ZodString;
|
|
221
|
+
content: z.ZodString;
|
|
222
|
+
content_hash: z.ZodString;
|
|
223
|
+
dependencies: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
224
|
+
kind: z.ZodLiteral<"record">;
|
|
225
|
+
id: z.ZodString;
|
|
226
|
+
record_hash: z.ZodString;
|
|
227
|
+
scope: z.ZodOptional<z.ZodObject<{
|
|
228
|
+
kind: z.ZodEnum<{
|
|
229
|
+
repository: "repository";
|
|
230
|
+
organization: "organization";
|
|
231
|
+
team: "team";
|
|
232
|
+
user: "user";
|
|
233
|
+
}>;
|
|
234
|
+
id: z.ZodString;
|
|
235
|
+
}, z.core.$strict>>;
|
|
236
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
237
|
+
kind: z.ZodLiteral<"external">;
|
|
238
|
+
ref: z.ZodObject<{
|
|
239
|
+
system: z.ZodString;
|
|
240
|
+
object_type: z.ZodString;
|
|
241
|
+
object_key: z.ZodString;
|
|
242
|
+
version: z.ZodOptional<z.ZodString>;
|
|
243
|
+
content_hash: z.ZodOptional<z.ZodString>;
|
|
244
|
+
observed_at: z.ZodString;
|
|
245
|
+
locator: z.ZodOptional<z.ZodString>;
|
|
246
|
+
}, z.core.$strict>;
|
|
247
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
248
|
+
kind: z.ZodLiteral<"schema">;
|
|
249
|
+
name: z.ZodString;
|
|
250
|
+
fingerprint: z.ZodString;
|
|
251
|
+
}, z.core.$strict>], "kind">>;
|
|
252
|
+
transform_version: z.ZodString;
|
|
253
|
+
computed_at: z.ZodString;
|
|
254
|
+
valid_to: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
255
|
+
state: z.ZodEnum<{
|
|
256
|
+
unknown: "unknown";
|
|
257
|
+
current: "current";
|
|
258
|
+
stale: "stale";
|
|
259
|
+
}>;
|
|
260
|
+
review: z.ZodOptional<z.ZodObject<{
|
|
261
|
+
by: z.ZodString;
|
|
262
|
+
at: z.ZodString;
|
|
263
|
+
previous_hash: z.ZodString;
|
|
264
|
+
reason: z.ZodString;
|
|
265
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
266
|
+
ref: z.ZodObject<{
|
|
267
|
+
system: z.ZodString;
|
|
268
|
+
object_type: z.ZodString;
|
|
269
|
+
object_key: z.ZodString;
|
|
270
|
+
version: z.ZodOptional<z.ZodString>;
|
|
271
|
+
content_hash: z.ZodOptional<z.ZodString>;
|
|
272
|
+
observed_at: z.ZodString;
|
|
273
|
+
locator: z.ZodOptional<z.ZodString>;
|
|
274
|
+
}, z.core.$strict>;
|
|
275
|
+
excerpt: z.ZodString;
|
|
276
|
+
}, z.core.$strict>>;
|
|
277
|
+
}, z.core.$strict>>;
|
|
278
|
+
provenance: z.ZodObject<{
|
|
279
|
+
source: z.ZodString;
|
|
280
|
+
confidence: z.ZodNumber;
|
|
281
|
+
evidence: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
282
|
+
last_verified: z.ZodOptional<z.ZodString>;
|
|
283
|
+
}, z.core.$strip>;
|
|
284
|
+
}, z.core.$strict>;
|
|
285
|
+
export type DerivedState = z.infer<typeof DerivedStateSchema>;
|
|
286
|
+
/** entity — a customer, an incident, a thread: a non-code node, Landscape-shaped (kind-qualified
|
|
287
|
+
* id, lifecycle, provenance), with provenance pointers instead of mirrored content. Stored in
|
|
288
|
+
* an index file, like resources, because kind-qualified ids are not safe file names. */
|
|
289
|
+
export declare const ExternalEntitySchema: z.ZodObject<{
|
|
290
|
+
schema: z.ZodLiteral<"nuryel.entity/1">;
|
|
291
|
+
id: z.ZodString;
|
|
292
|
+
kind: z.ZodString;
|
|
293
|
+
name: z.ZodString;
|
|
294
|
+
scope: z.ZodObject<{
|
|
295
|
+
kind: z.ZodEnum<{
|
|
296
|
+
repository: "repository";
|
|
297
|
+
organization: "organization";
|
|
298
|
+
team: "team";
|
|
299
|
+
user: "user";
|
|
300
|
+
}>;
|
|
301
|
+
id: z.ZodString;
|
|
302
|
+
}, z.core.$strict>;
|
|
303
|
+
refs: z.ZodArray<z.ZodObject<{
|
|
304
|
+
system: z.ZodString;
|
|
305
|
+
object_type: z.ZodString;
|
|
306
|
+
object_key: z.ZodString;
|
|
307
|
+
version: z.ZodOptional<z.ZodString>;
|
|
308
|
+
content_hash: z.ZodOptional<z.ZodString>;
|
|
309
|
+
observed_at: z.ZodString;
|
|
310
|
+
locator: z.ZodOptional<z.ZodString>;
|
|
311
|
+
}, z.core.$strict>>;
|
|
312
|
+
attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
313
|
+
lifecycle: z.ZodDefault<z.ZodEnum<{
|
|
314
|
+
active: "active";
|
|
315
|
+
deprecated: "deprecated";
|
|
316
|
+
retired: "retired";
|
|
317
|
+
}>>;
|
|
318
|
+
merged_into: z.ZodOptional<z.ZodString>;
|
|
319
|
+
provenance: z.ZodObject<{
|
|
320
|
+
source: z.ZodString;
|
|
321
|
+
confidence: z.ZodNumber;
|
|
322
|
+
evidence: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
323
|
+
last_verified: z.ZodOptional<z.ZodString>;
|
|
324
|
+
}, z.core.$strip>;
|
|
325
|
+
created_at: z.ZodString;
|
|
326
|
+
updated_at: z.ZodString;
|
|
327
|
+
}, z.core.$strict>;
|
|
328
|
+
export type ExternalEntity = z.infer<typeof ExternalEntitySchema>;
|
|
329
|
+
/** relationship — rides the same identity rule as the graph's edges. Index-file stored. */
|
|
330
|
+
export declare const StateRelationshipSchema: z.ZodObject<{
|
|
331
|
+
schema: z.ZodLiteral<"nuryel.relationship/1">;
|
|
332
|
+
id: z.ZodString;
|
|
333
|
+
from: z.ZodString;
|
|
334
|
+
to: z.ZodString;
|
|
335
|
+
type: z.ZodString;
|
|
336
|
+
scope: z.ZodObject<{
|
|
337
|
+
kind: z.ZodEnum<{
|
|
338
|
+
repository: "repository";
|
|
339
|
+
organization: "organization";
|
|
340
|
+
team: "team";
|
|
341
|
+
user: "user";
|
|
342
|
+
}>;
|
|
343
|
+
id: z.ZodString;
|
|
344
|
+
}, z.core.$strict>;
|
|
345
|
+
reason: z.ZodDefault<z.ZodString>;
|
|
346
|
+
observation_hash: z.ZodOptional<z.ZodString>;
|
|
347
|
+
evidence: z.ZodOptional<z.ZodObject<{
|
|
348
|
+
system: z.ZodString;
|
|
349
|
+
object_type: z.ZodString;
|
|
350
|
+
object_key: z.ZodString;
|
|
351
|
+
version: z.ZodOptional<z.ZodString>;
|
|
352
|
+
content_hash: z.ZodOptional<z.ZodString>;
|
|
353
|
+
observed_at: z.ZodString;
|
|
354
|
+
locator: z.ZodOptional<z.ZodString>;
|
|
355
|
+
}, z.core.$strict>>;
|
|
356
|
+
lifecycle: z.ZodOptional<z.ZodEnum<{
|
|
357
|
+
active: "active";
|
|
358
|
+
retired: "retired";
|
|
359
|
+
}>>;
|
|
360
|
+
provenance: z.ZodObject<{
|
|
361
|
+
source: z.ZodString;
|
|
362
|
+
confidence: z.ZodNumber;
|
|
363
|
+
evidence: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
364
|
+
last_verified: z.ZodOptional<z.ZodString>;
|
|
365
|
+
}, z.core.$strip>;
|
|
366
|
+
}, z.core.$strict>;
|
|
367
|
+
export type StateRelationship = z.infer<typeof StateRelationshipSchema>;
|
|
368
|
+
/** DNA facet: existing Project DNA profiles, keyed by scope. No new schema — the reference only. */
|
|
369
|
+
export declare const DnaFacetRefSchema: z.ZodObject<{
|
|
370
|
+
schema: z.ZodLiteral<"hunch.project-dna/1">;
|
|
371
|
+
scope: z.ZodObject<{
|
|
372
|
+
kind: z.ZodEnum<{
|
|
373
|
+
repository: "repository";
|
|
374
|
+
organization: "organization";
|
|
375
|
+
team: "team";
|
|
376
|
+
user: "user";
|
|
377
|
+
}>;
|
|
378
|
+
id: z.ZodString;
|
|
379
|
+
}, z.core.$strict>;
|
|
380
|
+
profile_id: z.ZodString;
|
|
381
|
+
}, z.core.$strict>;
|
|
382
|
+
export declare const entityId: typeof resourceId;
|
|
383
|
+
export declare const relationshipId: typeof edgeId;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/** `hunch stats` — the ONE data contract (dec_6253f7e6d6). A pure aggregation over
|
|
2
|
+
* the graph Hunch already builds plus the append-only catch-log (core/events.ts):
|
|
3
|
+
* STOCK (what's accumulated) → RETURN (what that stock caught) → COMPOUNDING (the
|
|
4
|
+
* ratio that should climb). Every surface — CLI receipt, VS Code extension, the
|
|
5
|
+
* public proof-curve — is a read-only pane of glass over this object; if a number
|
|
6
|
+
* can't come from here it doesn't exist.
|
|
7
|
+
*
|
|
8
|
+
* HONESTY (the red-team baked into the decision): nothing here fabricates a number
|
|
9
|
+
* the live graph can't produce. `coverage.pct` is 0 until decisions actually carry
|
|
10
|
+
* `related_components`; `bugs_reprevented` is 0 until a bug reaches `regressed`;
|
|
11
|
+
* catches come only from real gate events, never a hypothetical. A skeptic running
|
|
12
|
+
* this on a young graph SHOULD see zeros — that's the honest state, not a bug. */
|
|
13
|
+
import type { Bug, Constraint, Decision } from "./types.js";
|
|
14
|
+
import type { HunchEvent } from "./events.js";
|
|
15
|
+
export interface StatsInput {
|
|
16
|
+
decisions: Decision[];
|
|
17
|
+
constraints: Constraint[];
|
|
18
|
+
bugs: Bug[];
|
|
19
|
+
/** Component ids in the graph (for coverage = decisions-touching ÷ total). */
|
|
20
|
+
componentIds: string[];
|
|
21
|
+
runbooksCount: number;
|
|
22
|
+
events: HunchEvent[];
|
|
23
|
+
/** Count of constraints whose guarded code moved since last verified (from the
|
|
24
|
+
* store's staleness walk — passed in so this module stays pure). */
|
|
25
|
+
staleConstraints: number;
|
|
26
|
+
/** ms epoch "now" and the start of the recent window (now − since). */
|
|
27
|
+
now: number;
|
|
28
|
+
windowStart: number;
|
|
29
|
+
windowLabel: string;
|
|
30
|
+
}
|
|
31
|
+
export interface StatsReturn {
|
|
32
|
+
violations_caught: number;
|
|
33
|
+
drifts_flagged: number;
|
|
34
|
+
bugs_reprevented: number;
|
|
35
|
+
vetoes_fired: number;
|
|
36
|
+
}
|
|
37
|
+
export interface Stats {
|
|
38
|
+
schema: "hunch.stats/1";
|
|
39
|
+
generated_at: string;
|
|
40
|
+
window: {
|
|
41
|
+
since: string;
|
|
42
|
+
from: string;
|
|
43
|
+
to: string;
|
|
44
|
+
};
|
|
45
|
+
stock: {
|
|
46
|
+
decisions: {
|
|
47
|
+
total: number;
|
|
48
|
+
accepted: number;
|
|
49
|
+
superseded: number;
|
|
50
|
+
proposed: number;
|
|
51
|
+
rejected: number;
|
|
52
|
+
};
|
|
53
|
+
invariants: {
|
|
54
|
+
total: number;
|
|
55
|
+
locked: number;
|
|
56
|
+
advisory: number;
|
|
57
|
+
stale: number;
|
|
58
|
+
};
|
|
59
|
+
components: number;
|
|
60
|
+
bugs: {
|
|
61
|
+
total: number;
|
|
62
|
+
open: number;
|
|
63
|
+
investigating: number;
|
|
64
|
+
fixed: number;
|
|
65
|
+
regressed: number;
|
|
66
|
+
};
|
|
67
|
+
runbooks: number;
|
|
68
|
+
coverage: {
|
|
69
|
+
components_with_decision: number;
|
|
70
|
+
components_total: number;
|
|
71
|
+
pct: number;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
return: {
|
|
75
|
+
window: StatsReturn;
|
|
76
|
+
lifetime: StatsReturn;
|
|
77
|
+
};
|
|
78
|
+
compounding: {
|
|
79
|
+
rules_recorded: number;
|
|
80
|
+
catches_lifetime: number;
|
|
81
|
+
payback_ratio: number;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export declare function computeStats(input: StatsInput): Stats;
|
|
85
|
+
/** Human-readable receipt for the terminal (the CLI's default, non-`--json` output).
|
|
86
|
+
* Same three blocks as the JSON: stock → return → compounding. Honest zeros are
|
|
87
|
+
* shown plainly, never hidden — a young graph reads as young, not as broken. */
|
|
88
|
+
export declare function formatStats(s: Stats): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const STRICT_MIN_CONFIDENCE = 0.8;
|
|
2
|
+
/** Is a provenance source HUMAN-CONFIRMED? Token-aware, so a composite source like
|
|
3
|
+
* "llm_draft+human_confirmed" counts, but a lookalike ("not_human_confirmed",
|
|
4
|
+
* "human_confirmed_pending") does not. The sources Hunch writes are "+"-joined. */
|
|
5
|
+
export declare function isHumanConfirmed(source: string | undefined): boolean;
|
|
6
|
+
export interface StrictConstraint {
|
|
7
|
+
severity?: string;
|
|
8
|
+
provenance?: {
|
|
9
|
+
confidence?: number;
|
|
10
|
+
source?: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/** May this invariant FAIL a commit under --strict? Requires blocking severity,
|
|
14
|
+
* a fresh (non-stale) record, and either high provenance confidence or a
|
|
15
|
+
* human-confirmed source (a person vouched for it). Near/blast-radius hits never
|
|
16
|
+
* reach here — the caller passes only directly-scoped invariants. */
|
|
17
|
+
export declare function isStrictBlocker(c: StrictConstraint, stale: boolean): boolean;
|
|
18
|
+
export type VetoTier = "dep" | "symbol" | "pattern" | "semantic";
|
|
19
|
+
/** May a VETO fail a commit? Sibling of isStrictBlocker, but keys on the TRIPWIRE's
|
|
20
|
+
* trust — not the rejecting decision's — and uses ONE rule for every tier: only a
|
|
21
|
+
* `human_confirmed` tripwire blocks. An llm_draft tripwire never blocks regardless
|
|
22
|
+
* of confidence (an LLM self-score is not a licence to fail a commit); it only
|
|
23
|
+
* warns. Semantic similarity never blocks. In-force + non-stale gates run first.
|
|
24
|
+
* This is what makes the "day-one is advisory" DX true (dec_a466655539). */
|
|
25
|
+
export declare function isVetoBlocker(d: {
|
|
26
|
+
status?: string;
|
|
27
|
+
superseded_by?: string | null;
|
|
28
|
+
valid_to?: string | null;
|
|
29
|
+
}, tw: {
|
|
30
|
+
provenance?: {
|
|
31
|
+
source?: string;
|
|
32
|
+
};
|
|
33
|
+
}, tier: VetoTier, stale: boolean): boolean;
|