@theglitchking/hit-em-with-the-docs 2.2.0 → 2.4.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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +7 -0
- package/commands/audit-facts.md +25 -0
- package/commands/cite.md +17 -0
- package/commands/extract-facts.md +66 -0
- package/commands/find-citers.md +16 -0
- package/commands/help.md +86 -0
- package/commands/migrate-incident.md +18 -0
- package/dist/action/core/audit/auditor.d.ts +14 -0
- package/dist/action/core/audit/auditor.d.ts.map +1 -1
- package/dist/action/core/domains/classifier.d.ts +15 -1
- package/dist/action/core/domains/classifier.d.ts.map +1 -1
- package/dist/action/core/knowledge-base/audit.d.ts +67 -0
- package/dist/action/core/knowledge-base/audit.d.ts.map +1 -0
- package/dist/action/core/knowledge-base/cite.d.ts +41 -0
- package/dist/action/core/knowledge-base/cite.d.ts.map +1 -0
- package/dist/action/core/knowledge-base/citers.d.ts +119 -0
- package/dist/action/core/knowledge-base/citers.d.ts.map +1 -0
- package/dist/action/core/knowledge-base/extract.d.ts +61 -0
- package/dist/action/core/knowledge-base/extract.d.ts.map +1 -0
- package/dist/action/core/knowledge-base/fix-legacy-layout.d.ts +61 -0
- package/dist/action/core/knowledge-base/fix-legacy-layout.d.ts.map +1 -0
- package/dist/action/core/knowledge-base/migrate.d.ts +67 -0
- package/dist/action/core/knowledge-base/migrate.d.ts.map +1 -0
- package/dist/action/core/maintain/orchestrator.d.ts.map +1 -1
- package/dist/action/core/metadata/errors.d.ts +62 -0
- package/dist/action/core/metadata/errors.d.ts.map +1 -0
- package/dist/action/core/metadata/schema.d.ts +709 -58
- package/dist/action/core/metadata/schema.d.ts.map +1 -1
- package/dist/action/generators/facts-index.d.ts +27 -0
- package/dist/action/generators/facts-index.d.ts.map +1 -0
- package/dist/action/generators/incidents-index.d.ts +21 -0
- package/dist/action/generators/incidents-index.d.ts.map +1 -0
- package/dist/action/generators/symptoms-index.d.ts +20 -0
- package/dist/action/generators/symptoms-index.d.ts.map +1 -0
- package/dist/action/generators/table.d.ts +8 -0
- package/dist/action/generators/table.d.ts.map +1 -0
- package/dist/action/index.d.ts +7 -0
- package/dist/action/index.d.ts.map +1 -1
- package/dist/action/index.js +4 -4
- package/dist/action/utils/config.d.ts +99 -0
- package/dist/action/utils/config.d.ts.map +1 -0
- package/dist/cli/index.js +315 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/core/audit/auditor.d.ts +14 -0
- package/dist/core/audit/auditor.d.ts.map +1 -1
- package/dist/core/audit/auditor.js +19 -3
- package/dist/core/audit/auditor.js.map +1 -1
- package/dist/core/domains/classifier.d.ts +15 -1
- package/dist/core/domains/classifier.d.ts.map +1 -1
- package/dist/core/domains/classifier.js +83 -1
- package/dist/core/domains/classifier.js.map +1 -1
- package/dist/core/knowledge-base/audit.d.ts +67 -0
- package/dist/core/knowledge-base/audit.d.ts.map +1 -0
- package/dist/core/knowledge-base/audit.js +158 -0
- package/dist/core/knowledge-base/audit.js.map +1 -0
- package/dist/core/knowledge-base/cite.d.ts +41 -0
- package/dist/core/knowledge-base/cite.d.ts.map +1 -0
- package/dist/core/knowledge-base/cite.js +82 -0
- package/dist/core/knowledge-base/cite.js.map +1 -0
- package/dist/core/knowledge-base/citers.d.ts +119 -0
- package/dist/core/knowledge-base/citers.d.ts.map +1 -0
- package/dist/core/knowledge-base/citers.js +249 -0
- package/dist/core/knowledge-base/citers.js.map +1 -0
- package/dist/core/knowledge-base/extract.d.ts +61 -0
- package/dist/core/knowledge-base/extract.d.ts.map +1 -0
- package/dist/core/knowledge-base/extract.js +132 -0
- package/dist/core/knowledge-base/extract.js.map +1 -0
- package/dist/core/knowledge-base/fix-legacy-layout.d.ts +61 -0
- package/dist/core/knowledge-base/fix-legacy-layout.d.ts.map +1 -0
- package/dist/core/knowledge-base/fix-legacy-layout.js +189 -0
- package/dist/core/knowledge-base/fix-legacy-layout.js.map +1 -0
- package/dist/core/knowledge-base/migrate.d.ts +67 -0
- package/dist/core/knowledge-base/migrate.d.ts.map +1 -0
- package/dist/core/knowledge-base/migrate.js +147 -0
- package/dist/core/knowledge-base/migrate.js.map +1 -0
- package/dist/core/maintain/orchestrator.d.ts.map +1 -1
- package/dist/core/maintain/orchestrator.js +48 -1
- package/dist/core/maintain/orchestrator.js.map +1 -1
- package/dist/core/metadata/errors.d.ts +62 -0
- package/dist/core/metadata/errors.d.ts.map +1 -0
- package/dist/core/metadata/errors.js +95 -0
- package/dist/core/metadata/errors.js.map +1 -0
- package/dist/core/metadata/schema.d.ts +709 -58
- package/dist/core/metadata/schema.d.ts.map +1 -1
- package/dist/core/metadata/schema.js +453 -79
- package/dist/core/metadata/schema.js.map +1 -1
- package/dist/generators/facts-index.d.ts +27 -0
- package/dist/generators/facts-index.d.ts.map +1 -0
- package/dist/generators/facts-index.js +111 -0
- package/dist/generators/facts-index.js.map +1 -0
- package/dist/generators/incidents-index.d.ts +21 -0
- package/dist/generators/incidents-index.d.ts.map +1 -0
- package/dist/generators/incidents-index.js +79 -0
- package/dist/generators/incidents-index.js.map +1 -0
- package/dist/generators/symptoms-index.d.ts +20 -0
- package/dist/generators/symptoms-index.d.ts.map +1 -0
- package/dist/generators/symptoms-index.js +123 -0
- package/dist/generators/symptoms-index.js.map +1 -0
- package/dist/generators/table.d.ts +8 -0
- package/dist/generators/table.d.ts.map +1 -0
- package/dist/generators/table.js +23 -0
- package/dist/generators/table.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/config.d.ts +99 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +95 -0
- package/dist/utils/config.js.map +1 -0
- package/package.json +1 -1
- package/templates/knowledge-base/README.md +31 -0
- package/templates/knowledge-base/fact.template.md +44 -0
- package/templates/knowledge-base/incident-facts.template.md +31 -0
- package/templates/knowledge-base/incident-narrative.template.md +50 -0
- package/templates/knowledge-base/playbook-symptoms.template.md +74 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fact-extraction writer (2.3.0 PR3).
|
|
3
|
+
*
|
|
4
|
+
* The CLI side of `hewtd extract-facts <incident-folder>`. Takes accepted
|
|
5
|
+
* fact specs and writes them to `<vault>/facts/<id>.md` with provenance
|
|
6
|
+
* auto-populated to the source incident folder. Idempotent — re-running
|
|
7
|
+
* with an already-committed fact spec is a no-op.
|
|
8
|
+
*
|
|
9
|
+
* The LLM proposal step (read narrative → suggest fact specs) lives in the
|
|
10
|
+
* `/hit-em-with-the-docs:extract-facts` slash command, NOT here. This
|
|
11
|
+
* module is the deterministic writer that the slash command invokes after
|
|
12
|
+
* the user accepts proposals.
|
|
13
|
+
*/
|
|
14
|
+
export interface FactSpec {
|
|
15
|
+
id: string;
|
|
16
|
+
title: string;
|
|
17
|
+
confidence: 'high' | 'medium' | 'low' | 'hypothesis';
|
|
18
|
+
verifyCommand?: string;
|
|
19
|
+
/** Claim paragraph (will be inserted as `## Claim`). */
|
|
20
|
+
claim: string;
|
|
21
|
+
/** Optional how-to-verify paragraph. */
|
|
22
|
+
howToVerify?: string;
|
|
23
|
+
/** Optional consequences paragraph. */
|
|
24
|
+
consequences?: string;
|
|
25
|
+
/** Optional tags (will be merged with auto-derived tags). */
|
|
26
|
+
tags?: string[];
|
|
27
|
+
/** Optional domains. Defaults to ['knowledge-base'] if not specified. */
|
|
28
|
+
domains?: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface ExtractFactsOptions {
|
|
31
|
+
/** Absolute path to the incident folder (must contain narrative.md). */
|
|
32
|
+
incidentFolder: string;
|
|
33
|
+
/** Absolute path to the vault root. Facts go into `<vault>/facts/`. */
|
|
34
|
+
vaultRoot: string;
|
|
35
|
+
/** Project root for provenance relpath computation. */
|
|
36
|
+
projectRoot: string;
|
|
37
|
+
/** Accepted fact specs (already curated by the LLM proposer + user). */
|
|
38
|
+
accept: FactSpec[];
|
|
39
|
+
/** If true, returns the plan without writing files. */
|
|
40
|
+
dryRun?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface ExtractedFact {
|
|
43
|
+
id: string;
|
|
44
|
+
factPath: string;
|
|
45
|
+
action: 'created' | 'already_exists';
|
|
46
|
+
content: string;
|
|
47
|
+
}
|
|
48
|
+
export interface ExtractFactsResult {
|
|
49
|
+
incidentId: string;
|
|
50
|
+
incidentFolder: string;
|
|
51
|
+
extractedFacts: ExtractedFact[];
|
|
52
|
+
/** Whether the incident's facts.md was updated. */
|
|
53
|
+
factsMdUpdated: boolean;
|
|
54
|
+
factsMdPath: string;
|
|
55
|
+
}
|
|
56
|
+
export declare function extractFacts(options: ExtractFactsOptions): Promise<ExtractFactsResult>;
|
|
57
|
+
/**
|
|
58
|
+
* Re-export the resolved vault root so callers don't have to recompute it.
|
|
59
|
+
*/
|
|
60
|
+
export declare function defaultVaultRoot(projectRoot: string): string;
|
|
61
|
+
//# sourceMappingURL=extract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/knowledge-base/extract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,YAAY,CAAC;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,wEAAwE;IACxE,cAAc,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,SAAS,GAAG,gBAAgB,CAAC;IACrC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,mDAAmD;IACnD,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,YAAY,CAChC,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,CAqG7B;AAsBD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE5D"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migrate 2.3.0-buggy incident folders into the canonical layout (2.4.0).
|
|
3
|
+
*
|
|
4
|
+
* In 2.3.0, `hewtd migrate-incident <flat-file>` wrote the new folder
|
|
5
|
+
* AS A SIBLING of the flat file. When the flat file lived at the vault
|
|
6
|
+
* root (the documented example), the resulting folder ended up at
|
|
7
|
+
* `<vault-root>/<slug>/` instead of `<vault-root>/incidents/<slug>/`.
|
|
8
|
+
* The `incidents/INDEX.md` generator scans only the canonical path, so
|
|
9
|
+
* those folders were silently absent from the index.
|
|
10
|
+
*
|
|
11
|
+
* This module:
|
|
12
|
+
* 1. Detects legacy folders — anything matching `<vault-root>/<slug>/`
|
|
13
|
+
* that contains a valid `narrative.md` AND isn't already under the
|
|
14
|
+
* canonical `<vault-root>/incidents/` parent.
|
|
15
|
+
* 2. Moves them into `<vault-root>/incidents/<slug>/` (preserving any
|
|
16
|
+
* `facts.md` / `evidence/` contents).
|
|
17
|
+
* 3. Rewrites `provenance:` references in any `<vault-root>/facts/*.md`
|
|
18
|
+
* files that pointed at the old folder paths.
|
|
19
|
+
*
|
|
20
|
+
* Idempotent: re-running on a clean vault is a no-op with a status report.
|
|
21
|
+
*/
|
|
22
|
+
export interface FixLegacyLayoutOptions {
|
|
23
|
+
/** Absolute vault root. */
|
|
24
|
+
vaultRoot: string;
|
|
25
|
+
/** Project root — used for relative-path provenance rewrites. */
|
|
26
|
+
projectRoot: string;
|
|
27
|
+
/** If true, returns the plan without writing. */
|
|
28
|
+
dryRun?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface MovedFolder {
|
|
31
|
+
/** Slug (folder basename), e.g. `2026-04-23-keycloak-idle-session`. */
|
|
32
|
+
slug: string;
|
|
33
|
+
/** Absolute source path (legacy). */
|
|
34
|
+
from: string;
|
|
35
|
+
/** Absolute destination path (canonical). */
|
|
36
|
+
to: string;
|
|
37
|
+
}
|
|
38
|
+
export interface RewrittenProvenance {
|
|
39
|
+
/** Absolute fact file path. */
|
|
40
|
+
factPath: string;
|
|
41
|
+
/** Old provenance string that was replaced. */
|
|
42
|
+
oldRef: string;
|
|
43
|
+
/** New provenance string. */
|
|
44
|
+
newRef: string;
|
|
45
|
+
}
|
|
46
|
+
export interface FixLegacyLayoutResult {
|
|
47
|
+
vaultRoot: string;
|
|
48
|
+
moved: MovedFolder[];
|
|
49
|
+
rewrittenProvenance: RewrittenProvenance[];
|
|
50
|
+
/** Paths that LOOKED like incident folders but were ambiguous. Reported but not moved. */
|
|
51
|
+
skipped: {
|
|
52
|
+
path: string;
|
|
53
|
+
reason: string;
|
|
54
|
+
}[];
|
|
55
|
+
action: 'fixed' | 'no_op' | 'dry_run';
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Discover and (optionally) relocate 2.3.0-layout incident folders.
|
|
59
|
+
*/
|
|
60
|
+
export declare function fixLegacyLayout(options: FixLegacyLayoutOptions): Promise<FixLegacyLayoutResult>;
|
|
61
|
+
//# sourceMappingURL=fix-legacy-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fix-legacy-layout.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/knowledge-base/fix-legacy-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAOH,MAAM,WAAW,sBAAsB;IACrC,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,WAAW,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,mBAAmB;IAClC,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,mBAAmB,EAAE,mBAAmB,EAAE,CAAC;IAC3C,0FAA0F;IAC1F,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,MAAM,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;CACvC;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAgKhC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flat-file incident → folder migration (2.3.0 PR3, target-path fix in 2.4.0).
|
|
3
|
+
*
|
|
4
|
+
* Reads a legacy flat-file incident and converts it into the folder form
|
|
5
|
+
* AT THE CANONICAL VAULT LOCATION:
|
|
6
|
+
*
|
|
7
|
+
* <flat-file>.md → <vault-root>/incidents/<slug>/narrative.md
|
|
8
|
+
* <vault-root>/incidents/<slug>/facts.md (skeleton)
|
|
9
|
+
* <vault-root>/incidents/<slug>/evidence/ (empty)
|
|
10
|
+
*
|
|
11
|
+
* In 2.3.0 the target was derived from the flat file's parent directory,
|
|
12
|
+
* which produced folders OUTSIDE `<vault-root>/incidents/` when the source
|
|
13
|
+
* was at the vault root. The `incidents/INDEX.md` generator scans only
|
|
14
|
+
* `<vault-root>/incidents/<slug>/narrative.md` and silently missed those
|
|
15
|
+
* folders. 2.4.0 fixes this by always writing under `<vault-root>/incidents/`.
|
|
16
|
+
*
|
|
17
|
+
* Idempotency:
|
|
18
|
+
* - If a valid `narrative.md` exists at EITHER the new path (canonical)
|
|
19
|
+
* OR the legacy path (`<source-parent>/<slug>/narrative.md`), the
|
|
20
|
+
* migration is treated as already done — no-op unless `--force`.
|
|
21
|
+
* - This protects against double-migration and is robust against
|
|
22
|
+
* consumers who already migrated under the 2.3.0 buggy layout.
|
|
23
|
+
*
|
|
24
|
+
* For consumers stuck on the 2.3.0 buggy layout, see `fixLegacyLayout()`
|
|
25
|
+
* which moves stale folders into `<vault-root>/incidents/` and rewrites
|
|
26
|
+
* any fact `provenance:` references.
|
|
27
|
+
*/
|
|
28
|
+
export interface MigrateIncidentOptions {
|
|
29
|
+
/** Absolute path to the flat-file incident markdown. */
|
|
30
|
+
flatFilePath: string;
|
|
31
|
+
/**
|
|
32
|
+
* Absolute path to the vault root. The migrated folder lands at
|
|
33
|
+
* `<vaultRoot>/incidents/<slug>/`. Required since 2.4.0 — the 2.3.0
|
|
34
|
+
* "sibling of the flat file" behavior was the source of the path bug.
|
|
35
|
+
*/
|
|
36
|
+
vaultRoot: string;
|
|
37
|
+
/** If true, returns the migration plan without writing. */
|
|
38
|
+
dryRun?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* If true, proceed with migration even if a folder already exists at
|
|
41
|
+
* the canonical or legacy location. Used to recover from a partial
|
|
42
|
+
* migration.
|
|
43
|
+
*/
|
|
44
|
+
force?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface MigrateIncidentResult {
|
|
47
|
+
flatFilePath: string;
|
|
48
|
+
/** The canonical target — always under `<vaultRoot>/incidents/`. */
|
|
49
|
+
targetFolder: string;
|
|
50
|
+
action: 'migrated' | 'already_migrated' | 'dry_run';
|
|
51
|
+
/**
|
|
52
|
+
* Populated when `action === 'already_migrated'` to indicate WHERE the
|
|
53
|
+
* existing migration was found. `'new'` = canonical `<vault>/incidents/`;
|
|
54
|
+
* `'legacy'` = 2.3.0-style sibling-of-flat-file location. Helps consumers
|
|
55
|
+
* decide whether to run `fix-legacy-layout`.
|
|
56
|
+
*/
|
|
57
|
+
existingLocation?: 'new' | 'legacy';
|
|
58
|
+
narrativePath: string;
|
|
59
|
+
factsPath: string;
|
|
60
|
+
evidencePath: string;
|
|
61
|
+
/** What the narrative.md content will be. */
|
|
62
|
+
narrativeContent: string;
|
|
63
|
+
/** What the facts.md content will be. */
|
|
64
|
+
factsContent: string;
|
|
65
|
+
}
|
|
66
|
+
export declare function migrateIncident(options: MigrateIncidentOptions): Promise<MigrateIncidentResult>;
|
|
67
|
+
//# sourceMappingURL=migrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/knowledge-base/migrate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAOH,MAAM,WAAW,sBAAsB;IACrC,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,UAAU,GAAG,kBAAkB,GAAG,SAAS,CAAC;IACpD;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,gBAAgB,EAAE,MAAM,CAAC;IACzB,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CA8HhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/maintain/orchestrator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/maintain/orchestrator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAa3E,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,kBAAkB,CAAC;IACjC,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAoKtF;AAwRD;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAChE,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC,CAoBD"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error codes for knowledge-base primitive validation (introduced in 2.3.0).
|
|
3
|
+
*
|
|
4
|
+
* The schema's .refine() rules prefix their messages with one of these codes
|
|
5
|
+
* in square brackets, e.g. `[FACT_MISSING_ID] id is required when tier is "fact"`.
|
|
6
|
+
* The audit layer parses the code out of the message to populate AuditIssue.code,
|
|
7
|
+
* which lets CI and tooling switch on specific violation types without
|
|
8
|
+
* substring-matching prose.
|
|
9
|
+
*
|
|
10
|
+
* Codes are namespaced by primitive:
|
|
11
|
+
* FACT_* — facts
|
|
12
|
+
* INCIDENT_* — incident folders (narrative + facts.md)
|
|
13
|
+
* PLAYBOOK_* — playbook symptoms blocks (the symptoms: frontmatter field)
|
|
14
|
+
*/
|
|
15
|
+
export declare const KB_ERROR_CODES: {
|
|
16
|
+
readonly FACT_MISSING_ID: "FACT_MISSING_ID";
|
|
17
|
+
readonly FACT_ID_FILENAME_MISMATCH: "FACT_ID_FILENAME_MISMATCH";
|
|
18
|
+
readonly FACT_MISSING_PROVENANCE: "FACT_MISSING_PROVENANCE";
|
|
19
|
+
readonly FACT_INVALID_CONFIDENCE: "FACT_INVALID_CONFIDENCE";
|
|
20
|
+
readonly FACT_MISSING_LAST_VERIFIED: "FACT_MISSING_LAST_VERIFIED";
|
|
21
|
+
readonly FACT_VERIFY_COMMAND_MULTILINE_SHEBANG: "FACT_VERIFY_COMMAND_MULTILINE_SHEBANG";
|
|
22
|
+
readonly INCIDENT_FOLDER_MISSING_NARRATIVE: "INCIDENT_FOLDER_MISSING_NARRATIVE";
|
|
23
|
+
readonly INCIDENT_FOLDER_MISSING_FACTS: "INCIDENT_FOLDER_MISSING_FACTS";
|
|
24
|
+
readonly INCIDENT_NARRATIVE_MISSING_DATE: "INCIDENT_NARRATIVE_MISSING_DATE";
|
|
25
|
+
readonly INCIDENT_NARRATIVE_MISSING_SEVERITY: "INCIDENT_NARRATIVE_MISSING_SEVERITY";
|
|
26
|
+
readonly INCIDENT_NARRATIVE_INVALID_SEVERITY: "INCIDENT_NARRATIVE_INVALID_SEVERITY";
|
|
27
|
+
readonly INCIDENT_NARRATIVE_MISSING_RESOLUTION_STATUS: "INCIDENT_NARRATIVE_MISSING_RESOLUTION_STATUS";
|
|
28
|
+
readonly INCIDENT_NARRATIVE_INVALID_RESOLUTION_STATUS: "INCIDENT_NARRATIVE_INVALID_RESOLUTION_STATUS";
|
|
29
|
+
readonly INCIDENT_NARRATIVE_MISSING_COMPONENTS: "INCIDENT_NARRATIVE_MISSING_COMPONENTS";
|
|
30
|
+
readonly INCIDENT_FACTS_MISSING_INCIDENT_ID: "INCIDENT_FACTS_MISSING_INCIDENT_ID";
|
|
31
|
+
readonly INCIDENT_FACTS_MISSING_PRODUCED: "INCIDENT_FACTS_MISSING_PRODUCED";
|
|
32
|
+
readonly INCIDENT_FACTS_DANGLING_REF: "INCIDENT_FACTS_DANGLING_REF";
|
|
33
|
+
readonly PLAYBOOK_SYMPTOM_MISSING_KEY: "PLAYBOOK_SYMPTOM_MISSING_KEY";
|
|
34
|
+
readonly PLAYBOOK_SYMPTOM_MISSING_TARGET: "PLAYBOOK_SYMPTOM_MISSING_TARGET";
|
|
35
|
+
readonly PLAYBOOK_SYMPTOM_MISSING_CITES: "PLAYBOOK_SYMPTOM_MISSING_CITES";
|
|
36
|
+
readonly PLAYBOOK_SYMPTOM_DANGLING_CITE: "PLAYBOOK_SYMPTOM_DANGLING_CITE";
|
|
37
|
+
};
|
|
38
|
+
export type KbErrorCode = (typeof KB_ERROR_CODES)[keyof typeof KB_ERROR_CODES];
|
|
39
|
+
/**
|
|
40
|
+
* Severity for each KB error code.
|
|
41
|
+
*
|
|
42
|
+
* Most violations are `error`. The shebang check on verify_command is `warning`
|
|
43
|
+
* because the spec calls it out as "warning only — multi-line is fine, shebang
|
|
44
|
+
* missing is OK". Dangling refs (facts referencing non-existent fact-ids, or
|
|
45
|
+
* playbook citations to non-existent fact-ids) are `error`.
|
|
46
|
+
*/
|
|
47
|
+
export declare const KB_ERROR_SEVERITY: Record<KbErrorCode, 'error' | 'warning'>;
|
|
48
|
+
/**
|
|
49
|
+
* Format a code-prefixed error message. The audit layer parses the leading
|
|
50
|
+
* `[CODE]` to populate `AuditIssue.code` without losing the human-readable
|
|
51
|
+
* description.
|
|
52
|
+
*/
|
|
53
|
+
export declare function formatKbError(code: KbErrorCode, message: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* Extract a KB error code from a refine() message, if present. Returns null
|
|
56
|
+
* for messages that don't begin with `[CODE] `.
|
|
57
|
+
*/
|
|
58
|
+
export declare function parseKbErrorCode(message: string): {
|
|
59
|
+
code: KbErrorCode;
|
|
60
|
+
message: string;
|
|
61
|
+
} | null;
|
|
62
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/metadata/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;CA6BjB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAE/E;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS,CAsBtE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAExE;AAID;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,GACd;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAS/C"}
|