@theglitchking/hit-em-with-the-docs 2.6.0 → 2.7.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.
Files changed (60) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +131 -3
  4. package/commands/archive.md +43 -0
  5. package/commands/help.md +10 -1
  6. package/dist/action/core/archive/candidates.d.ts +38 -0
  7. package/dist/action/core/archive/candidates.d.ts.map +1 -0
  8. package/dist/action/core/archive/links.d.ts +22 -0
  9. package/dist/action/core/archive/links.d.ts.map +1 -0
  10. package/dist/action/core/archive/manage.d.ts +50 -0
  11. package/dist/action/core/archive/manage.d.ts.map +1 -0
  12. package/dist/action/core/audit/auditor.d.ts.map +1 -1
  13. package/dist/action/core/metadata/schema.d.ts +73 -0
  14. package/dist/action/core/metadata/schema.d.ts.map +1 -1
  15. package/dist/action/generators/regenerate.d.ts +14 -3
  16. package/dist/action/generators/regenerate.d.ts.map +1 -1
  17. package/dist/action/generators/scaffold.d.ts.map +1 -1
  18. package/dist/action/index.d.ts +3 -0
  19. package/dist/action/index.d.ts.map +1 -1
  20. package/dist/action/index.js +1 -1
  21. package/dist/action/utils/config.d.ts +72 -0
  22. package/dist/action/utils/config.d.ts.map +1 -1
  23. package/dist/cli/index.js +153 -4
  24. package/dist/cli/index.js.map +1 -1
  25. package/dist/core/archive/candidates.d.ts +38 -0
  26. package/dist/core/archive/candidates.d.ts.map +1 -0
  27. package/dist/core/archive/candidates.js +113 -0
  28. package/dist/core/archive/candidates.js.map +1 -0
  29. package/dist/core/archive/links.d.ts +22 -0
  30. package/dist/core/archive/links.d.ts.map +1 -0
  31. package/dist/core/archive/links.js +33 -0
  32. package/dist/core/archive/links.js.map +1 -0
  33. package/dist/core/archive/manage.d.ts +50 -0
  34. package/dist/core/archive/manage.d.ts.map +1 -0
  35. package/dist/core/archive/manage.js +163 -0
  36. package/dist/core/archive/manage.js.map +1 -0
  37. package/dist/core/audit/auditor.d.ts.map +1 -1
  38. package/dist/core/audit/auditor.js +14 -0
  39. package/dist/core/audit/auditor.js.map +1 -1
  40. package/dist/core/metadata/schema.d.ts +73 -0
  41. package/dist/core/metadata/schema.d.ts.map +1 -1
  42. package/dist/core/metadata/schema.js +14 -1
  43. package/dist/core/metadata/schema.js.map +1 -1
  44. package/dist/generators/regenerate.d.ts +14 -3
  45. package/dist/generators/regenerate.d.ts.map +1 -1
  46. package/dist/generators/regenerate.js +99 -16
  47. package/dist/generators/regenerate.js.map +1 -1
  48. package/dist/generators/scaffold.d.ts.map +1 -1
  49. package/dist/generators/scaffold.js +37 -14
  50. package/dist/generators/scaffold.js.map +1 -1
  51. package/dist/index.d.ts +3 -0
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +4 -0
  54. package/dist/index.js.map +1 -1
  55. package/dist/utils/config.d.ts +72 -0
  56. package/dist/utils/config.d.ts.map +1 -1
  57. package/dist/utils/config.js +20 -0
  58. package/dist/utils/config.js.map +1 -1
  59. package/package.json +1 -1
  60. package/templates/claude/CLAUDE.md +1 -1
@@ -6,13 +6,13 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Official marketplace for hit-em-with-the-docs - Self-managing documentation system",
9
- "version": "2.6.0"
9
+ "version": "2.7.1"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "hit-em-with-the-docs",
14
14
  "description": "Self-managing documentation system with hierarchical structure, intelligent automation, pattern discovery, and agent orchestration",
15
- "version": "2.6.0",
15
+ "version": "2.7.1",
16
16
  "author": {
17
17
  "name": "TheGlitchKing"
18
18
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hit-em-with-the-docs",
3
3
  "description": "Self-managing documentation system with hierarchical structure, intelligent automation, pattern discovery, and agent orchestration",
4
- "version": "2.6.0",
4
+ "version": "2.7.1",
5
5
  "author": {
6
6
  "name": "TheGlitchKing",
7
7
  "email": "theglitchking@users.noreply.github.com"
package/README.md CHANGED
@@ -256,6 +256,9 @@ These commands run in your terminal and manage your documentation.
256
256
  | `hewtd audit` | Check documentation quality and compliance |
257
257
  | `hewtd report <type>` | Generate health, audit, or link reports |
258
258
  | `hewtd discover` | Scan code for patterns and create docs |
259
+ | `hewtd archive <file>` | Retire a doc into `archive/` (reversible, link-safe) |
260
+ | `hewtd unarchive <file>` | Restore an archived doc to where it came from |
261
+ | `hewtd archive-candidates` | List docs that may warrant archiving (advisory) |
259
262
 
260
263
  ##### Command Examples and Details
261
264
 
@@ -871,6 +874,26 @@ src/
871
874
  └── logger.ts # Logging and output formatting
872
875
  ```
873
876
 
877
+ ### Indexing: what counts as a document
878
+
879
+ `INDEX.md` and `REGISTRY.md` are **generated** — `index`, `maintain`, and
880
+ `integrate` rebuild them from disk, so a row you add by hand is overwritten on
881
+ the next run.
882
+
883
+ Domain folders are walked **recursively**, so a document at any depth inside a
884
+ domain is indexed (`standards/backend/foo.md` appears in `standards/INDEX.md` as
885
+ `backend/foo.md`). Never indexed: the generated `INDEX.md`/`REGISTRY.md`
886
+ themselves; anything under `archive/`, `drafts/`, `reports/`, `_templates/`,
887
+ `node_modules/`, or a nested `.documentation/`; and the vault's `facts/`,
888
+ `incidents/`, and `symptoms/` subtrees, which have their own generators.
889
+
890
+ Recursive indexing landed in **2.7.1**. Before that the walk was flat and every
891
+ document in a subfolder was invisible to the whole system — so the first
892
+ `index`/`maintain` run after upgrading will add a row for each one.
893
+
894
+ **Full contract, and the troubleshooting ladder for "my doc isn't in the index":
895
+ [docs/indexing.md](docs/indexing.md).**
896
+
874
897
  ### File Structure
875
898
 
876
899
  When you run `hewtd init`, it creates this structure:
@@ -884,7 +907,9 @@ When you run `hewtd init`, it creates this structure:
884
907
  ├── security/ # Security documentation (priority: 9)
885
908
  │ ├── INDEX.md # Security domain table of contents
886
909
  │ ├── REGISTRY.md # Quick reference for security docs
887
- └── *.md # Individual security documents
910
+ ├── *.md # Individual security documents
911
+ │ └── auth/ # Subfolders are indexed too (2.7.1+)
912
+ │ └── *.md # → listed as auth/<name>.md
888
913
 
889
914
  ├── api/ # API documentation (priority: 8)
890
915
  │ ├── INDEX.md
@@ -919,14 +944,117 @@ When you run `hewtd init`, it creates this structure:
919
944
 
920
945
  #### Archived / deprecated docs (`archive/`)
921
946
 
922
- Move a doc to `.documentation/archive/` to retire it without deleting it. hewtd
947
+ `.documentation/archive/` is the parking lot for retired documentation. hewtd
923
948
  **excludes the entire `archive/` subtree from every scan** — `audit`,
924
949
  `link-check`, `metadata-sync`, `integrate` duplicate-detection, the link graph,
925
950
  and `search`. Archived docs are never validated against the frontmatter schema,
926
951
  never appear in any INDEX.md/REGISTRY.md, and won't break audit/link-check with
927
952
  stale frontmatter. `init` scaffolds the folder with a README explaining the
928
953
  convention. `archive` is a reserved name and cannot be registered as a domain.
929
- To un-deprecate a doc, move it back into a domain folder and run `hewtd maintain`.
954
+
955
+ ##### The archival process (2.7.0+)
956
+
957
+ The `archive/` folder shipped in 2.6.0 as a passive convention — you moved files
958
+ into it by hand. **2.7.0** turns it into an actual workflow: three commands, a
959
+ config block, and an audit nudge, all built around two principles. First,
960
+ **propose, don't impose** — detection is advisory, a human always executes the
961
+ move, and nothing is ever auto-archived. Second, **reversible and link-safe** —
962
+ archiving records where a doc came from so restore is lossless, and a link guard
963
+ keeps you from silently breaking the active corpus.
964
+
965
+ There's a deliberate stance baked into how candidates are detected, too. hewtd
966
+ **does not** use access-recency (it has no read telemetry) and **does not** treat
967
+ age alone as an archive signal. Docs aren't code: an unchanged foundational doc is
968
+ often the most important one in the tree, not the most disposable. The only
969
+ objective recency signal available is git-last-touched, and even that is advisory
970
+ and gated behind "this doc is also orphaned."
971
+
972
+ **`hewtd archive <file>`** retires a doc. It moves the file into
973
+ `archive/<same-domain-subpath>/` (so `api/old.md` lands at `archive/api/old.md`),
974
+ stamps lifecycle frontmatter (`status: archived`, `archived_on`, `archived_from`,
975
+ and `archived_reason` when you pass a reason), and regenerates the indexes so the
976
+ doc cleanly leaves its domain INDEX. It prefers `git mv` to preserve history and
977
+ falls back to a plain move when you're not in a git repo.
978
+
979
+ ```bash
980
+ # Preview first — moves nothing
981
+ hewtd archive api/old-endpoints.md --dry-run
982
+
983
+ # Retire it, recording why
984
+ hewtd archive api/old-endpoints.md -r "Replaced by the v2 endpoint reference"
985
+ ```
986
+
987
+ The **link guard** is on by default: if active docs still link to the target,
988
+ `archive` refuses and lists each offending link so you can fix them first. Pass
989
+ `--force` to archive anyway (those inbound links become dangling):
990
+
991
+ ```bash
992
+ hewtd archive api/old-endpoints.md --force
993
+ ```
994
+
995
+ **`hewtd unarchive <file>`** is the lossless reverse. It restores the doc to the
996
+ path recorded in `archived_from`, sets `status: active`, and strips the
997
+ `archived_*` fields. It refuses if the restore target already exists, so it never
998
+ clobbers a doc you've since recreated.
999
+
1000
+ ```bash
1001
+ hewtd unarchive archive/api/old-endpoints.md --dry-run
1002
+ hewtd unarchive archive/api/old-endpoints.md
1003
+ ```
1004
+
1005
+ **`hewtd archive-candidates`** is advisory and **read-only** — it never moves
1006
+ anything. It lists docs that may warrant archiving, each with a score and the
1007
+ reasons behind it:
1008
+
1009
+ ```bash
1010
+ hewtd archive-candidates
1011
+ hewtd archive-candidates --json
1012
+ ```
1013
+
1014
+ The candidate signals, ranked:
1015
+
1016
+ 1. **`status: deprecated`** — a strong, explicit signal. Qualifies a doc on its
1017
+ own.
1018
+ 2. **`superseded_by:` frontmatter** — also strong and explicit. Qualifies alone.
1019
+ 3. **Orphaned** (zero inbound links) — a weaker signal on its own.
1020
+ 4. **Stale** — git-last-touched (or `last_updated` as a fallback when git is
1021
+ unavailable) older than `candidate_after_days`. Age **only** contributes when
1022
+ the doc is *also* orphaned; it never qualifies a doc by itself.
1023
+
1024
+ ##### `archive` config block
1025
+
1026
+ Tune detection in `.claude/hit-em-with-the-docs.json` under an `archive` key. All
1027
+ four keys are optional; the defaults are conservative on purpose:
1028
+
1029
+ ```json
1030
+ {
1031
+ "archive": {
1032
+ "honor_status_deprecated": true,
1033
+ "candidate_after_days": 365,
1034
+ "require_orphaned": true,
1035
+ "auto": false
1036
+ }
1037
+ }
1038
+ ```
1039
+
1040
+ - `honor_status_deprecated` (default `true`) — treat `status: deprecated` as a
1041
+ qualifying candidate signal.
1042
+ - `candidate_after_days` (default `365`) — the staleness threshold in days.
1043
+ - `require_orphaned` (default `true`) — gate the age signal behind "also
1044
+ orphaned." Set it `false` to let age qualify a doc on its own (not
1045
+ recommended).
1046
+ - `auto` (default `false`) — nothing is ever auto-archived. This is the
1047
+ propose-don't-impose default; archiving is always a human decision.
1048
+
1049
+ ##### Audit nudge: `deprecated-not-archived`
1050
+
1051
+ `status: deprecated` and archiving are different steps. Marking a doc
1052
+ `deprecated` flags intent while keeping it live, indexed, and linkable; archiving
1053
+ physically retires it. To keep `deprecated` from being a dead-end label, the
1054
+ auditor now raises an **INFO** issue (`deprecated-not-archived`) for any doc left
1055
+ at `status: deprecated` in an active domain folder, suggesting
1056
+ `hewtd archive <file>`. That's what finally makes `status: deprecated`
1057
+ actionable.
930
1058
 
931
1059
  ### Domain System
932
1060
 
@@ -0,0 +1,43 @@
1
+ ---
2
+ description: Deprecate/retire a doc — move it into archive/ (reversible, link-safe), or list archival candidates
3
+ allowed-tools: Bash(npx:*), Read
4
+ argument-hint: "candidates | archive <file> [--reason ...] | unarchive <file>"
5
+ ---
6
+
7
+ Arguments: $ARGUMENTS
8
+
9
+ This command wraps `npx --no @theglitchking/hit-em-with-the-docs <archive|unarchive|archive-candidates>`. It retires deprecated docs into `.documentation/archive/` (which hewtd excludes from all scans) — properly: history-preserving move, metadata stamp, reindex, and a link-safety guard. Dispatch on the first word of `$ARGUMENTS`:
10
+
11
+ ## `candidates` (or empty arguments)
12
+
13
+ - Run `npx --no @theglitchking/hit-em-with-the-docs archive-candidates` and report the suggestions with their reasons/scores. This is **advisory and read-only** — nothing moves. Offer to archive any the user confirms.
14
+
15
+ ## `archive <file>`
16
+
17
+ Moves the doc into `archive/<same-domain-path>/`, stamps `status: archived` + `archived_on` + `archived_from` (+ `archived_reason` if given), and reindexes.
18
+
19
+ - **Preview first** (always): run with `--dry-run`:
20
+ ```bash
21
+ npx --no @theglitchking/hit-em-with-the-docs archive <file> [--reason "..."] --dry-run
22
+ ```
23
+ - The dry-run reports any **active docs that link to this doc**. If there are inbound links:
24
+ - Surface them to the user (file:line). Archiving will leave them dangling.
25
+ - Recommend fixing those links first. Only proceed with `--force` on **explicit** user confirmation.
26
+ - If the user did not give a reason, ask for one (it's recorded in `archived_reason`).
27
+ - On confirmation, re-run without `--dry-run` (add `--force` only if the user accepted the dangling-link tradeoff). Suggest `hewtd maintain` afterward.
28
+
29
+ ## `unarchive <file>`
30
+
31
+ Restores an archived doc back to its original path (`archived_from`), `status: active`.
32
+
33
+ - Run with `--dry-run` to show where it will land, then re-run for real on confirmation:
34
+ ```bash
35
+ npx --no @theglitchking/hit-em-with-the-docs unarchive <file> --dry-run
36
+ ```
37
+ - If it reports the restore target already exists, relay that and don't force it.
38
+
39
+ ## Notes
40
+
41
+ - Criteria for archiving (what `candidates` ranks on): `status: deprecated` (strongest) → `superseded_by:` → orphaned (no inbound links) → age (only when also orphaned). **Age alone never qualifies a doc** — an unchanged doc is often the most important one.
42
+ - Don't hand-move files into `archive/`; the command does the metadata + reindex + link check that a bare `mv` skips.
43
+ - If the first word isn't `candidates`, `archive`, or `unarchive`, tell the user those are the valid subcommands.
package/commands/help.md CHANGED
@@ -19,6 +19,8 @@ If `$ARGUMENTS` matches one of the topics below, focus the orientation on that t
19
19
  - `audit` — explain `hewtd audit` + `--strict`; explain when to use each
20
20
  - `integrate` — explain `hewtd integrate <file>` and when to use it
21
21
  - `templates` — list available templates with paths
22
+ - `domains` — explain the 15 built-in domains + custom domains (`hewtd domain add/remove/list`, 2.6.0+)
23
+ - `archive` / `deprecation` — explain the archival workflow (`hewtd archive/unarchive/archive-candidates`, 2.7.0+)
22
24
 
23
25
  ## What hewtd does (the one-paragraph brief)
24
26
 
@@ -31,6 +33,7 @@ If `$ARGUMENTS` matches one of the topics below, focus the orientation on that t
31
33
  3. **Creating a fact in the knowledge base (2.3.0+)** — copy `templates/knowledge-base/fact.template.md` into `<vault-root>/facts/<kebab-id>.md`, fill in required fields (`id`, `confidence`, `last_verified`, `provenance`).
32
34
  4. **Documenting an incident (2.3.0+)** — create `<vault-root>/incidents/YYYY-MM-DD-slug/` with both `narrative.md` and `facts.md` from the templates.
33
35
  5. **Enriching a playbook (2.3.0+)** — add a `symptoms:` block to a playbook's frontmatter; cite the facts the playbook depends on.
36
+ 6. **Deprecating / retiring a doc (2.7.0+)** — `hewtd archive <file>` moves a stale doc into `.documentation/archive/` (excluded from all scans), reversibly and link-safely. Run `hewtd archive-candidates` to see what's worth retiring; `hewtd unarchive <file>` to bring one back.
34
37
 
35
38
  ## Commands available
36
39
 
@@ -44,10 +47,16 @@ CLI (via `npx --no @theglitchking/hit-em-with-the-docs <cmd>` or `hewtd <cmd>` i
44
47
  - `integrate <file>` — auto-classify and place a raw markdown file
45
48
  - `discover patterns|anti-patterns|standards|dependencies` — extract conventions from source code
46
49
  - `report health|audit|links` — generate detailed reports
47
- - `list` — list all 15 domains
50
+ - `list` — list the built-in domains
51
+ - `domain list|add|remove` — manage custom domains (2.6.0+); `add <id> -k <keywords>` registers + scaffolds a project-specific domain
52
+ - `archive <file>` — deprecate a doc into `archive/` (reversible, link-safe, reindexes) (2.7.0+)
53
+ - `unarchive <file>` — restore an archived doc to its domain folder (2.7.0+)
54
+ - `archive-candidates` — advisory list of docs worth retiring (2.7.0+)
48
55
  - `search <query>` — search documentation
49
56
 
50
57
  Slash commands (Claude Code):
58
+ - `/hit-em-with-the-docs:domain` — add/remove/list custom domains (2.6.0+)
59
+ - `/hit-em-with-the-docs:archive` — deprecate/restore docs, or list candidates (2.7.0+)
51
60
  - `/hit-em-with-the-docs:status` — installed version, update policy, hook state
52
61
  - `/hit-em-with-the-docs:policy [auto|nudge|off]` — get/set update policy
53
62
  - `/hit-em-with-the-docs:update` — pull the latest version
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Archival candidate DETECTION — advisory and read-only.
3
+ *
4
+ * Surfaces docs that *might* warrant archiving, scored on ranked signals.
5
+ * It never moves anything (the executor does that). Philosophy: a strong
6
+ * explicit signal (`status: deprecated`, `superseded_by`) qualifies on its
7
+ * own; age qualifies only in combination with orphaned (`require_orphaned`),
8
+ * because age alone conflates "unchanged" with "obsolete".
9
+ */
10
+ import type { ArchiveConfig } from '../../utils/config.js';
11
+ export interface ArchiveCandidate {
12
+ file: string;
13
+ score: number;
14
+ reasons: string[];
15
+ signals: {
16
+ deprecated: boolean;
17
+ superseded: boolean;
18
+ orphaned: boolean;
19
+ stale: boolean;
20
+ staleSignalDegraded: boolean;
21
+ };
22
+ }
23
+ /**
24
+ * Days since the file was last modified, via git (`%cs` = committer date).
25
+ * Returns null when not in a git repo or the file is untracked (no history).
26
+ */
27
+ export declare function gitLastTouchedDays(projectRoot: string, fileAbs: string, today: Date): number | null;
28
+ export interface FindCandidatesInput {
29
+ docsPath: string;
30
+ projectRoot: string;
31
+ config: ArchiveConfig;
32
+ /** Override "today" for deterministic tests. */
33
+ today?: Date;
34
+ }
35
+ export declare function findArchiveCandidates(input: FindCandidatesInput): Promise<ArchiveCandidate[]>;
36
+ /** Convenience: resolve absolute docs path for a candidate (test/CLI helper). */
37
+ export declare function candidateAbsPath(docsPath: string, candidate: ArchiveCandidate): string;
38
+ //# sourceMappingURL=candidates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"candidates.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/archive/candidates.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE;QACP,UAAU,EAAE,OAAO,CAAC;QACpB,UAAU,EAAE,OAAO,CAAC;QACpB,QAAQ,EAAE,OAAO,CAAC;QAClB,KAAK,EAAE,OAAO,CAAC;QACf,mBAAmB,EAAE,OAAO,CAAC;KAC9B,CAAC;CACH;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,IAAI,GACV,MAAM,GAAG,IAAI,CAgBf;AAUD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,gDAAgD;IAChD,KAAK,CAAC,EAAE,IAAI,CAAC;CACd;AAED,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA4E7B;AAED,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,GAAG,MAAM,CAEtF"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Inbound-link detection for the archival process.
3
+ *
4
+ * Archiving a doc that active docs still link to would turn live references
5
+ * into dead ones — exactly the failure archival must prevent. This reuses the
6
+ * existing link graph (which already excludes `archive/`, since it scans via
7
+ * `findMarkdownFiles`) to find every active doc that links to a target.
8
+ */
9
+ export interface InboundLink {
10
+ /** docs-relative path of the doc that links to the target. */
11
+ source: string;
12
+ lineNumber: number;
13
+ linkText: string;
14
+ }
15
+ /**
16
+ * Find all active (non-archived) docs that link to `targetRelPath`
17
+ * (a path relative to `docsPath`). Returns one entry per inbound link.
18
+ */
19
+ export declare function findInboundLinks(docsPath: string, targetRelPath: string): Promise<InboundLink[]>;
20
+ /** Normalize an absolute-or-relative file arg to a docs-relative POSIX path. */
21
+ export declare function toDocsRelative(docsPath: string, file: string): string;
22
+ //# sourceMappingURL=links.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"links.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/archive/links.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,MAAM,WAAW,WAAW;IAC1B,8DAA8D;IAC9D,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,WAAW,EAAE,CAAC,CAUxB;AAED,gFAAgF;AAChF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAKrE"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Archival executor: the deterministic WRITER behind `hewtd archive` /
3
+ * `hewtd unarchive`.
4
+ *
5
+ * Moves a doc into `archive/<domain-subpath>/…` (and back), preserving git
6
+ * history via `git mv` where possible, stamping reversible lifecycle metadata,
7
+ * and regenerating indexes so the doc cleanly leaves (or rejoins) the active
8
+ * corpus. Non-destructive and reversible by design: `archived_from` records the
9
+ * exact restore path.
10
+ */
11
+ import { type InboundLink } from './links.js';
12
+ export interface ArchiveDocInput {
13
+ projectRoot: string;
14
+ docsPath: string;
15
+ /** Doc to archive — docs-relative (e.g. `api/old.md`) or absolute. */
16
+ file: string;
17
+ reason?: string;
18
+ force?: boolean;
19
+ dryRun?: boolean;
20
+ /** Override "today" (YYYY-MM-DD) for deterministic tests. */
21
+ today?: string;
22
+ }
23
+ export interface ArchiveDocResult {
24
+ ok: boolean;
25
+ errors: string[];
26
+ action: 'archived' | 'dry_run' | 'blocked' | 'rejected';
27
+ from?: string;
28
+ to?: string;
29
+ moveMethod?: 'git' | 'fs';
30
+ /** Active docs that link to the target (the link guard). */
31
+ inboundLinks: InboundLink[];
32
+ }
33
+ export declare function archiveDoc(input: ArchiveDocInput): Promise<ArchiveDocResult>;
34
+ export interface UnarchiveDocInput {
35
+ projectRoot: string;
36
+ docsPath: string;
37
+ /** Archived doc — docs-relative (e.g. `archive/api/old.md`) or absolute. */
38
+ file: string;
39
+ dryRun?: boolean;
40
+ }
41
+ export interface UnarchiveDocResult {
42
+ ok: boolean;
43
+ errors: string[];
44
+ action: 'unarchived' | 'dry_run' | 'rejected';
45
+ from?: string;
46
+ to?: string;
47
+ moveMethod?: 'git' | 'fs';
48
+ }
49
+ export declare function unarchiveDoc(input: UnarchiveDocInput): Promise<UnarchiveDocResult>;
50
+ //# sourceMappingURL=manage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manage.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/archive/manage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH,OAAO,EAAoC,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAsDhF,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAC1B,4DAA4D;IAC5D,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B;AAED,wBAAsB,UAAU,CAC9B,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,gBAAgB,CAAC,CAgE3B;AAMD,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,YAAY,GAAG,SAAS,GAAG,UAAU,CAAC;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CAC3B;AAED,wBAAsB,YAAY,CAChC,KAAK,EAAE,iBAAiB,GACvB,OAAO,CAAC,kBAAkB,CAAC,CAsD7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"auditor.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/audit/auditor.ts"],"names":[],"mappings":"AAYA,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAM5E,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAqJpF;AA0ND;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,gBAAgB,CAAC,CAQ3B"}
1
+ {"version":3,"file":"auditor.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/audit/auditor.ts"],"names":[],"mappings":"AAYA,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAM5E,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,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ffects<z.ZodEffects<z.Zo
87
87
  target?: string | undefined;
88
88
  cites?: string[] | undefined;
89
89
  }>, "many">>;
90
+ } & {
91
+ superseded_by: z.ZodOptional<z.ZodString>;
92
+ archived_on: z.ZodOptional<z.ZodEffects<z.ZodString, string, unknown>>;
93
+ archived_from: z.ZodOptional<z.ZodString>;
94
+ archived_reason: z.ZodOptional<z.ZodString>;
90
95
  }, "strip", z.ZodTypeAny, {
91
96
  domains: string[];
92
97
  title: string;
@@ -133,6 +138,10 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
133
138
  target?: string | undefined;
134
139
  cites?: string[] | undefined;
135
140
  }[] | undefined;
141
+ superseded_by?: string | undefined;
142
+ archived_on?: string | undefined;
143
+ archived_from?: string | undefined;
144
+ archived_reason?: string | undefined;
136
145
  }, {
137
146
  domains: string[];
138
147
  title: string;
@@ -179,6 +188,10 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
179
188
  target?: string | undefined;
180
189
  cites?: string[] | undefined;
181
190
  }[] | undefined;
191
+ superseded_by?: string | undefined;
192
+ archived_on?: unknown;
193
+ archived_from?: string | undefined;
194
+ archived_reason?: string | undefined;
182
195
  }>, {
183
196
  domains: string[];
184
197
  title: string;
@@ -225,6 +238,10 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
225
238
  target?: string | undefined;
226
239
  cites?: string[] | undefined;
227
240
  }[] | undefined;
241
+ superseded_by?: string | undefined;
242
+ archived_on?: string | undefined;
243
+ archived_from?: string | undefined;
244
+ archived_reason?: string | undefined;
228
245
  }, {
229
246
  domains: string[];
230
247
  title: string;
@@ -271,6 +288,10 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
271
288
  target?: string | undefined;
272
289
  cites?: string[] | undefined;
273
290
  }[] | undefined;
291
+ superseded_by?: string | undefined;
292
+ archived_on?: unknown;
293
+ archived_from?: string | undefined;
294
+ archived_reason?: string | undefined;
274
295
  }>, {
275
296
  domains: string[];
276
297
  title: string;
@@ -317,6 +338,10 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
317
338
  target?: string | undefined;
318
339
  cites?: string[] | undefined;
319
340
  }[] | undefined;
341
+ superseded_by?: string | undefined;
342
+ archived_on?: string | undefined;
343
+ archived_from?: string | undefined;
344
+ archived_reason?: string | undefined;
320
345
  }, {
321
346
  domains: string[];
322
347
  title: string;
@@ -363,6 +388,10 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
363
388
  target?: string | undefined;
364
389
  cites?: string[] | undefined;
365
390
  }[] | undefined;
391
+ superseded_by?: string | undefined;
392
+ archived_on?: unknown;
393
+ archived_from?: string | undefined;
394
+ archived_reason?: string | undefined;
366
395
  }>, {
367
396
  domains: string[];
368
397
  title: string;
@@ -409,6 +438,10 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
409
438
  target?: string | undefined;
410
439
  cites?: string[] | undefined;
411
440
  }[] | undefined;
441
+ superseded_by?: string | undefined;
442
+ archived_on?: string | undefined;
443
+ archived_from?: string | undefined;
444
+ archived_reason?: string | undefined;
412
445
  }, {
413
446
  domains: string[];
414
447
  title: string;
@@ -455,6 +488,10 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
455
488
  target?: string | undefined;
456
489
  cites?: string[] | undefined;
457
490
  }[] | undefined;
491
+ superseded_by?: string | undefined;
492
+ archived_on?: unknown;
493
+ archived_from?: string | undefined;
494
+ archived_reason?: string | undefined;
458
495
  }>, {
459
496
  domains: string[];
460
497
  title: string;
@@ -501,6 +538,10 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
501
538
  target?: string | undefined;
502
539
  cites?: string[] | undefined;
503
540
  }[] | undefined;
541
+ superseded_by?: string | undefined;
542
+ archived_on?: string | undefined;
543
+ archived_from?: string | undefined;
544
+ archived_reason?: string | undefined;
504
545
  }, {
505
546
  domains: string[];
506
547
  title: string;
@@ -547,6 +588,10 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
547
588
  target?: string | undefined;
548
589
  cites?: string[] | undefined;
549
590
  }[] | undefined;
591
+ superseded_by?: string | undefined;
592
+ archived_on?: unknown;
593
+ archived_from?: string | undefined;
594
+ archived_reason?: string | undefined;
550
595
  }>, {
551
596
  domains: string[];
552
597
  title: string;
@@ -593,6 +638,10 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
593
638
  target?: string | undefined;
594
639
  cites?: string[] | undefined;
595
640
  }[] | undefined;
641
+ superseded_by?: string | undefined;
642
+ archived_on?: string | undefined;
643
+ archived_from?: string | undefined;
644
+ archived_reason?: string | undefined;
596
645
  }, {
597
646
  domains: string[];
598
647
  title: string;
@@ -639,6 +688,10 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
639
688
  target?: string | undefined;
640
689
  cites?: string[] | undefined;
641
690
  }[] | undefined;
691
+ superseded_by?: string | undefined;
692
+ archived_on?: unknown;
693
+ archived_from?: string | undefined;
694
+ archived_reason?: string | undefined;
642
695
  }>, {
643
696
  domains: string[];
644
697
  title: string;
@@ -685,6 +738,10 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
685
738
  target?: string | undefined;
686
739
  cites?: string[] | undefined;
687
740
  }[] | undefined;
741
+ superseded_by?: string | undefined;
742
+ archived_on?: string | undefined;
743
+ archived_from?: string | undefined;
744
+ archived_reason?: string | undefined;
688
745
  }, {
689
746
  domains: string[];
690
747
  title: string;
@@ -731,6 +788,10 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
731
788
  target?: string | undefined;
732
789
  cites?: string[] | undefined;
733
790
  }[] | undefined;
791
+ superseded_by?: string | undefined;
792
+ archived_on?: unknown;
793
+ archived_from?: string | undefined;
794
+ archived_reason?: string | undefined;
734
795
  }>;
735
796
  export type DocumentMetadata = z.infer<typeof MetadataSchema>;
736
797
  /**
@@ -798,6 +859,10 @@ export declare const PartialMetadataSchema: z.ZodObject<{
798
859
  target?: string | undefined;
799
860
  cites?: string[] | undefined;
800
861
  }>, "many">>>;
862
+ superseded_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
863
+ archived_on: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodString, string, unknown>>>;
864
+ archived_from: z.ZodOptional<z.ZodOptional<z.ZodString>>;
865
+ archived_reason: z.ZodOptional<z.ZodOptional<z.ZodString>>;
801
866
  }, "strip", z.ZodTypeAny, {
802
867
  domains?: string[] | undefined;
803
868
  title?: string | undefined;
@@ -844,6 +909,10 @@ export declare const PartialMetadataSchema: z.ZodObject<{
844
909
  target?: string | undefined;
845
910
  cites?: string[] | undefined;
846
911
  }[] | undefined;
912
+ superseded_by?: string | undefined;
913
+ archived_on?: string | undefined;
914
+ archived_from?: string | undefined;
915
+ archived_reason?: string | undefined;
847
916
  }, {
848
917
  domains?: string[] | undefined;
849
918
  title?: string | undefined;
@@ -890,6 +959,10 @@ export declare const PartialMetadataSchema: z.ZodObject<{
890
959
  target?: string | undefined;
891
960
  cites?: string[] | undefined;
892
961
  }[] | undefined;
962
+ superseded_by?: string | undefined;
963
+ archived_on?: unknown;
964
+ archived_from?: string | undefined;
965
+ archived_reason?: string | undefined;
893
966
  }>;
894
967
  export type PartialDocumentMetadata = z.infer<typeof PartialMetadataSchema>;
895
968
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/metadata/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,uBAAuB,EACvB,sBAAsB,EACtB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CAAC,GAC5B,iBAAiB,EAAE,CAyLrB;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,OAAO,GAAG;IACtD,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,CAAC,EAAE,uBAAuB,CAAC;CAChC,CAYA;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,MAAM,EAAE,CAwBV;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAU5C;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,MAAM,CAMR;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,aAAa,GACnB,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,gBAAgB,GAAG,MAAM,CAiB3E;AAGD,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,aAAa,EACb,cAAc,EACd,wBAAwB,GACzB,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/metadata/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,uBAAuB,EACvB,sBAAsB,EACtB,KAAK,IAAI,EACV,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAiC,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAmC9E,QAAA,MAAM,iBAAiB,wDAAyD,CAAC;AAwDjF,Q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CAAC,IAAI,EAAE,OAAO,GAAG;IACtD,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,CAAC,EAAE,uBAAuB,CAAC;CAChC,CAYA;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,MAAM,EAAE,CAwBV;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAU5C;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,MAAM,CAMR;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,aAAa,GACnB,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,gBAAgB,GAAG,MAAM,CAiB3E;AAGD,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,aAAa,EACb,cAAc,EACd,wBAAwB,GACzB,CAAC"}
@@ -9,6 +9,12 @@ export interface RegenerateOptions {
9
9
  */
10
10
  domains?: Domain[];
11
11
  silent?: boolean;
12
+ /**
13
+ * Compute everything, write nothing. `filesWritten` then lists the files
14
+ * that WOULD be written. Exists so users can preview the (large, one-time)
15
+ * diff the 2.7.1 recursive walk produces before committing to it.
16
+ */
17
+ dryRun?: boolean;
12
18
  }
13
19
  export interface RegenerateResult {
14
20
  /** Per-domain document counts — all domains, regardless of the filter. */
@@ -19,9 +25,14 @@ export interface RegenerateResult {
19
25
  totalDocuments: number;
20
26
  }
21
27
  /**
22
- * List the document files in a domain directory, excluding the generated
23
- * INDEX.md / REGISTRY.md. Returns sorted file names (not paths). Empty when
24
- * the domain directory does not exist.
28
+ * List the document files in a domain directory, walking subfolders. Returns
29
+ * sorted, domain-relative POSIX paths (`backend/entity-schema-contract.md`).
30
+ * Empty when the domain directory does not exist.
31
+ *
32
+ * This is the shared spine for three consumers — the index generator, the
33
+ * `index-drift` audit rule, and the `domain remove` orphan count — so what it
34
+ * excludes, the whole system excludes: the generated INDEX/REGISTRY at any
35
+ * depth, `EXCLUDED_DIRS`, and the vault's generator-owned subtrees (issue #12).
25
36
  */
26
37
  export declare function listDomainDocFiles(docsPath: string, domain: string): Promise<string[]>;
27
38
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"regenerate.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/generators/regenerate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAmB3D,MAAM,WAAW,iBAAiB;IAChC,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,8DAA8D;IAC9D,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,EAAE,CAAC,CASnB;AAkED;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,gBAAgB,CAAC,CAkE3B"}
1
+ {"version":3,"file":"regenerate.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/generators/regenerate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAiE3D,MAAM,WAAW,iBAAiB;IAChC,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,8DAA8D;IAC9D,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,EAAE,CAAC,CAmBnB;AAwFD;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,gBAAgB,CAAC,CAuE3B"}