@lsctech/polaris 0.1.0 → 0.1.3

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 (211) hide show
  1. package/dist/cli/adopt-assets.js +187 -0
  2. package/dist/cli/adopt-cognition.js +1 -2
  3. package/dist/cli/adopt-genesis.js +84 -0
  4. package/dist/cli/adopt-instructions.js +1 -2
  5. package/dist/cli/adopt-report.js +67 -0
  6. package/dist/cli/adopt-workspace.js +114 -0
  7. package/dist/cli/adoption-plan.js +11 -0
  8. package/dist/cli/init.js +79 -7
  9. package/dist/workspace/.polaris/roles/analyst.md +38 -0
  10. package/dist/workspace/.polaris/roles/closeout-librarian.md +122 -0
  11. package/dist/workspace/.polaris/roles/cognition-librarian.md +37 -0
  12. package/dist/workspace/.polaris/roles/finalizer.md +45 -0
  13. package/dist/workspace/.polaris/roles/foreman.md +165 -0
  14. package/dist/workspace/.polaris/roles/librarian.md +74 -0
  15. package/dist/workspace/.polaris/roles/worker.md +119 -0
  16. package/dist/workspace/.polaris/session-type +1 -0
  17. package/dist/workspace/.polaris/skills/ROUTING.md +109 -0
  18. package/dist/workspace/.polaris/skills/caveman/SKILL.md +74 -0
  19. package/dist/workspace/.polaris/skills/caveman-compress/scripts/compress.py +272 -0
  20. package/dist/workspace/.polaris/skills/closeout-librarian/POLARIS.md +46 -0
  21. package/dist/workspace/.polaris/skills/closeout-librarian/SKILL.md +59 -0
  22. package/dist/workspace/.polaris/skills/closeout-librarian/chain.md +116 -0
  23. package/dist/workspace/.polaris/skills/closeout-librarian/steps/01-load-cluster-context.md +78 -0
  24. package/dist/workspace/.polaris/skills/closeout-librarian/steps/02-drift-reconciliation.md +157 -0
  25. package/dist/workspace/.polaris/skills/closeout-librarian/steps/03-reconcile-polaris-md.md +93 -0
  26. package/dist/workspace/.polaris/skills/closeout-librarian/steps/04-reconcile-summary-md.md +106 -0
  27. package/dist/workspace/.polaris/skills/closeout-librarian/steps/05-doc-ingestion.md +114 -0
  28. package/dist/workspace/.polaris/skills/closeout-librarian/steps/06-link-validation.md +128 -0
  29. package/dist/workspace/.polaris/skills/closeout-librarian/steps/07-yaml-linking.md +95 -0
  30. package/dist/workspace/.polaris/skills/closeout-librarian/steps/08-librarian-commit.md +119 -0
  31. package/dist/workspace/.polaris/skills/closeout-librarian/steps/09-sealed-result.md +118 -0
  32. package/dist/workspace/.polaris/skills/docs-ingest/SKILL.md +68 -0
  33. package/dist/workspace/.polaris/skills/docs-ingest/chain.json +23 -0
  34. package/dist/workspace/.polaris/skills/docs-ingest/chain.md +149 -0
  35. package/dist/workspace/.polaris/skills/docs-ingest/steps/01-orient-ingest.md +85 -0
  36. package/dist/workspace/.polaris/skills/docs-ingest/steps/02-classify-batch.md +87 -0
  37. package/dist/workspace/.polaris/skills/docs-ingest/steps/03-conflict-check.md +66 -0
  38. package/dist/workspace/.polaris/skills/docs-ingest/steps/04-place-and-link.md +77 -0
  39. package/dist/workspace/.polaris/skills/docs-ingest/steps/05-finalize-ingest.md +49 -0
  40. package/dist/workspace/.polaris/skills/docs-promote/SKILL.md +79 -0
  41. package/dist/workspace/.polaris/skills/docs-promote/chain.json +25 -0
  42. package/dist/workspace/.polaris/skills/docs-promote/chain.md +80 -0
  43. package/dist/workspace/.polaris/skills/docs-promote/steps/01-orient-promote.md +53 -0
  44. package/dist/workspace/.polaris/skills/docs-promote/steps/02-review-candidates.md +51 -0
  45. package/dist/workspace/.polaris/skills/docs-promote/steps/03-read-linked-code.md +50 -0
  46. package/dist/workspace/.polaris/skills/docs-promote/steps/04-conflict-surface.md +65 -0
  47. package/dist/workspace/.polaris/skills/docs-promote/steps/05-await-approval.md +61 -0
  48. package/dist/workspace/.polaris/skills/docs-promote/steps/06-execute-promote-deprecate.md +65 -0
  49. package/dist/workspace/.polaris/skills/docs-promote/steps/07-finalize-promote.md +44 -0
  50. package/dist/workspace/.polaris/skills/polaris-analyze/SKILL.md +94 -0
  51. package/dist/workspace/.polaris/skills/polaris-analyze/chain.json +20 -0
  52. package/dist/workspace/.polaris/skills/polaris-analyze/chain.md +105 -0
  53. package/dist/workspace/.polaris/skills/polaris-analyze/issue-reconciliation.md +149 -0
  54. package/dist/workspace/.polaris/skills/polaris-analyze/issue-template.md +133 -0
  55. package/dist/workspace/.polaris/skills/polaris-analyze/linked-skills/repo-analysis.md +55 -0
  56. package/dist/workspace/.polaris/skills/polaris-analyze/steps/01-fetch-and-orient.md +79 -0
  57. package/dist/workspace/.polaris/skills/polaris-analyze/steps/02-map-affected-code.md +58 -0
  58. package/dist/workspace/.polaris/skills/polaris-analyze/steps/03-assess-issue.md +58 -0
  59. package/dist/workspace/.polaris/skills/polaris-analyze/steps/04-blocker-check.md +60 -0
  60. package/dist/workspace/.polaris/skills/polaris-analyze/steps/05-create-cluster-plan.md +197 -0
  61. package/dist/workspace/.polaris/skills/polaris-analyze/steps/06-final-report.md +60 -0
  62. package/dist/workspace/.polaris/skills/polaris-catalog/SKILL.md +91 -0
  63. package/dist/workspace/.polaris/skills/polaris-catalog/chain.json +22 -0
  64. package/dist/workspace/.polaris/skills/polaris-catalog/chain.md +85 -0
  65. package/dist/workspace/.polaris/skills/polaris-catalog/steps/01-orient-catalog.md +92 -0
  66. package/dist/workspace/.polaris/skills/polaris-catalog/steps/02-reconcile-polaris-md.md +33 -0
  67. package/dist/workspace/.polaris/skills/polaris-catalog/steps/03-reconcile-summary-md.md +70 -0
  68. package/dist/workspace/.polaris/skills/polaris-catalog/steps/04-classify-and-place.md +117 -0
  69. package/dist/workspace/.polaris/skills/polaris-catalog/steps/05-catalog-commit.md +94 -0
  70. package/dist/workspace/.polaris/skills/polaris-medic/SKILL.md +52 -0
  71. package/dist/workspace/.polaris/skills/polaris-medic/chain.md +111 -0
  72. package/dist/workspace/.polaris/skills/polaris-medic/steps/01-orient-medic.md +75 -0
  73. package/dist/workspace/.polaris/skills/polaris-medic/steps/02-diagnose.md +79 -0
  74. package/dist/workspace/.polaris/skills/polaris-medic/steps/03-repair.md +64 -0
  75. package/dist/workspace/.polaris/skills/polaris-medic/steps/04-validate.md +66 -0
  76. package/dist/workspace/.polaris/skills/polaris-medic/steps/05-create-chart.md +85 -0
  77. package/dist/workspace/.polaris/skills/polaris-medic/steps/06-closeout.md +86 -0
  78. package/dist/workspace/.polaris/skills/polaris-reconcile/SKILL.md +75 -0
  79. package/dist/workspace/.polaris/skills/polaris-reconcile/chain.json +20 -0
  80. package/dist/workspace/.polaris/skills/polaris-reconcile/chain.md +67 -0
  81. package/dist/workspace/.polaris/skills/polaris-reconcile/steps/01-orient-reconcile.md +82 -0
  82. package/dist/workspace/.polaris/skills/polaris-reconcile/steps/02-reconcile-polaris-md.md +95 -0
  83. package/dist/workspace/.polaris/skills/polaris-reconcile/steps/03-reconcile-summary-md.md +108 -0
  84. package/dist/workspace/.polaris/skills/polaris-reconcile/steps/04-reconcile-commit.md +88 -0
  85. package/dist/workspace/.polaris/skills/polaris-run/SKILL.md +135 -0
  86. package/dist/workspace/.polaris/skills/polaris-run/chain.json +19 -0
  87. package/dist/workspace/.polaris/skills/polaris-run/chain.md +298 -0
  88. package/dist/workspace/.polaris/skills/polaris-run/execution-adapter.md +34 -0
  89. package/dist/workspace/.polaris/skills/polaris-run/linked-skills/repo-analysis.md +58 -0
  90. package/dist/workspace/.polaris/skills/polaris-run/steps/01-orient-cluster.md +96 -0
  91. package/dist/workspace/.polaris/skills/polaris-run/steps/02-prepare-branch.md +53 -0
  92. package/dist/workspace/.polaris/skills/polaris-run/steps/03-select-child.md +63 -0
  93. package/dist/workspace/.polaris/skills/polaris-run/steps/04-execute-child.md +75 -0
  94. package/dist/workspace/.polaris/skills/polaris-run/steps/05-validate-child.md +57 -0
  95. package/dist/workspace/.polaris/skills/polaris-run/steps/06-commit-and-update-linear.md +74 -0
  96. package/dist/workspace/.polaris/skills/polaris-run/steps/07-decide-continuation.md +89 -0
  97. package/dist/workspace/.polaris/skills/polaris-run/steps/08-closeout-librarian.md +146 -0
  98. package/dist/workspace/.polaris/skills/polaris-run/steps/08-final-delivery.md +91 -0
  99. package/dist/workspace/.polaris/skills/polaris-run/steps/09-final-delivery.md +104 -0
  100. package/dist/workspace/.polaris/skills/polaris-tools/README.md +63 -0
  101. package/dist/workspace/.polaris/skills/polaris-tools/SKILL.md +94 -0
  102. package/dist/workspace/.polaris/skills/polaris-tools/tools.js +191 -0
  103. package/dist/workspace/smartdocs/architecture/.gitkeep +0 -0
  104. package/dist/workspace/smartdocs/audits/.gitkeep +0 -0
  105. package/dist/workspace/smartdocs/decisions/.gitkeep +0 -0
  106. package/dist/workspace/smartdocs/doctrine/active/.gitkeep +0 -0
  107. package/dist/workspace/smartdocs/runtime/.gitkeep +0 -0
  108. package/dist/workspace/smartdocs/specs/active/.gitkeep +0 -0
  109. package/dist/workspace/smartdocs/specs/archive/.gitkeep +0 -0
  110. package/dist/workspace/workspace/.polaris/roles/analyst.md +38 -0
  111. package/dist/workspace/workspace/.polaris/roles/closeout-librarian.md +122 -0
  112. package/dist/workspace/workspace/.polaris/roles/cognition-librarian.md +37 -0
  113. package/dist/workspace/workspace/.polaris/roles/finalizer.md +45 -0
  114. package/dist/workspace/workspace/.polaris/roles/foreman.md +165 -0
  115. package/dist/workspace/workspace/.polaris/roles/librarian.md +74 -0
  116. package/dist/workspace/workspace/.polaris/roles/worker.md +119 -0
  117. package/dist/workspace/workspace/.polaris/session-type +1 -0
  118. package/dist/workspace/workspace/.polaris/skills/ROUTING.md +109 -0
  119. package/dist/workspace/workspace/.polaris/skills/caveman/SKILL.md +74 -0
  120. package/dist/workspace/workspace/.polaris/skills/caveman-compress/scripts/compress.py +272 -0
  121. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/POLARIS.md +46 -0
  122. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/SKILL.md +59 -0
  123. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/chain.md +116 -0
  124. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/01-load-cluster-context.md +78 -0
  125. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/02-drift-reconciliation.md +157 -0
  126. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/03-reconcile-polaris-md.md +93 -0
  127. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/04-reconcile-summary-md.md +106 -0
  128. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/05-doc-ingestion.md +114 -0
  129. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/06-link-validation.md +128 -0
  130. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/07-yaml-linking.md +95 -0
  131. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/08-librarian-commit.md +119 -0
  132. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/09-sealed-result.md +118 -0
  133. package/dist/workspace/workspace/.polaris/skills/docs-ingest/SKILL.md +68 -0
  134. package/dist/workspace/workspace/.polaris/skills/docs-ingest/chain.json +23 -0
  135. package/dist/workspace/workspace/.polaris/skills/docs-ingest/chain.md +149 -0
  136. package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/01-orient-ingest.md +85 -0
  137. package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/02-classify-batch.md +87 -0
  138. package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/03-conflict-check.md +66 -0
  139. package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/04-place-and-link.md +77 -0
  140. package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/05-finalize-ingest.md +49 -0
  141. package/dist/workspace/workspace/.polaris/skills/docs-promote/SKILL.md +79 -0
  142. package/dist/workspace/workspace/.polaris/skills/docs-promote/chain.json +25 -0
  143. package/dist/workspace/workspace/.polaris/skills/docs-promote/chain.md +80 -0
  144. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/01-orient-promote.md +53 -0
  145. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/02-review-candidates.md +51 -0
  146. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/03-read-linked-code.md +50 -0
  147. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/04-conflict-surface.md +65 -0
  148. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/05-await-approval.md +61 -0
  149. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/06-execute-promote-deprecate.md +65 -0
  150. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/07-finalize-promote.md +44 -0
  151. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/SKILL.md +94 -0
  152. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/chain.json +20 -0
  153. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/chain.md +105 -0
  154. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/issue-reconciliation.md +149 -0
  155. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/issue-template.md +133 -0
  156. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/linked-skills/repo-analysis.md +55 -0
  157. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/01-fetch-and-orient.md +79 -0
  158. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/02-map-affected-code.md +58 -0
  159. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/03-assess-issue.md +58 -0
  160. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/04-blocker-check.md +60 -0
  161. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/05-create-cluster-plan.md +197 -0
  162. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/06-final-report.md +60 -0
  163. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/SKILL.md +91 -0
  164. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/chain.json +22 -0
  165. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/chain.md +85 -0
  166. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/01-orient-catalog.md +92 -0
  167. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/02-reconcile-polaris-md.md +33 -0
  168. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/03-reconcile-summary-md.md +70 -0
  169. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/04-classify-and-place.md +117 -0
  170. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/05-catalog-commit.md +94 -0
  171. package/dist/workspace/workspace/.polaris/skills/polaris-medic/SKILL.md +52 -0
  172. package/dist/workspace/workspace/.polaris/skills/polaris-medic/chain.md +111 -0
  173. package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/01-orient-medic.md +75 -0
  174. package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/02-diagnose.md +79 -0
  175. package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/03-repair.md +64 -0
  176. package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/04-validate.md +66 -0
  177. package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/05-create-chart.md +85 -0
  178. package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/06-closeout.md +86 -0
  179. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/SKILL.md +75 -0
  180. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/chain.json +20 -0
  181. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/chain.md +67 -0
  182. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/01-orient-reconcile.md +82 -0
  183. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/02-reconcile-polaris-md.md +95 -0
  184. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/03-reconcile-summary-md.md +108 -0
  185. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/04-reconcile-commit.md +88 -0
  186. package/dist/workspace/workspace/.polaris/skills/polaris-run/SKILL.md +135 -0
  187. package/dist/workspace/workspace/.polaris/skills/polaris-run/chain.json +19 -0
  188. package/dist/workspace/workspace/.polaris/skills/polaris-run/chain.md +298 -0
  189. package/dist/workspace/workspace/.polaris/skills/polaris-run/execution-adapter.md +34 -0
  190. package/dist/workspace/workspace/.polaris/skills/polaris-run/linked-skills/repo-analysis.md +58 -0
  191. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/01-orient-cluster.md +96 -0
  192. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/02-prepare-branch.md +53 -0
  193. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/03-select-child.md +63 -0
  194. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/04-execute-child.md +75 -0
  195. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/05-validate-child.md +57 -0
  196. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/06-commit-and-update-linear.md +74 -0
  197. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/07-decide-continuation.md +89 -0
  198. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/08-closeout-librarian.md +146 -0
  199. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/08-final-delivery.md +91 -0
  200. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/09-final-delivery.md +104 -0
  201. package/dist/workspace/workspace/.polaris/skills/polaris-tools/README.md +63 -0
  202. package/dist/workspace/workspace/.polaris/skills/polaris-tools/SKILL.md +94 -0
  203. package/dist/workspace/workspace/.polaris/skills/polaris-tools/tools.js +191 -0
  204. package/dist/workspace/workspace/smartdocs/architecture/.gitkeep +0 -0
  205. package/dist/workspace/workspace/smartdocs/audits/.gitkeep +0 -0
  206. package/dist/workspace/workspace/smartdocs/decisions/.gitkeep +0 -0
  207. package/dist/workspace/workspace/smartdocs/doctrine/active/.gitkeep +0 -0
  208. package/dist/workspace/workspace/smartdocs/runtime/.gitkeep +0 -0
  209. package/dist/workspace/workspace/smartdocs/specs/active/.gitkeep +0 -0
  210. package/dist/workspace/workspace/smartdocs/specs/archive/.gitkeep +0 -0
  211. package/package.json +4 -4
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: closeout-librarian-step-08
3
+ description: Commit all documentation and cognition changes as a single sealed librarian commit.
4
+ ---
5
+
6
+ # Step 08 — Librarian Commit
7
+
8
+ ## Purpose
9
+
10
+ All documentation changes produced by steps 03–07 must be committed as a single commit
11
+ before the Foreman proceeds to finalize. This separates implementation commits (from workers)
12
+ from documentation reconciliation commits (from the Librarian).
13
+
14
+ ## Commit Constraints
15
+
16
+ The Librarian commit MUST:
17
+ - Contain only files from `packet.allowed_write_paths`
18
+ - Contain no implementation source code
19
+ - Contain no runtime state files (`current-state.json`, telemetry JSONL, cluster-state)
20
+ - Be a distinct commit from any worker implementation commit
21
+ - Use the canonical commit message format (see below)
22
+
23
+ If any staged file would violate these constraints, unstage it and record as a blocker.
24
+
25
+ ## Pre-Commit Validation
26
+
27
+ Before staging, verify:
28
+ 1. Every file to be committed exists at a path within `packet.allowed_write_paths`.
29
+ 2. No file is at a path matching `packet.prohibited_write_paths`.
30
+ 3. At least one non-empty change exists (if no changes, skip commit and record no-op).
31
+
32
+ If prohibited files are staged: `git reset HEAD <file>` before committing.
33
+
34
+ ## No-Change Case
35
+
36
+ If steps 03–07 produced no file changes (everything was already current), step 08 is a
37
+ no-op. Record `commit_sha: null` in the result. The Foreman will accept a null commit SHA
38
+ from the Librarian result.
39
+
40
+ ## Commit Message Format
41
+
42
+ ```text
43
+ docs(closeout): reconcile cognition for cluster <cluster_id>
44
+
45
+ Run: <run_id>
46
+ Cluster: <cluster_id>
47
+ Children: <comma-separated completed child IDs>
48
+ Files updated:
49
+ - POLARIS.md: <count> files
50
+ - SUMMARY.md: <count> files
51
+ - docs ingested: <count>
52
+ - links repaired: <count>
53
+ ```
54
+
55
+ Example:
56
+ ```text
57
+ docs(closeout): reconcile cognition for cluster POL-303
58
+
59
+ Run: polaris-run-closeout-librarian-2026-06-03-001
60
+ Cluster: POL-303
61
+ Children: POL-304, POL-305, POL-306, POL-307
62
+ Files updated:
63
+ - POLARIS.md: 3 files
64
+ - SUMMARY.md: 2 files
65
+ - docs ingested: 1
66
+ - links repaired: 2
67
+ ```
68
+
69
+ ## Actions
70
+
71
+ ### 8.1 Stage Changed Files
72
+
73
+ Stage all files that were written in steps 03–07:
74
+ ```bash
75
+ git add <polaris_md_updates[*].file>
76
+ git add <summary_md_updates[*].file>
77
+ git add <docs_ingested[*].target_path>
78
+ git add <yaml_updates[*].file>
79
+ git add <cognition archive paths>
80
+ git add <cognition-index.json paths>
81
+ ```
82
+
83
+ ### 8.2 Verify Staged Files
84
+
85
+ Run `git diff --cached --name-only` and verify:
86
+ - All staged files are in `packet.allowed_write_paths`
87
+ - None are in `packet.prohibited_write_paths`
88
+
89
+ If any violation: unstage the offending file, record as blocker.
90
+
91
+ ### 8.3 Commit
92
+
93
+ If staged files exist:
94
+ ```bash
95
+ git commit -m "<commit message>"
96
+ ```
97
+
98
+ Capture the resulting commit SHA.
99
+
100
+ ### 8.4 Record
101
+
102
+ Record the commit SHA and list of committed files for step 09.
103
+
104
+ ## Failure Handling
105
+
106
+ If `git commit` fails:
107
+ - Record `status: "failure"` in the running result state.
108
+ - Record the commit error in `blockers`.
109
+ - Proceed to step 09 (write failure result).
110
+
111
+ If no files were staged (no-change case):
112
+ - Record `commit_sha: null`.
113
+ - Proceed to step 09.
114
+
115
+ ## Emit Telemetry
116
+
117
+ Emit `librarian-commit` event with `commit_sha` and `files_changed` count.
118
+
119
+ Proceed to step 09.
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: closeout-librarian-step-09
3
+ description: Write the sealed CloseoutLibrarianResult JSON to result_path and terminate.
4
+ ---
5
+
6
+ # Step 09 — Sealed Result
7
+
8
+ ## Purpose
9
+
10
+ The Librarian's sole communication channel with the Foreman is the sealed result JSON.
11
+ This step assembles the result from all prior steps and writes it to `packet.result_path`.
12
+
13
+ After writing the result, the Librarian session terminates. No further writes are permitted.
14
+
15
+ ## Result Schema
16
+
17
+ ```typescript
18
+ interface CloseoutLibrarianResult {
19
+ schema_version: "1.0";
20
+ role: "closeout-librarian";
21
+ run_id: string;
22
+ dispatch_id: string;
23
+ cluster_id: string;
24
+ status: "success" | "partial" | "blocked" | "failure";
25
+ commit_sha: string | null;
26
+ commit_message: string;
27
+ files_committed: string[];
28
+ drift_reconciliation: DriftReconciliationResult;
29
+ polaris_md_updates: FileUpdate[];
30
+ summary_md_updates: FileUpdate[];
31
+ docs_ingested: DocAction[];
32
+ docs_archived: DocAction[];
33
+ yaml_updates: FileUpdate[];
34
+ cognition_archived: CognitionArchiveEntry[];
35
+ link_validation: LinkValidationReport;
36
+ blockers: LibrarianBlocker[];
37
+ reconciled_at: string; // ISO8601
38
+ evidence_summary: string; // ≤200 words
39
+ }
40
+ ```
41
+
42
+ ## Status Determination
43
+
44
+ | Condition | Status |
45
+ |---|---|
46
+ | Commit succeeded, no blockers | `"success"` |
47
+ | Commit succeeded, informational blockers only | `"success"` |
48
+ | Commit succeeded, some work could not be done (recoverable blockers) | `"partial"` |
49
+ | No changes needed (everything already current) | `"success"` (commit_sha: null) |
50
+ | Some work attempted but blocked before commit | `"blocked"` |
51
+ | Commit failed | `"failure"` |
52
+ | Packet unreadable or invalid | `"failure"` |
53
+
54
+ ## Evidence Summary
55
+
56
+ The `evidence_summary` field must be ≤200 words. It should describe:
57
+ - What was reconciled (POLARIS.md updated, docs ingested, etc.)
58
+ - What was left as-is (already current)
59
+ - Any blockers that require operator attention
60
+ - What a future session needs to know
61
+
62
+ Write it for a human operator or Foreman, not for a technical log.
63
+
64
+ ## Foreman Validation (Foreman Reads This)
65
+
66
+ The Foreman validates the result before proceeding to `polaris finalize`:
67
+ 1. `status` must be `"success"` or `"partial"` to proceed.
68
+ 2. `"blocked"` or `"failure"` halts finalize and escalates to the operator.
69
+ 3. `commit_sha` (if non-null) must be reachable in the current git log.
70
+ 4. `files_committed` must not include any path from `prohibited_write_paths`.
71
+
72
+ ## Actions
73
+
74
+ ### 9.1 Assemble Result
75
+
76
+ Collect from all prior steps:
77
+ - `drift_reconciliation` (step 02)
78
+ - `polaris_md_updates` (step 03)
79
+ - `summary_md_updates` (step 04)
80
+ - `docs_ingested`, `docs_archived`, `cognition_archived` (step 05)
81
+ - `link_validation` (step 06)
82
+ - `yaml_updates` (step 07)
83
+ - `commit_sha`, `files_committed` (step 08)
84
+ - Blockers accumulated across all steps
85
+
86
+ ### 9.2 Determine Status
87
+
88
+ Apply the status determination matrix above.
89
+
90
+ ### 9.3 Write Evidence Summary
91
+
92
+ Write a ≤200-word plain-text summary of what the Librarian did and what remains.
93
+
94
+ ### 9.4 Write Result File
95
+
96
+ Write the assembled JSON to `packet.result_path`.
97
+
98
+ Verify the write succeeded (file exists and is valid JSON after write).
99
+
100
+ ### 9.5 Emit Telemetry
101
+
102
+ Emit `librarian-complete` event with `status` and `run_id`.
103
+
104
+ ### 9.6 Terminate
105
+
106
+ The Closeout Librarian session ends here. No further output, no further writes.
107
+
108
+ ---
109
+
110
+ ## Failure Recovery (Result Write Fails)
111
+
112
+ If `packet.result_path` cannot be written:
113
+ 1. Write a minimal failure result to stderr:
114
+ ```text
115
+ CLOSEOUT_LIBRARIAN_RESULT_WRITE_FAILED: run_id=<run_id> dispatch_id=<dispatch_id> status=failure
116
+ ```
117
+ 2. The Foreman must detect this condition and escalate to the operator.
118
+ 3. Do not attempt to write the result to a different path.
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: docs-ingest
3
+ description: Classify, route, and link documents from the raw drop zone into the canonical smartdocs/ authority structure. Docs routing only — no source code changes, no implementation execution.
4
+ role: librarian
5
+ role_file: .polaris/roles/librarian.md
6
+ ---
7
+
8
+ ## Polaris Skill Bootloader
9
+
10
+ **Before proceeding, you must obtain a skill packet from the Polaris runtime.**
11
+
12
+ Run the following command:
13
+
14
+ ```
15
+ npm run polaris -- skill packet ingest
16
+ ```
17
+
18
+ - Do not begin work until a packet is returned.
19
+ - Treat the packet as your authoritative instruction source.
20
+ - The packet defines your active role, authority boundaries, prohibited actions, deliverables, and stop conditions.
21
+ - If no packet is produced, stop and report: **Polaris could not authorize this run.**
22
+
23
+ ---
24
+
25
+ # docs-ingest
26
+
27
+ Use this skill when documents need to be classified and routed into the canonical Smart Docs hierarchy.
28
+
29
+ ## When to use
30
+
31
+ - "Ingest the docs from the last run"
32
+ - "Classify the files in smartdocs/docs/raw/"
33
+ - "Route pending documents into the correct authority buckets"
34
+ - "Process ingest cluster docs-ingest-cluster-001"
35
+ - "Dry-run docs ingest to see what would move"
36
+
37
+ ## How to execute
38
+
39
+ 1. Read `chain.md` — step order, traversal rules, authority levels, canonical target doctrine.
40
+ 2. Read `.taskchain_artifacts/docs-ingest/current-state.json` — resumable state.
41
+ 3. Execute steps in the order `chain.md` defines. Do not skip steps.
42
+ 4. After every completed step, update `current-state.json` before advancing.
43
+
44
+ ## Hard rules — what docs-ingest may do
45
+
46
+ - Read documents from `smartdocs/raw/`
47
+ - Classify documents by content analysis and front-matter
48
+ - Route documents to correct authority directories within `smartdocs/`
49
+ - Write provenance records alongside placed files
50
+ - Update Polaris map entries to link docs to code areas
51
+ - Propose doctrine candidates (route to `doctrine/candidate/`; never promote to `doctrine/active/` without user approval)
52
+ - Emit telemetry events
53
+
54
+ ## Drop zone rule
55
+
56
+ **All newly generated documents must be placed in `smartdocs/raw/` first.**
57
+
58
+ No document may be written directly to `specs/active/`, `doctrine/active/`, `architecture/`, or `decisions/`. Every document enters through `raw/` and is promoted only after classification and approval.
59
+
60
+ ## Hard rules — what docs-ingest must NOT do
61
+
62
+ - Write new Smart Docs to root `docs/` — `smartdocs/` is the canonical target
63
+ - Silently promote documents to `doctrine/active/`, `specs/active/`, `architecture/`, or `decisions/`
64
+ - Mutate source files (`src/`, tests, config)
65
+ - Call `npm run polaris -- loop continue` or `npm run polaris -- finalize`
66
+ - Suppress detected conflicts
67
+
68
+ **Docs-ingest routes and classifies. It does not implement or promote without explicit approval.**
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "docs-ingest-chain",
3
+ "steps": [
4
+ "01-orient-ingest",
5
+ "02-classify-batch",
6
+ "03-conflict-check",
7
+ "04-place-and-link",
8
+ "05-finalize-ingest"
9
+ ],
10
+ "terminal_steps": ["05-finalize-ingest"],
11
+ "scope": "docs-ingest-only",
12
+ "forbidden_actions": [
13
+ "src file mutations",
14
+ "polaris loop continue",
15
+ "polaris finalize",
16
+ "git push",
17
+ "pr creation",
18
+ "doctrine/active/ writes without user approval",
19
+ "architecture/ writes without user approval",
20
+ "decisions/ writes without user approval",
21
+ "root docs/ writes for new Smart Docs"
22
+ ]
23
+ }
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: docs-ingest-chain
3
+ description: Route map for docs-ingest — step order, stop conditions, authority levels, canonical target doctrine, and artifact requirements.
4
+ ---
5
+
6
+ # docs-ingest chain
7
+
8
+ ## Authority
9
+
10
+ **Polaris runtime state is authoritative. Chat reasoning is not authoritative.**
11
+
12
+ Query runtime state before acting. Do not infer ingest scope or prior progress from conversation context.
13
+
14
+ ## CLI
15
+
16
+ Always use the repo-local Polaris CLI:
17
+
18
+ ```
19
+ npm run polaris -- docs ingest [--file <path>] [--batch <cluster-id>] [--dry-run]
20
+ ```
21
+
22
+ Drop zone: `smartdocs/raw/` — this is the single ingest entry point.
23
+
24
+ Never assume a globally linked `polaris` command exists.
25
+
26
+ ## Canonical Smart Docs target
27
+
28
+ `smartdocs/` is the authoritative Smart Docs ingest target. There is one drop zone: `smartdocs/raw/`.
29
+
30
+ - Root `docs/` is legacy/non-canonical — do not write new Smart Docs there.
31
+ - There are no sub-raw folders (`specs/raw/`, `doctrine/raw/`, `audits/raw/` do not exist). All drops land in `smartdocs/raw/` and are routed from there.
32
+
33
+ **Architectural intent:** Smart Docs exist to reduce repo-understanding token burn. Agents should move from:
34
+
35
+ ```
36
+ read many files → infer architecture
37
+ ```
38
+
39
+ to:
40
+
41
+ ```
42
+ read Smart Docs router → read local POLARIS.md → open only necessary files
43
+ ```
44
+
45
+ Smart Docs function as architectural compression, routing context, local subsystem summaries, and implementation guidance boundaries — without replacing canonical source files.
46
+
47
+ ## Step traversal order
48
+
49
+ ```text
50
+ 01-orient-ingest ← generate run_id, emit telemetry, load batch, confirm canonical target
51
+ 02-classify-batch ← content analysis + front-matter, assign classification per file
52
+ 03-conflict-check ← compare against doctrine/active/ and specs/active/; halt on contradiction
53
+ 04-place-and-link ← move files to authority buckets, write provenance, update map
54
+ 05-finalize-ingest ← emit completion telemetry, update state, report placement summary
55
+ ```
56
+
57
+ ## Stop conditions
58
+
59
+ **Any step:**
60
+ - Conflict directly contradicts active doctrine → halt, report, require user resolution
61
+ - High-authority placement attempted (`doctrine/active/`, `architecture/`, `decisions/`) without explicit approval → halt and surface for review
62
+ - `smartdocs/` not found → halt, report missing canonical target
63
+ - `run-start` telemetry write fails → halt
64
+
65
+ **Step 03 (conflict check):**
66
+ - Direct doctrine contradiction → halt with conflict report
67
+ - Overlapping spec scope → flag as candidate supersede; continue with warning
68
+
69
+ ## Authority levels
70
+
71
+ | Area | Authority | Who may write | Promotion path |
72
+ |---|---|---|---|
73
+ | `smartdocs/raw/` | none | any agent freely | `polaris doctrine draft` → `doctrine/candidate/` or `polaris doctrine spec-promote` → `specs/active/` |
74
+ | `smartdocs/runtime/` | low | polaris-run, polaris-finalize | no promotion; informational only |
75
+ | `smartdocs/specs/active/` | medium | `polaris doctrine spec-promote --approve` only | moved to `implemented/` or `superseded/` |
76
+ | `smartdocs/doctrine/candidate/` | low | docs ingest + `polaris doctrine draft` | `polaris doctrine promote` (user-approved) |
77
+ | `smartdocs/doctrine/active/` | high | `polaris doctrine promote` (user-approved) | `polaris doctrine deprecate` (user-approved) |
78
+ | `smartdocs/architecture/` | high | user-approved only | explicit ADR process |
79
+ | `smartdocs/decisions/` | high | user-approved only | explicit ADR process |
80
+
81
+ ## Run ID format
82
+
83
+ Format: `docs-ingest-<slug>-<date>-<seq>`
84
+ - `<slug>`: 2–4 lowercase hyphenated words from the ingest context. No issue IDs.
85
+ - `<date>`: `YYYY-MM-DD`
86
+ - `<seq>`: zero-padded sequential number per day (`001`, `002`, …)
87
+
88
+ Example: `docs-ingest-compact-contracts-2026-05-26-001`
89
+
90
+ ## Telemetry
91
+
92
+ Telemetry file: `.taskchain_artifacts/docs-ingest/runs/<run-id>/telemetry.jsonl` (append-only).
93
+
94
+ | Event | Trigger |
95
+ |---|---|
96
+ | `run-start` | Begin processing |
97
+ | `step-complete` | End of every step |
98
+ | `docs-ingest-classified` | Each file classified |
99
+ | `docs-ingest-conflict-detected` | Conflict found against active doctrine or spec |
100
+ | `doctrine-candidate-proposed` | Doc routed to `doctrine/candidate/` |
101
+ | `docs-ingest-stale-assumption` | Stale assumption annotated in front-matter |
102
+ | `docs-ingest-complete` | Batch done |
103
+
104
+ Required fields on every event: `event`, `run_id`, `timestamp`. Add `file` where applicable.
105
+
106
+ ## Context budget
107
+
108
+ One ingest cluster per session. Default batch: 10 files. Configurable:
109
+
110
+ ```json
111
+ { "docs": { "ingestBatchSize": 10 } }
112
+ ```
113
+
114
+ Stop after completing one cluster. Bootstrap packet guidance directs the next session to the next pending cluster.
115
+
116
+ ## Artifact authority
117
+
118
+ `.taskchain_artifacts/docs-ingest/current-state.json` is the sole authoritative live state surface.
119
+
120
+ - Update after every completed step — before advancing.
121
+ - A step is NOT complete until the state update succeeds.
122
+ - If the update fails: stop and report the persistence failure.
123
+
124
+ ## Linked-skill invocation boundaries
125
+
126
+ | Skill | Allowed steps | Condition |
127
+ |---|---|---|
128
+ | repo-analysis | 01, 02 | targeted lookup only; for code-area linking |
129
+
130
+ ## Execution reporting
131
+
132
+ After each completed step, emit a checkpoint:
133
+
134
+ ```text
135
+ **[step-name]** done | blocked | needs-input
136
+ Changed: <files moved / provenance records written / map entries updated> or none
137
+ Validated: <conflict checks / authority checks passed> or none
138
+ Blockers: none | <explicit blocker>
139
+ ```
140
+
141
+ ### Never compressed
142
+
143
+ Always write in full:
144
+ - Conflict reports and resolution requirements
145
+
146
+ - Doctrine candidate proposals
147
+ - Stale-assumption annotations
148
+ - Authority violation warnings
149
+ - Final placement summary
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: docs-ingest-step-01-orient-ingest
3
+ description: Generate run_id, emit run-start telemetry, confirm provider status, load batch file list, and confirm canonical ingest target.
4
+ ---
5
+
6
+ # Step 01 — Orient ingest
7
+
8
+ ## Purpose
9
+
10
+ Establish bounded ingest context before touching any files. Confirm what to process, confirm the canonical target exists, and confirm provider status.
11
+
12
+ ## Scope declarations
13
+
14
+ ```yaml
15
+ allowed_files:
16
+ - .polaris/skills/docs-ingest/SKILL.md
17
+ - .polaris/skills/docs-ingest/chain.md
18
+ - .taskchain_artifacts/docs-ingest/current-state.json
19
+ - .polaris/docs-ingest/<cluster-id>.json
20
+ - polaris.config.json
21
+ - .polaris/map/index.json
22
+ allowed_routes:
23
+ - CLAUDE.md
24
+ - smartdocs/specs/active/docs-authority-model.md
25
+ - .polaris/skills/docs-ingest/chain.md
26
+ allowed_skills:
27
+ - repo-analysis
28
+ expected_evidence:
29
+ - run_id generated
30
+ - run-start telemetry emitted
31
+ - batch file list loaded
32
+ - smartdocs/ confirmed present
33
+ - canonical target doctrine stated
34
+ stop_rules:
35
+ - run-start telemetry write fails
36
+ - smartdocs/ not found
37
+ - batch cluster file missing or empty
38
+ - no pending clusters and no --file/--batch flags
39
+ ```
40
+
41
+ ## Actions
42
+
43
+ 0. **Generate `run_id`**:
44
+ - Fresh runs: `docs-ingest-<slug>-<date>-<seq>` (see `chain.md` for format rules).
45
+ - Resumed runs: generate new `run_id` first, emit run-start telemetry immediately (with `prior_run_id: null`), then read `current-state.json` to retrieve prior `run_id` for state continuity.
46
+
47
+ 1. **Emit `run-start` telemetry** — first I/O action, before any file access:
48
+ ```bash
49
+ mkdir -p .taskchain_artifacts/docs-ingest/runs/<run-id>
50
+ echo '{"event":"run-start","run_id":"<run-id>","prior_run_id":"<prior or null>","timestamp":"<ISO>"}' \
51
+ >> .taskchain_artifacts/docs-ingest/runs/<run-id>/telemetry.jsonl
52
+ ```
53
+ If this write fails: halt. Do not continue. For resumed runs, the `prior_run_id` is obtained after this emit by reading `current-state.json`.
54
+
55
+ 2. **Determine ingest source**:
56
+ - `--file <path>`: single file mode. Treat as a batch of one.
57
+ - `--batch <cluster-id>`: read `.polaris/docs-ingest/<cluster-id>.json` for file list.
58
+ - No flags: read `current-state.json` for the next pending cluster ID. If none: halt with "no pending ingest clusters — use --file or --batch, or register clusters first."
59
+
60
+ 3. **Confirm canonical target** — verify `smartdocs/` exists in the repo root.
61
+ - If not found: halt and report. Do not attempt to create it.
62
+ - Assert doctrine: `smartdocs/` is the only valid ingest target. Root `docs/` is legacy. New Smart Docs must not be placed there.
63
+ - Drop zone is `smartdocs/raw/` — the single ingest entry point. There are no sub-raw folders.
64
+ - If any source file already lives in `smartdocs/raw/`: reclassification only — no file move needed in step 04.
65
+
66
+ 4. **Load Polaris map** — read `.polaris/map/index.json` for code-area linking in step 04. If absent, note and proceed (map linking will be skipped in step 04).
67
+
68
+ 5. **Restate working context** in under 8 bullets:
69
+ - `run_id` and fresh/resumed
70
+ - Ingest mode (`--file` / `--batch` / pending-cluster)
71
+ - File list to process
72
+ - Canonical target confirmed: `smartdocs/`
73
+ - Provider status
74
+
75
+ ## Artifact update
76
+
77
+ Update `.taskchain_artifacts/docs-ingest/current-state.json` (artifact path unchanged — skill identity is `docs-ingest`):
78
+ - `run_id`, `status: orienting`, `current_step_id: 01-orient-ingest`
79
+ - `files_to_process: [...]`, `updated_at: <timestamp>`
80
+
81
+ Emit `step-complete` for `01-orient-ingest` to telemetry JSONL.
82
+
83
+ ## Next step
84
+
85
+ 02-classify-batch
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: docs-ingest-step-02-classify-batch
3
+ description: Read each file in the batch, inspect front-matter and content signals, and assign exactly one classification from the docs-authority-model.
4
+ ---
5
+
6
+ # Step 02 — Classify batch
7
+
8
+ ## Purpose
9
+
10
+ Assign each file to exactly one classification. Classification determines target directory, authority level, and whether user approval is required before placement.
11
+
12
+ ## Classification table
13
+
14
+ | Class | Target path | Authority | Approval required |
15
+ |---|---|---|---|
16
+ | `runtime-summary` | `smartdocs/runtime/summaries/` | low | no |
17
+ | `run-report` | `smartdocs/runtime/run-reports/` | low | no |
18
+ | `spec-raw` | `smartdocs/raw/` | none | no |
19
+ | `spec-active` | `smartdocs/specs/active/` | medium | yes |
20
+ | `audit-finding` | `smartdocs/audits/findings/` | medium | no |
21
+ | `doctrine-candidate` | `smartdocs/doctrine/candidate/` | low | no |
22
+ | `architecture` | `smartdocs/architecture/` | high | yes |
23
+ | `decision` | `smartdocs/decisions/` | high | yes |
24
+ | `deprecated-noise` | `smartdocs/runtime/generated/` | low | no |
25
+
26
+ ## Classification process (per file)
27
+
28
+ 1. Read the document.
29
+ 2. Check for explicit Polaris front-matter (`status`, `authority`, `issue`, `classification`). If present and unambiguous: assign classification with **confidence: high**.
30
+ 3. Otherwise infer from content signals and assign a confidence level:
31
+ - Contains Polaris architectural assertions or "how things should work" → `doctrine-candidate`
32
+ - Structured spec with headings (Spec ID, Status, Purpose, etc.) → `spec-raw`
33
+ - Active spec governing in-flight work referencing an open issue → `spec-active` (flag for approval)
34
+ - Run output, telemetry summaries, session notes → `runtime-summary`
35
+ - Structured run output with metrics → `run-report`
36
+ - Contains `FINDING:` markers or audit-style analysis → `audit-finding`
37
+ - ADR-style decision record → `decision` (flag for approval)
38
+ - Architectural diagrams or structural design context → `architecture` (flag for approval)
39
+ - Low-signal, transient, or auto-generated content → `deprecated-noise`
40
+ 4. Assign a confidence level per file:
41
+ - **high**: explicit front-matter present, or content matches exactly one signal with no ambiguity
42
+ - **low**: multiple signals match, or content is sparse/unclear
43
+ 5. Routing by confidence:
44
+ - **high confidence** → auto-place to the classified target in step 04 (no pause, no user input required — except `spec-active`, `architecture`, `decision` which always require approval regardless of confidence)
45
+ - **low confidence** → route to `smartdocs/raw/` as holding area; record reason in telemetry
46
+ 6. When confidence cannot be determined: default to **low** and route to `smartdocs/raw/`.
47
+
48
+ ## Approval-required classifications
49
+
50
+ For `spec-active`, `architecture`, and `decision`: do not route automatically regardless of confidence. Surface for user confirmation before step 04 proceeds for those files. Emit:
51
+
52
+ ```text
53
+ **needs-input**: <n> file(s) classified as approval-required (<classes>).
54
+ Proposed placements:
55
+ <file> → <target> [confidence: high|low]
56
+ Confirm placement before step 04 proceeds for these files.
57
+ ```
58
+
59
+ High-confidence, non-approval-required files proceed to step 03 immediately without pause.
60
+ Low-confidence files are routed to `smartdocs/raw/` and noted in the step 05 summary.
61
+
62
+ ## Scope declarations
63
+
64
+ ```yaml
65
+ allowed_files:
66
+ - source files in the batch (read only)
67
+ - smartdocs/specs/active/docs-authority-model.md (reference)
68
+ expected_evidence:
69
+ - every file in batch assigned a classification and confidence level
70
+ - approval-required files surfaced before step 04
71
+ - low-confidence files routed to smartdocs/raw/ with telemetry note
72
+ - high-confidence non-approval files proceed automatically
73
+ stop_rules:
74
+ - file cannot be read
75
+ ```
76
+
77
+ ## Artifact update
78
+
79
+ Update `current-state.json`:
80
+ - `current_step_id: 02-classify-batch`
81
+ - `classifications: { "<file>": { "class": "<class>", "target": "<path>", "confidence": "high|low", "approval_required": true|false, "auto_place": true|false } }`
82
+
83
+ Emit `docs-ingest-classified` telemetry event per file.
84
+
85
+ ## Next step
86
+
87
+ 03-conflict-check