@davesheffer/hunch 1.45.2 → 1.47.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/dist/cli/index.js +290 -353
- package/dist/cli/invocation.d.ts +22 -13
- package/dist/cli/invocation.js +49 -29
- package/dist/cli/verify.d.ts +28 -0
- package/dist/cli/verify.js +265 -0
- package/dist/constitution/delta.js +2 -2
- package/dist/constitution/experiment.d.ts +1 -1
- package/dist/constitution/sourceMutation.js +28 -18
- package/dist/core/agenthook.js +26 -6
- package/dist/core/boundedSpawn.d.ts +57 -0
- package/dist/core/boundedSpawn.js +321 -0
- package/dist/core/commitrepair.d.ts +43 -138
- package/dist/core/commitrepair.js +76 -167
- package/dist/core/config.d.ts +6 -0
- package/dist/core/config.js +1 -0
- package/dist/core/correction.js +9 -9
- package/dist/core/delivery.d.ts +6 -1
- package/dist/core/delivery.js +71 -5
- package/dist/core/docanchors.js +9 -9
- package/dist/core/drift.js +22 -27
- package/dist/core/escalations.d.ts +16 -58
- package/dist/core/escalations.js +39 -121
- package/dist/core/glob.d.ts +7 -7
- package/dist/core/glob.js +12 -11
- package/dist/core/groundingLag.d.ts +2 -9
- package/dist/core/groundingLag.js +5 -11
- package/dist/core/groundingMerge.d.ts +2 -7
- package/dist/core/groundingMerge.js +35 -54
- package/dist/core/migrate.d.ts +10 -1
- package/dist/core/migrate.js +17 -6
- package/dist/core/paths.d.ts +17 -24
- package/dist/core/paths.js +37 -43
- package/dist/core/projectDna.js +11 -1
- package/dist/core/refrepair.d.ts +2 -1
- package/dist/core/refrepair.js +4 -4
- package/dist/core/relativeImports.js +6 -2
- package/dist/core/repairqueue.d.ts +17 -34
- package/dist/core/repairqueue.js +48 -98
- package/dist/core/taskSelection.js +48 -6
- package/dist/core/testSelection.d.ts +122 -0
- package/dist/core/testSelection.js +588 -0
- package/dist/core/types.d.ts +3 -3
- package/dist/core/types.js +1 -1
- package/dist/extractors/diff.d.ts +4 -4
- package/dist/extractors/diff.js +25 -29
- package/dist/extractors/git.d.ts +8 -23
- package/dist/extractors/git.js +77 -95
- package/dist/extractors/helm.d.ts +10 -0
- package/dist/extractors/helm.js +43 -59
- package/dist/extractors/indexer.d.ts +6 -0
- package/dist/extractors/indexer.js +168 -184
- package/dist/extractors/k8sManifest.d.ts +23 -80
- package/dist/extractors/k8sManifest.js +319 -690
- package/dist/extractors/languages.d.ts +37 -37
- package/dist/extractors/languages.js +83 -54
- package/dist/extractors/nativeTreeSitter.d.ts +4 -4
- package/dist/extractors/nativeTreeSitter.js +17 -14
- package/dist/extractors/parse.d.ts +27 -13
- package/dist/extractors/parse.js +120 -56
- package/dist/extractors/workspaces.js +3 -1
- package/dist/integrations/claudemd.js +1 -0
- package/dist/integrations/gitignore.js +3 -5
- package/dist/integrations/health.d.ts +6 -0
- package/dist/integrations/health.js +33 -12
- package/dist/integrations/hooks.d.ts +13 -16
- package/dist/integrations/hooks.js +31 -30
- package/dist/integrations/mergeDriver.js +18 -17
- package/dist/integrations/optout.d.ts +3 -0
- package/dist/integrations/optout.js +17 -0
- package/dist/integrations/providers.d.ts +6 -2
- package/dist/integrations/providers.js +19 -2
- package/dist/integrations/team.js +4 -2
- package/dist/integrations/uninstall.d.ts +10 -4
- package/dist/integrations/uninstall.js +22 -18
- package/dist/mcp/server.d.ts +4 -5
- package/dist/mcp/server.js +107 -81
- package/dist/serve/app.js +9 -1
- package/dist/serve/config.js +5 -0
- package/dist/serve/writelock.d.ts +3 -1
- package/dist/serve/writelock.js +17 -3
- package/dist/store/hunchStore.d.ts +2 -1
- package/dist/store/hunchStore.js +20 -23
- package/dist/store/jsonStore.d.ts +13 -3
- package/dist/store/jsonStore.js +37 -13
- package/dist/store/stateBinding.js +17 -4
- package/dist/synthesis/provider.d.ts +19 -21
- package/dist/synthesis/provider.js +93 -154
- package/dist/synthesis/synthesize.d.ts +8 -8
- package/dist/synthesis/synthesize.js +33 -50
- package/package.json +3 -3
- package/server.json +2 -2
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Deterministic text scan for Kubernetes manifest cross-resource references —
|
|
3
|
-
* NOT a tree-sitter walk. Confirmed directly (not assumed): parsing a realistic
|
|
4
|
-
* templated Deployment with this repo's own tree-sitter-yaml bundle showed a
|
|
5
|
-
* same-line templated scalar (`name: {{ include "x" . }}`) parses cleanly, but
|
|
6
|
-
* a block-form injection on its own line (`labels:\n {{- include ... }}` — the
|
|
7
|
-
* pattern real charts use for metadata.labels and spec.selector) collapses the
|
|
8
|
-
* WHOLE REST OF THE DOCUMENT'S error recovery into a flat, unstructured ERROR
|
|
9
|
-
* node. Real charts place such an injection early (right after metadata.name),
|
|
10
|
-
* so it would poison parsing for every field-path this module needs further
|
|
11
|
-
* down the same document. parseSource() (parse.ts) also never exposes its
|
|
12
|
-
* tree-sitter tree to callers at all -- helm.ts's own text-scan precedent
|
|
13
|
-
* exists for the same reason.
|
|
14
|
-
*
|
|
15
|
-
* This is a line-oriented, indentation-tracking scanner (not flat regex, unlike
|
|
16
|
-
* helm.ts's `{{ }}`-action scan) because K8s field-paths are nested block
|
|
17
|
-
* structure (`spec.template.spec.containers[].env[].valueFrom.secretKeyRef.name`)
|
|
18
|
-
* that a flat scan can't reconstruct. It never interprets `{{ }}` as YAML syntax
|
|
19
|
-
* at all -- a `{{ ... }}` on a line's value side is just that line's raw value
|
|
20
|
-
* text, same-line or block-form alike -- so it is immune to the exact failure
|
|
21
|
-
* mode that broke tree-sitter.
|
|
22
|
-
*/
|
|
23
1
|
export type ManifestNameRef = {
|
|
24
2
|
form: "literal";
|
|
25
3
|
value: string;
|
|
@@ -31,72 +9,37 @@ export type ManifestNameRef = {
|
|
|
31
9
|
atChar: number;
|
|
32
10
|
endChar: number;
|
|
33
11
|
};
|
|
34
|
-
interface
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
12
|
+
export interface K8sManifestDocument {
|
|
13
|
+
resource: {
|
|
14
|
+
kind: string;
|
|
15
|
+
name: ManifestNameRef;
|
|
16
|
+
namespace: string | null;
|
|
17
|
+
startChar: number;
|
|
18
|
+
endChar: number;
|
|
19
|
+
} | null;
|
|
20
|
+
references: Array<{
|
|
21
|
+
refKind: string;
|
|
22
|
+
name: ManifestNameRef;
|
|
23
|
+
namespace: string | null;
|
|
24
|
+
}>;
|
|
25
|
+
selector: Record<string, string> | null;
|
|
26
|
+
labels: Record<string, string> | null;
|
|
46
27
|
}
|
|
47
|
-
|
|
48
|
-
interface K8sResourceDoc {
|
|
49
|
-
kind: string;
|
|
50
|
-
name: ManifestNameRef;
|
|
51
|
-
/** `metadata.namespace` when it is a plain literal, else null = UNKNOWN (see
|
|
52
|
-
* literalNamespace). Cluster-scoped kinds need no special case: they simply
|
|
53
|
-
* never carry the field, so they are unknown and compatible with anything. */
|
|
28
|
+
export interface KustomizationInfo {
|
|
54
29
|
namespace: string | null;
|
|
55
|
-
|
|
56
|
-
endChar: number;
|
|
57
|
-
}
|
|
58
|
-
export interface K8sManifestDocument {
|
|
59
|
-
resource: K8sResourceDoc | null;
|
|
60
|
-
references: K8sReferenceCandidate[];
|
|
61
|
-
selector: ManifestLabelMap | null;
|
|
62
|
-
labels: ManifestLabelMap | null;
|
|
30
|
+
resources: string[];
|
|
63
31
|
}
|
|
64
|
-
/** Namespace compatibility per the product rule: a MISSING (unknown) namespace
|
|
65
|
-
* matches anything; two DIFFERENT literal namespaces block the edge. */
|
|
66
|
-
export declare function namespacesCompatible(a: string | null, b: string | null): boolean;
|
|
67
|
-
/** Where a kind's pod spec lives -- factored once so container/volume field
|
|
68
|
-
* paths below aren't hand-duplicated per kind. */
|
|
69
32
|
export declare const POD_SPEC_PATH_BY_KIND: Record<string, string>;
|
|
70
33
|
export declare const LABELS_PATH_BY_KIND: Record<string, string>;
|
|
71
|
-
/** `namespace` is a Kustomize transformer namespace for this file (from
|
|
72
|
-
* kustomizeNamespaces): undefined = no transformer, null = UNKNOWN (two
|
|
73
|
-
* kustomizations render this file into different namespaces). */
|
|
74
34
|
export declare function extractK8sManifest(source: string, opts?: {
|
|
75
35
|
namespace?: string | null;
|
|
76
36
|
}): K8sManifestDocument[];
|
|
77
|
-
export
|
|
78
|
-
/** Top-level `namespace:` when it is a valid literal namespace, else null. */
|
|
79
|
-
namespace: string | null;
|
|
80
|
-
/** `resources:` entries exactly as written (paths relative to the kustomization's directory). */
|
|
81
|
-
resources: string[];
|
|
82
|
-
}
|
|
37
|
+
export declare function namespacesCompatible(a: string | null, b: string | null): boolean;
|
|
83
38
|
export declare function isKustomizationFile(path: string): boolean;
|
|
84
|
-
/** Reads only the two top-level fields the namespace transformer needs:
|
|
85
|
-
* `namespace:` and the `resources:` list (block `- item` lines or a one-line
|
|
86
|
-
* flow `[a, b]`). One linear pass; everything else in the file is ignored. */
|
|
87
39
|
export declare function extractKustomization(source: string): KustomizationInfo;
|
|
88
|
-
/**
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
|
|
93
|
-
* entry naming a directory that holds its own kustomization is a base, and
|
|
94
|
-
* the referring (outer) kustomization's namespace wins over the base's, as
|
|
95
|
-
* Kustomize applies the overlay transformer to the base's output. Only
|
|
96
|
-
* kustomizations no other kustomization references are rendered as roots.
|
|
97
|
-
* A file rendered into two different namespaces (one base shared by dev and
|
|
98
|
-
* prod overlays, the common layout) maps to null = UNKNOWN; a file rendered
|
|
99
|
-
* only without any transformer is absent. Not modelled: remote resources,
|
|
100
|
-
* `components:`, the deprecated `bases:` field, and globs. */
|
|
40
|
+
/**
|
|
41
|
+
* Effective namespace per manifest file after Kustomize's namespace transformer.
|
|
42
|
+
* A file reached with conflicting namespaces maps to null; a file that is only
|
|
43
|
+
* ever kept as written (or never rendered) is absent.
|
|
44
|
+
*/
|
|
101
45
|
export declare function kustomizeNamespaces(kustomizations: ReadonlyMap<string, KustomizationInfo>, files: ReadonlySet<string>): Map<string, string | null>;
|
|
102
|
-
export {};
|