@lsctech/polaris 0.3.21 → 0.3.23

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 (147) hide show
  1. package/dist/cli/adopt-assets.js +13 -0
  2. package/dist/cli/adopt-canon.js +1 -0
  3. package/dist/cli/adopt-genesis.js +85 -4
  4. package/dist/cli/adopt-instructions.js +3 -3
  5. package/dist/cli/adopt-report.js +15 -1
  6. package/dist/cli/adopt-rules.js +44 -8
  7. package/dist/cli/adopt-workspace.js +2 -2
  8. package/dist/cli/adoption-inventory.js +5 -2
  9. package/dist/cli/init.js +5 -4
  10. package/dist/config/provider-detect.js +19 -2
  11. package/dist/workspace/.polaris/skills/ROUTING.md +4 -0
  12. package/dist/workspace/.polaris/skills/closeout-librarian/POLARIS.md +9 -8
  13. package/dist/workspace/.polaris/skills/docs-ingest/SKILL.md +2 -2
  14. package/dist/workspace/.polaris/skills/docs-ingest/chain.md +1 -1
  15. package/dist/workspace/.polaris/skills/docs-ingest/steps/04-place-and-link.md +5 -5
  16. package/dist/workspace/.polaris/skills/docs-ingest/steps/05-finalize-ingest.md +1 -1
  17. package/dist/workspace/.polaris/skills/docs-promote/SKILL.md +6 -6
  18. package/dist/workspace/.polaris/skills/docs-promote/chain.md +5 -5
  19. package/dist/workspace/.polaris/skills/docs-promote/steps/04-conflict-surface.md +1 -1
  20. package/dist/workspace/.polaris/skills/docs-promote/steps/06-execute-promote-deprecate.md +3 -3
  21. package/dist/workspace/{workspace/.polaris → .polaris}/skills/docs-review/SKILL.md +1 -1
  22. package/dist/workspace/{workspace/.polaris → .polaris}/skills/docs-triage/SKILL.md +1 -1
  23. package/dist/workspace/{workspace/.polaris → .polaris}/skills/docs-triage/chain.md +1 -1
  24. package/dist/workspace/.polaris/skills/polaris-analyze/SKILL.md +1 -1
  25. package/dist/workspace/.polaris/skills/polaris-analyze/chain.md +2 -2
  26. package/dist/workspace/.polaris/skills/polaris-analyze/issue-reconciliation.md +1 -1
  27. package/dist/workspace/.polaris/skills/polaris-analyze/linked-skills/repo-analysis.md +3 -4
  28. package/dist/workspace/.polaris/skills/polaris-analyze/steps/02-map-affected-code.md +2 -2
  29. package/dist/workspace/.polaris/skills/polaris-catalog/SKILL.md +5 -5
  30. package/dist/workspace/.polaris/skills/polaris-catalog/chain.md +3 -3
  31. package/dist/workspace/.polaris/skills/polaris-catalog/steps/04-classify-and-place.md +3 -3
  32. package/dist/workspace/.polaris/skills/polaris-reconcile/SKILL.md +2 -2
  33. package/dist/workspace/.polaris/skills/polaris-run/SKILL.md +1 -1
  34. package/dist/workspace/.polaris/skills/polaris-run/chain.md +17 -17
  35. package/dist/workspace/.polaris/skills/polaris-run/linked-skills/repo-analysis.md +3 -4
  36. package/dist/workspace/.polaris/skills/polaris-run/steps/01-orient-cluster.md +3 -3
  37. package/dist/workspace/.polaris/skills/polaris-run/steps/03-select-child.md +1 -1
  38. package/dist/workspace/.polaris/skills/polaris-run/steps/06-commit-and-update-linear.md +2 -2
  39. package/dist/workspace/.polaris/skills/polaris-run/steps/07-decide-continuation.md +3 -3
  40. package/dist/workspace/.polaris/skills/polaris-run/steps/08-closeout-librarian.md +1 -1
  41. package/dist/workspace/.polaris/skills/polaris-run/steps/08-final-delivery.md +2 -2
  42. package/dist/workspace/.polaris/skills/polaris-run/steps/09-final-delivery.md +1 -1
  43. package/dist/workspace/.polaris/skills/polaris-tools/README.md +1 -1
  44. package/dist/workspace/POLARIS_RULES.md +169 -0
  45. package/package.json +3 -2
  46. package/dist/workspace/workspace/.polaris/roles/analyst.md +0 -38
  47. package/dist/workspace/workspace/.polaris/roles/closeout-librarian.md +0 -122
  48. package/dist/workspace/workspace/.polaris/roles/cognition-librarian.md +0 -37
  49. package/dist/workspace/workspace/.polaris/roles/finalizer.md +0 -45
  50. package/dist/workspace/workspace/.polaris/roles/foreman.md +0 -165
  51. package/dist/workspace/workspace/.polaris/roles/librarian.md +0 -74
  52. package/dist/workspace/workspace/.polaris/roles/worker.md +0 -119
  53. package/dist/workspace/workspace/.polaris/session-type +0 -1
  54. package/dist/workspace/workspace/.polaris/skills/ROUTING.md +0 -113
  55. package/dist/workspace/workspace/.polaris/skills/caveman/SKILL.md +0 -74
  56. package/dist/workspace/workspace/.polaris/skills/caveman-compress/scripts/compress.py +0 -272
  57. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/POLARIS.md +0 -46
  58. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/SKILL.md +0 -59
  59. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/chain.md +0 -116
  60. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/01-load-cluster-context.md +0 -78
  61. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/02-drift-reconciliation.md +0 -157
  62. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/03-reconcile-polaris-md.md +0 -93
  63. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/04-reconcile-summary-md.md +0 -106
  64. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/05-doc-ingestion.md +0 -114
  65. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/06-link-validation.md +0 -128
  66. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/07-yaml-linking.md +0 -95
  67. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/08-librarian-commit.md +0 -119
  68. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/09-sealed-result.md +0 -118
  69. package/dist/workspace/workspace/.polaris/skills/docs-ingest/SKILL.md +0 -68
  70. package/dist/workspace/workspace/.polaris/skills/docs-ingest/chain.json +0 -23
  71. package/dist/workspace/workspace/.polaris/skills/docs-ingest/chain.md +0 -149
  72. package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/01-orient-ingest.md +0 -85
  73. package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/02-classify-batch.md +0 -87
  74. package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/03-conflict-check.md +0 -66
  75. package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/04-place-and-link.md +0 -77
  76. package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/05-finalize-ingest.md +0 -49
  77. package/dist/workspace/workspace/.polaris/skills/docs-promote/SKILL.md +0 -79
  78. package/dist/workspace/workspace/.polaris/skills/docs-promote/chain.json +0 -25
  79. package/dist/workspace/workspace/.polaris/skills/docs-promote/chain.md +0 -80
  80. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/01-orient-promote.md +0 -53
  81. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/02-review-candidates.md +0 -51
  82. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/03-read-linked-code.md +0 -50
  83. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/04-conflict-surface.md +0 -65
  84. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/05-await-approval.md +0 -61
  85. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/06-execute-promote-deprecate.md +0 -65
  86. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/07-finalize-promote.md +0 -44
  87. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/SKILL.md +0 -94
  88. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/chain.json +0 -20
  89. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/chain.md +0 -105
  90. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/issue-reconciliation.md +0 -149
  91. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/issue-template.md +0 -133
  92. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/linked-skills/repo-analysis.md +0 -55
  93. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/01-fetch-and-orient.md +0 -79
  94. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/02-map-affected-code.md +0 -58
  95. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/03-assess-issue.md +0 -58
  96. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/04-blocker-check.md +0 -60
  97. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/05-create-cluster-plan.md +0 -197
  98. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/06-final-report.md +0 -60
  99. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/SKILL.md +0 -91
  100. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/chain.json +0 -22
  101. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/chain.md +0 -85
  102. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/01-orient-catalog.md +0 -92
  103. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/02-reconcile-polaris-md.md +0 -33
  104. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/03-reconcile-summary-md.md +0 -70
  105. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/04-classify-and-place.md +0 -117
  106. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/05-catalog-commit.md +0 -94
  107. package/dist/workspace/workspace/.polaris/skills/polaris-medic/SKILL.md +0 -52
  108. package/dist/workspace/workspace/.polaris/skills/polaris-medic/chain.md +0 -111
  109. package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/01-orient-medic.md +0 -75
  110. package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/02-diagnose.md +0 -79
  111. package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/03-repair.md +0 -64
  112. package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/04-validate.md +0 -66
  113. package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/05-create-chart.md +0 -85
  114. package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/06-closeout.md +0 -86
  115. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/SKILL.md +0 -75
  116. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/chain.json +0 -20
  117. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/chain.md +0 -67
  118. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/01-orient-reconcile.md +0 -82
  119. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/02-reconcile-polaris-md.md +0 -95
  120. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/03-reconcile-summary-md.md +0 -108
  121. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/04-reconcile-commit.md +0 -88
  122. package/dist/workspace/workspace/.polaris/skills/polaris-run/SKILL.md +0 -135
  123. package/dist/workspace/workspace/.polaris/skills/polaris-run/chain.json +0 -19
  124. package/dist/workspace/workspace/.polaris/skills/polaris-run/chain.md +0 -298
  125. package/dist/workspace/workspace/.polaris/skills/polaris-run/execution-adapter.md +0 -34
  126. package/dist/workspace/workspace/.polaris/skills/polaris-run/linked-skills/repo-analysis.md +0 -58
  127. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/01-orient-cluster.md +0 -96
  128. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/02-prepare-branch.md +0 -53
  129. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/03-select-child.md +0 -63
  130. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/04-execute-child.md +0 -75
  131. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/05-validate-child.md +0 -57
  132. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/06-commit-and-update-linear.md +0 -74
  133. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/07-decide-continuation.md +0 -89
  134. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/08-closeout-librarian.md +0 -146
  135. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/08-final-delivery.md +0 -91
  136. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/09-final-delivery.md +0 -104
  137. package/dist/workspace/workspace/.polaris/skills/polaris-tools/README.md +0 -63
  138. package/dist/workspace/workspace/.polaris/skills/polaris-tools/SKILL.md +0 -94
  139. package/dist/workspace/workspace/.polaris/skills/polaris-tools/tools.js +0 -191
  140. package/dist/workspace/workspace/smartdocs/architecture/.gitkeep +0 -0
  141. package/dist/workspace/workspace/smartdocs/audits/.gitkeep +0 -0
  142. package/dist/workspace/workspace/smartdocs/decisions/.gitkeep +0 -0
  143. package/dist/workspace/workspace/smartdocs/doctrine/active/.gitkeep +0 -0
  144. package/dist/workspace/workspace/smartdocs/runtime/.gitkeep +0 -0
  145. package/dist/workspace/workspace/smartdocs/specs/active/.gitkeep +0 -0
  146. package/dist/workspace/workspace/smartdocs/specs/archive/.gitkeep +0 -0
  147. /package/dist/workspace/{workspace/.polaris → .polaris}/skills/docs-review/chain.md +0 -0
@@ -1,87 +0,0 @@
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
@@ -1,66 +0,0 @@
1
- ---
2
- name: docs-ingest-step-03-conflict-check
3
- description: Compare each classified file against doctrine/active/ and specs/active/ to detect contradictions or overlapping scope before placement.
4
- ---
5
-
6
- # Step 03 — Conflict check
7
-
8
- ## Purpose
9
-
10
- Prevent silent contradiction of active doctrine or specs. Every conflict must be surfaced. None may be suppressed.
11
-
12
- ## Check sequence (per file)
13
-
14
- 1. **Active doctrine check** — compare document assertions against all files in `smartdocs/doctrine/active/`.
15
- - Direct contradiction (document asserts X; existing active doctrine asserts not-X) → **HALT**. Report conflict. Do not continue until user resolves.
16
-
17
- 2. **Active spec overlap** — compare document scope against `smartdocs/specs/active/`.
18
- - Overlapping scope (two specs govern the same surface) → flag as candidate supersede. Surface recommendation to user. Do not halt; continue with warning.
19
-
20
- 3. **Stale assumption check** — scan for references to APIs, file paths, commands, or module names that no longer exist (cross-reference `.polaris/map/index.json`).
21
- - Stale assumption found → record in `current-state.json` under `stale_assumptions` and emit `docs-ingest-stale-assumption` telemetry. Do not halt. Do not mutate source files.
22
-
23
- 4. **No conflicts** → proceed to step 04.
24
-
25
- ## Halt behavior
26
-
27
- On direct doctrine contradiction:
28
-
29
- ```text
30
- **BLOCKED — doctrine conflict detected**
31
- File: <source path>
32
- Conflicts with: <smartdocs/doctrine/active/<file>>
33
- Assertion: <what conflicts>
34
- Required: user must resolve before ingest can proceed for this file.
35
- ```
36
-
37
- Do not advance to step 04 for the conflicting file until resolved or reclassified. Non-conflicting files in the same batch may proceed.
38
-
39
- ## Scope declarations
40
-
41
- ```yaml
42
- allowed_files:
43
- - source files from batch (read only)
44
- - smartdocs/doctrine/active/ (read only)
45
- - smartdocs/specs/active/ (read only)
46
- - .polaris/map/index.json (read only)
47
- expected_evidence:
48
- - all files checked against active doctrine and specs
49
- - direct contradictions halted and reported
50
- - stale assumptions recorded in current-state.json
51
- - overlaps surfaced with candidate-supersede recommendation
52
- stop_rules:
53
- - direct doctrine contradiction (file held; batch may continue)
54
- ```
55
-
56
- ## Artifact update
57
-
58
- Update `current-state.json`:
59
- - `current_step_id: 03-conflict-check`
60
- - `conflicts: [{ "file": "<path>", "type": "contradiction|overlap|stale", "detail": "..." }]`
61
-
62
- Emit `docs-ingest-conflict-detected` for each conflict found.
63
-
64
- ## Next step
65
-
66
- 04-place-and-link
@@ -1,77 +0,0 @@
1
- ---
2
- name: docs-ingest-step-04-place-and-link
3
- description: Move classified files to their target authority directories within smartdocs/, write provenance records, and update Polaris map entries.
4
- ---
5
-
6
- # Step 04 — Place and link
7
-
8
- ## Purpose
9
-
10
- Execute placements for all files that cleared steps 02–03. High-confidence, non-approval-required files are placed automatically. Approval-required files wait for explicit user confirmation. Low-confidence files land in `smartdocs/raw/`. All target paths are within `smartdocs/`. Write provenance. Update the map.
11
-
12
- ## Placement rules (per file)
13
-
14
- 1. **Check `auto_place` flag** — read from `current-state.json` classifications:
15
- - `auto_place: true` (high confidence, non-approval-required) → proceed immediately
16
- - `auto_place: false`, `approval_required: false` (low confidence) → target is `smartdocs/raw/`; proceed immediately
17
- - `approval_required: true` → hold until user confirms
18
-
19
- 2. **Verify target directory** — ensure the target path from step 02 exists. Create it if missing (within `smartdocs/` only).
20
-
21
- 3. **Check for existing file** at the target path. If a file already exists there: halt for that file and report. Do not overwrite without explicit approval.
22
-
23
- 4. **Use the Polaris CLI** — do not move files manually. The CLI handles provenance, map updates, and duplicate detection:
24
- - `spec-raw` or low-confidence fallback: `npm run polaris -- docs ingest --file <path>` (CLI routes to `smartdocs/raw/`; if source is already there, no move occurs)
25
- - `doctrine-candidate`: `npm run polaris -- doctrine draft <path>`
26
- - All other classifications: use `npm run polaris -- docs ingest --file <path>`
27
- - If source is already in `smartdocs/` (reclassification): update front-matter only, re-run ingest to refresh provenance.
28
- - Do not write anything to root `docs/`.
29
-
30
- 5. **Doctrine-candidate front-matter** — the CLI injects this automatically via `doctrine draft`. For reference, the added fields are:
31
- ```yaml
32
- status: candidate
33
- candidate-since: <YYYY-MM-DD>
34
- source: <original-path>
35
- ```
36
- Emit `doctrine-candidate-proposed` telemetry event.
37
-
38
- 6. **Provenance record** — the CLI writes `<filename>.provenance.json` alongside the placed file automatically. Verify it exists after placement.
39
-
40
- 7. **Update Polaris map** — the CLI calls `updateMapEntry` internally. After the batch: run `npm run polaris -- map update --changed` to synchronize the atlas.
41
-
42
- ## Hard rules
43
-
44
- - All placements land within `smartdocs/`. Never root `docs/`.
45
- - High-authority targets (`doctrine/active/`, `specs/active/`, `architecture/`, `decisions/`) are BLOCKED without explicit user approval. Halt and report if attempted without it.
46
- - Low-confidence files always land in `smartdocs/raw/` regardless of inferred class.
47
- - The CLI handles file moves — do not use `mv` or `cp` directly on files under `smartdocs/`. Manual moves bypass `.smartdocignore` enforcement.
48
- - If the CLI rejects a file as ignored (e.g., `POLARIS.md`, `SUMMARY.md`, `README.md`), do NOT move it manually. Leave it in `raw/` and note it in the step 05 summary as ineligible.
49
-
50
- ## Scope declarations
51
-
52
- ```yaml
53
- allowed_files:
54
- - source files (batch)
55
- - smartdocs/ (target hierarchy — read and write via CLI)
56
- - .polaris/map/index.json (read and write)
57
- - .polaris/map/file-routes.json (read and write)
58
- expected_evidence:
59
- - all approved files placed at correct target paths within smartdocs/
60
- - provenance records written alongside each placed file
61
- - map updated via npm run polaris -- map update --changed
62
- - low-confidence files confirmed routed to smartdocs/raw/
63
- - no placements to root docs/ or high-authority paths without approval
64
- stop_rules:
65
- - target path collision without approval
66
- - high-authority placement attempted without approval flag
67
- ```
68
-
69
- ## Artifact update
70
-
71
- Update `current-state.json`:
72
- - `current_step_id: 04-place-and-link`
73
- - `placed: [{ "file": "<original>", "target": "<placed-path>", "class": "<class>" }]`
74
-
75
- ## Next step
76
-
77
- 05-finalize-ingest
@@ -1,49 +0,0 @@
1
- ---
2
- name: docs-ingest-step-05-finalize-ingest
3
- description: Emit completion telemetry, mark the cluster complete, update current-state, and report the placement summary.
4
- ---
5
-
6
- # Step 05 — Finalize ingest
7
-
8
- ## Purpose
9
-
10
- Close out the ingest session cleanly. Emit telemetry. Write final state. Report.
11
-
12
- ## Actions
13
-
14
- 1. **Emit `docs-ingest-complete` telemetry** for each processed file.
15
-
16
- 2. **Update cluster manifest** (`.polaris/docs-ingest/<cluster-id>.json`):
17
- - `status: complete`
18
- - `completedAt: <ISO timestamp>`
19
-
20
- 3. **Update `current-state.json`**:
21
- - `status: complete`
22
- - `current_step_id: 05-finalize-ingest`
23
- - `completed_at: <ISO timestamp>`
24
-
25
- 4. **Report placement summary**:
26
- ```text
27
- **docs-ingest complete**
28
- Processed: <n> files
29
- Placed:
30
- <original> → <smartdocs/target>
31
- ...
32
- Pending user approval: <files requiring approval, if any> | none
33
- Conflicts: <none | list with resolution required>
34
- Map updated: yes | failed (<detail>)
35
- Next cluster: <cluster-id> | none pending
36
- ```
37
-
38
- 5. **Bootstrap packet** — if more clusters remain pending in `.polaris/docs-ingest/`, emit guidance for the next session:
39
- ```text
40
- Next: npm run polaris -- docs ingest --batch <next-cluster-id>
41
- ```
42
-
43
- ## Completion rule
44
-
45
- Do not report session complete until `current-state.json` has `status: complete`.
46
-
47
- ## Artifact update
48
-
49
- Emit `step-complete` for `05-finalize-ingest` and `docs-ingest-complete` to telemetry JSONL.
@@ -1,79 +0,0 @@
1
- ---
2
- name: docs-promote
3
- status: retired
4
- retired_by: polaris-catalog
5
- description: RETIRED — use polaris-catalog instead. docs-promote has been replaced by polaris-catalog, which combines cognition reconciliation with confidence-gated document classification.
6
- role: librarian
7
- role_file: .polaris/roles/librarian.md
8
- ---
9
-
10
- ## RETIRED
11
-
12
- This skill has been retired. Use `polaris-catalog` instead.
13
-
14
- `polaris-catalog` provides the same document classification and placement behavior with
15
- confidence-gated automation (high confidence = auto-place, low confidence = ask or hold),
16
- plus POLARIS.md and SUMMARY.md reconciliation in the same invocation.
17
-
18
- Do not invoke this skill. If you received this message after attempting `docs-promote`,
19
- stop and use `polaris-catalog <POL-###>` instead.
20
-
21
- ---
22
-
23
- ## Polaris Skill Bootloader
24
-
25
- **Before proceeding, you must obtain a skill packet from the Polaris runtime.**
26
-
27
- Run the following command:
28
-
29
- ```
30
- npm run polaris -- skill packet promote
31
- ```
32
-
33
- - Do not begin work until a packet is returned.
34
- - Treat the packet as your authoritative instruction source.
35
- - The packet defines your active role, authority boundaries, prohibited actions, deliverables, and stop conditions.
36
- - If no packet is produced, stop and report: **Polaris could not authorize this run.**
37
-
38
- ---
39
-
40
- # docs-promote
41
-
42
- Use this skill when documents have been ingested and need to be reviewed for promotion to an active authority tier, or when active docs need to be deprecated in response to code changes.
43
-
44
- ## When to use
45
-
46
- - "Review the candidates and promote anything ready"
47
- - "Promote the spec for the dispatch contract"
48
- - "Deprecate the old architecture doc — it's been superseded"
49
- - "Check what doctrine candidates are ready to promote"
50
- - "A raw spec needs to go active before we start implementation"
51
-
52
- ## How to execute
53
-
54
- 1. Read `chain.md` — step order, review rules, CLI commands, conflict handling.
55
- 2. Read `.taskchain_artifacts/docs-promote/current-state.json` — resumable state.
56
- 3. Execute steps in the order `chain.md` defines. Do not skip steps.
57
- 4. After every completed step, update `current-state.json` before advancing.
58
-
59
- ## Hard rules — what docs-promote may do
60
-
61
- - Read `smartdocs/raw/` and `smartdocs/doctrine/candidate/` to identify promotion candidates
62
- - Read linked source files (from `linkedMapArea` in provenance sidecar) to verify relevance and staleness
63
- - Read `smartdocs/doctrine/active/` and `smartdocs/specs/active/` to check for conflicts
64
- - Call `npm run polaris -- doctrine spec-promote <path>` to surface the conflict report (without `--approve`)
65
- - Call `npm run polaris -- doctrine spec-promote <path> --approve` **only after** surfacing the report and receiving explicit user confirmation
66
- - Call `npm run polaris -- doctrine promote <path>` for doctrine candidates that pass governance checks
67
- - Call `npm run polaris -- doctrine deprecate <path>` for active docs that are superseded or stale
68
- - Emit telemetry events
69
-
70
- ## Hard rules — what docs-promote must NOT do
71
-
72
- - Auto-promote without surfacing the conflict report first
73
- - Call `--approve` without explicit user confirmation in the session
74
- - Mutate source files (`src/`, tests, config)
75
- - Call `npm run polaris -- loop continue` or `npm run polaris -- finalize`
76
- - Promote to `architecture/` or `decisions/` — those require explicit ADR process
77
- - Suppress or ignore detected conflicts
78
-
79
- **Docs-promote reviews and surfaces. It does not promote silently or bypass the approval gate.**
@@ -1,25 +0,0 @@
1
- {
2
- "name": "docs-promote-chain",
3
- "steps": [
4
- "01-orient-promote",
5
- "02-review-candidates",
6
- "03-read-linked-code",
7
- "04-conflict-surface",
8
- "05-await-approval",
9
- "06-execute-promote-deprecate",
10
- "07-finalize-promote"
11
- ],
12
- "terminal_steps": ["07-finalize-promote"],
13
- "scope": "docs-promote-only",
14
- "forbidden_actions": [
15
- "src file mutations",
16
- "polaris loop continue",
17
- "polaris finalize",
18
- "git push",
19
- "pr creation",
20
- "spec-promote --approve without user confirmation in session",
21
- "doctrine promote without governance field check",
22
- "architecture/ writes",
23
- "decisions/ writes"
24
- ]
25
- }
@@ -1,80 +0,0 @@
1
- ---
2
- name: docs-promote-chain
3
- description: Route map for docs-promote — step order, CLI reference, canonical paths, run ID format, telemetry, and artifact authority. Step detail lives in steps/.
4
- ---
5
-
6
- # docs-promote 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 promotion readiness from conversation context.
13
-
14
- ## Step traversal order
15
-
16
- ```text
17
- 01-orient-promote
18
- 02-review-candidates
19
- 03-read-linked-code
20
- 04-conflict-surface
21
- 05-await-approval
22
- 06-execute-promote-deprecate
23
- 07-finalize-promote
24
- ```
25
-
26
- Read the current step's file in `steps/` before acting. Do not read ahead.
27
-
28
- ## CLI
29
-
30
- Always use the repo-local Polaris CLI:
31
-
32
- ```
33
- npm run polaris -- doctrine draft <path>
34
- npm run polaris -- doctrine promote <path>
35
- npm run polaris -- doctrine deprecate <path>
36
- npm run polaris -- doctrine spec-promote <path>
37
- npm run polaris -- doctrine spec-promote <path> --approve
38
- ```
39
-
40
- Never assume a globally linked `polaris` command exists.
41
-
42
- ## Canonical paths
43
-
44
- | State | Path |
45
- |---|---|
46
- | Drop zone | `smartdocs/raw/` |
47
- | Doctrine staging | `smartdocs/doctrine/candidate/` |
48
- | Active doctrine | `smartdocs/doctrine/active/` |
49
- | Deprecated doctrine | `smartdocs/doctrine/deprecated/` |
50
- | Active specs | `smartdocs/specs/active/` |
51
- | Implemented specs | `smartdocs/specs/implemented/` |
52
- | Superseded specs | `smartdocs/specs/superseded/` |
53
-
54
- ## Run ID format
55
-
56
- `docs-promote-<slug>-<YYYY-MM-DD>-<seq>` — e.g. `docs-promote-dispatch-contract-2026-05-29-001`
57
-
58
- ## Telemetry
59
-
60
- File: `.taskchain_artifacts/docs-promote/runs/<run-id>/telemetry.jsonl` (append-only).
61
-
62
- | Event | Trigger |
63
- |---|---|
64
- | `run-start` | Begin processing |
65
- | `step-complete` | End of every step |
66
- | `docs-promote-conflict-report` | Conflict check result per candidate |
67
- | `docs-promote-approved` | User approved a promotion |
68
- | `docs-promote-rejected` | User rejected a promotion |
69
- | `docs-promoted` | Successful promote/deprecate command |
70
- | `docs-promote-complete` | All candidates processed |
71
-
72
- Required fields: `event`, `run_id`, `timestamp`. Add `file` where applicable.
73
-
74
- ## Artifact authority
75
-
76
- `.taskchain_artifacts/docs-promote/current-state.json` is the sole authoritative live state surface.
77
-
78
- - Update after every completed step — before advancing.
79
- - A step is NOT complete until the state update succeeds.
80
- - If the update fails: stop and report the persistence failure.
@@ -1,53 +0,0 @@
1
- ---
2
- name: docs-promote-step-01-orient-promote
3
- description: Generate run_id, emit run-start telemetry, load candidate list, confirm canonical target.
4
- ---
5
-
6
- # Step 01 — Orient promote
7
-
8
- ## Purpose
9
-
10
- Establish bounded promotion context before touching any files. Confirm what to review, confirm the canonical target exists.
11
-
12
- ## Actions
13
-
14
- 1. **Generate `run_id`**: `docs-promote-<slug>-<YYYY-MM-DD>-<seq>`
15
- - Resumed runs: generate new `run_id` first, emit telemetry immediately, then read `current-state.json` for prior `run_id`.
16
-
17
- 2. **Emit `run-start` telemetry** — first I/O action:
18
- ```bash
19
- mkdir -p .taskchain_artifacts/docs-promote/runs/<run-id>
20
- echo '{"event":"run-start","run_id":"<run-id>","prior_run_id":null,"timestamp":"<ISO>"}' \
21
- >> .taskchain_artifacts/docs-promote/runs/<run-id>/telemetry.jsonl
22
- ```
23
- If this write fails: halt. Do not continue.
24
-
25
- 3. **Confirm canonical target** — verify `smartdocs/` exists. If not: halt and report.
26
-
27
- 4. **Restate working context** in under 6 bullets:
28
- - `run_id` and fresh/resumed
29
- - Candidates to review (raw/ + doctrine/candidate/)
30
- - Canonical target confirmed
31
-
32
- ## Scope
33
-
34
- ```yaml
35
- allowed_files:
36
- - .polaris/skills/docs-promote/chain.md
37
- - .taskchain_artifacts/docs-promote/current-state.json
38
- - .polaris/map/index.json
39
- stop_rules:
40
- - run-start telemetry write fails
41
- - smartdocs/ not found
42
- ```
43
-
44
- ## Artifact update
45
-
46
- Update `.taskchain_artifacts/docs-promote/current-state.json`:
47
- - `run_id`, `status: orienting`, `current_step_id: 01-orient-promote`, `updated_at`
48
-
49
- Emit `step-complete` for `01-orient-promote`.
50
-
51
- ## Next step
52
-
53
- 02-review-candidates
@@ -1,51 +0,0 @@
1
- ---
2
- name: docs-promote-step-02-review-candidates
3
- description: List promotion candidates from raw/ and doctrine/candidate/, read provenance sidecars, extract linkedMapArea.
4
- ---
5
-
6
- # Step 02 — Review candidates
7
-
8
- ## Purpose
9
-
10
- Build the candidate list. Read every co-located provenance sidecar to know what linked code area each doc is associated with.
11
-
12
- ## Actions
13
-
14
- 1. **List candidates**:
15
- - `smartdocs/raw/*.md`
16
- - `smartdocs/doctrine/candidate/*.md`
17
-
18
- 2. **For each candidate**, read `<filename>.provenance.json` if present. Extract:
19
- - `linkedMapArea` — code area this doc covers
20
- - `classifiedAs` — ingest classification
21
- - `ingestedAt` — when it was ingested
22
-
23
- 3. **Categorize** each candidate:
24
- - `spec-raw` → route: `spec-promote` gate
25
- - `doctrine-candidate` → route: doctrine governance check
26
- - No provenance → route: spec-promote gate (default)
27
-
28
- 4. If no candidates found: emit `step-complete`, update state with `candidates: []`, skip to step 07.
29
-
30
- ## Scope
31
-
32
- ```yaml
33
- allowed_files:
34
- - smartdocs/raw/ (read only)
35
- - smartdocs/doctrine/candidate/ (read only)
36
- - .taskchain_artifacts/docs-promote/current-state.json
37
- stop_rules:
38
- - directory read fails
39
- ```
40
-
41
- ## Artifact update
42
-
43
- Update `current-state.json`:
44
- - `current_step_id: 02-review-candidates`
45
- - `candidates: [{ file, classifiedAs, linkedMapArea, route }]`
46
-
47
- Emit `step-complete` for `02-review-candidates`.
48
-
49
- ## Next step
50
-
51
- 03-read-linked-code
@@ -1,50 +0,0 @@
1
- ---
2
- name: docs-promote-step-03-read-linked-code
3
- description: Read the linked source area for each candidate and assess whether the doc is current, stale, or superseded.
4
- ---
5
-
6
- # Step 03 — Read linked code
7
-
8
- ## Purpose
9
-
10
- Ground each candidate in the actual codebase. A doc that no longer matches its linked code area should not be promoted — it should be updated or discarded.
11
-
12
- ## Actions
13
-
14
- For each candidate with a `linkedMapArea`:
15
-
16
- 1. **Read the linked area**:
17
- - Read `<linkedMapArea>/POLARIS.md` if present
18
- - Read up to 3 key source files in the area (prefer files named in the doc)
19
-
20
- 2. **Assess relevance**:
21
- - `current` — doc accurately describes what the code does
22
- - `stale` — code has evolved; doc's assumptions are partially outdated
23
- - `superseded` — the area no longer exists or has been fully replaced
24
-
25
- 3. **Record findings** — one verdict per candidate with a brief rationale (≤2 sentences).
26
-
27
- For candidates with **no `linkedMapArea`**: mark as `unlinked` — cannot assess code relevance. Proceed; surface to user in step 05.
28
-
29
- ## Scope
30
-
31
- ```yaml
32
- allowed_files:
33
- - <linkedMapArea>/ (read only — POLARIS.md and up to 3 source files)
34
- - .polaris/map/index.json (read only)
35
- - .taskchain_artifacts/docs-promote/current-state.json
36
- stop_rules:
37
- - linked area not found in map (record as unlinked; do not halt)
38
- ```
39
-
40
- ## Artifact update
41
-
42
- Update `current-state.json`:
43
- - `current_step_id: 03-read-linked-code`
44
- - Per candidate: `relevance: current|stale|superseded|unlinked`, `relevance_rationale: "..."`
45
-
46
- Emit `step-complete` for `03-read-linked-code`.
47
-
48
- ## Next step
49
-
50
- 04-conflict-surface