@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
@@ -26,7 +26,7 @@ protocol.
26
26
  Run the following command:
27
27
 
28
28
  ```
29
- npm run polaris -- skill packet analyze
29
+ polaris skill packet analyze
30
30
  ```
31
31
 
32
32
  - Do not begin work until a packet is returned.
@@ -16,7 +16,7 @@ Query runtime state before acting. Do not infer analysis scope or prior progress
16
16
  Always use the repo-local Polaris CLI:
17
17
 
18
18
  ```
19
- npm run polaris -- <command>
19
+ polaris <command>
20
20
  ```
21
21
 
22
22
  Never assume a globally linked `polaris` command exists.
@@ -69,7 +69,7 @@ Telemetry file: `.taskchain_artifacts/polaris-analyze/runs/<run-id>/telemetry.js
69
69
  |---|---|---|
70
70
  | `run-start` | agent | 01 — before any Linear access |
71
71
  | `step-complete` | agent | end of every step |
72
- | `loop-aborted` | `npm run polaris -- loop abort` | any blocker halt |
72
+ | `loop-aborted` | `polaris loop abort` | any blocker halt |
73
73
 
74
74
  Required fields on every event: `event`, `run_id`, `timestamp`.
75
75
 
@@ -142,7 +142,7 @@ After updating issue bodies, verify the reconciled issues are packet-actionable:
142
142
 
143
143
  ```bash
144
144
  # Dry-run a polaris-run to check all preflight gates pass
145
- npm run polaris -- loop dispatch --dry-run <cluster-id>
145
+ polaris loop dispatch --dry-run <cluster-id>
146
146
  ```
147
147
 
148
148
  All children should pass body and scope preflight gates. If any fail,
@@ -19,7 +19,7 @@ version: "1.0"
19
19
 
20
20
  Provide targeted code intelligence when polaris-analyze needs to understand the affected code surface.
21
21
 
22
- This linked-skill governs use of the configured repo-analysis provider (e.g., GitNexus). If no provider is available, the fallback path (polaris map query + ripgrep + direct file inspection) is authoritative. See `docs/Polaris/spec/provider-capabilities.md` for the full provider model.
22
+ This linked-skill governs repository code-intelligence for polaris-analyze. The primary path is Polaris-native: `polaris graph query`, `polaris graph impact`, and `polaris map query`. If the Polaris graph is unavailable or stale, fall back to `rg` (ripgrep) plus direct file inspection. See `docs/Polaris/spec/provider-capabilities.md` for the full provider model.
23
23
 
24
24
  ---
25
25
 
@@ -44,9 +44,8 @@ This linked-skill governs use of the configured repo-analysis provider (e.g., Gi
44
44
 
45
45
  ## Provider detection
46
46
 
47
- At step 01, check `polaris.config.json` for `providers.repoAnalysis.preferred`.
48
- If a provider is configured and available in the session environment: use it.
49
- If unavailable or not configured: note `repo_analysis_status: not-configured` in artifact and proceed with fallback.
47
+ At step 01, attempt `polaris graph query` to orient to the code surface. If the graph index is current, use it as primary.
48
+ If the graph is unavailable or returns stale results: note `repo_analysis_status: graph-unavailable` in artifact and proceed with `rg` + direct inspection fallback.
50
49
 
51
50
  ---
52
51
 
@@ -36,11 +36,11 @@ stop_rules:
36
36
  1. Check `repo_analysis_status` from the step 01 artifact.
37
37
  2. **If provider is available:** use it for targeted inspection only — query concepts relevant to the issue scope. Use impact analysis and context queries for specific symbols mentioned in the issue. Do not summarize the whole repo.
38
38
  3. **If provider is unavailable (fallback path):**
39
- - Use `npm run polaris -- map query <path>` for route/domain/taskchain context on affected files
39
+ - Use `polaris map query <path>` for route/domain/taskchain context on affected files
40
40
  - Use `rg <symbol>` for symbol and pattern location across the repo
41
41
  - Use direct file inspection for implementation details
42
42
  - The fallback path is always sufficient to complete the analysis.
43
- 4. Always run `npm run polaris -- map query <path>` for each affected file — it provides Polaris-specific routing context regardless of whether a provider is also in use.
43
+ 4. Always run `polaris map query <path>` for each affected file — it provides Polaris-specific routing context regardless of whether a provider is also in use.
44
44
  5. Inspect only files relevant to the issue scope.
45
45
  6. Record the files and execution flows inspected.
46
46
 
@@ -11,7 +11,7 @@ role: librarian
11
11
  Run the following command:
12
12
 
13
13
  ```bash
14
- npm run polaris -- skill packet catalog
14
+ polaris skill packet catalog
15
15
  ```
16
16
 
17
17
  - Do not begin work until a packet is returned.
@@ -56,16 +56,16 @@ The `packet.unattended` flag controls which low-confidence behavior applies.
56
56
  - Read packet-specified folders and their POLARIS.md and SUMMARY.md files
57
57
  - Write POLARIS.md and SUMMARY.md files within `packet.allowed_write_paths`
58
58
  - Read `smartdocs/raw/` to enumerate documents for classification
59
- - Call `npm run polaris -- docs ingest --file <path>` to place classified documents
60
- - Call `npm run polaris -- doctrine draft <path>` for doctrine candidates
61
- - Call `npm run polaris -- map update --changed` after batch placement
59
+ - Call `polaris docs ingest --file <path>` to place classified documents
60
+ - Call `polaris doctrine draft <path>` for doctrine candidates
61
+ - Call `polaris map update --changed` after batch placement
62
62
  - Create a single sealed git commit of all cognition and doc changes
63
63
 
64
64
  ## Hard rules — what polaris-catalog must NOT do
65
65
 
66
66
  - Modify implementation source code (`src/`, tests, config)
67
67
  - Modify runtime state files outside this skill's owned artifacts (cluster-state, other skills' `.taskchain_artifacts/` state, or non-catalog telemetry)
68
- - Call `npm run polaris -- loop continue` or `npm run polaris -- finalize`
68
+ - Call `polaris loop continue` or `polaris finalize`
69
69
  - Write to `packet.prohibited_write_paths`
70
70
  - Git push or create PRs
71
71
  - Auto-place low-confidence files (always leave in raw or ask)
@@ -29,9 +29,9 @@ Read the current step's file in `steps/` before acting. Do not read ahead.
29
29
  Always use the repo-local Polaris CLI:
30
30
 
31
31
  ```
32
- npm run polaris -- docs ingest --file <path>
33
- npm run polaris -- doctrine draft <path>
34
- npm run polaris -- map update --changed
32
+ polaris docs ingest --file <path>
33
+ polaris doctrine draft <path>
34
+ polaris map update --changed
35
35
  ```
36
36
 
37
37
  Never assume a globally linked `polaris` command exists.
@@ -57,10 +57,10 @@ Run the appropriate CLI command immediately. Do not pause for user input.
57
57
 
58
58
  ```bash
59
59
  # All classes except doctrine-candidate:
60
- npm run polaris -- docs ingest --file <path>
60
+ polaris docs ingest --file <path>
61
61
 
62
62
  # doctrine-candidate:
63
- npm run polaris -- doctrine draft <path>
63
+ polaris doctrine draft <path>
64
64
  ```
65
65
 
66
66
  Record in `docs_placed`.
@@ -92,7 +92,7 @@ Do not fail the run.
92
92
  Run map update:
93
93
 
94
94
  ```bash
95
- npm run polaris -- map update --changed
95
+ polaris map update --changed
96
96
  ```
97
97
 
98
98
  ## Hard rules
@@ -11,7 +11,7 @@ role: librarian
11
11
  Run the following command:
12
12
 
13
13
  ```bash
14
- npm run polaris -- skill packet reconcile
14
+ polaris skill packet reconcile
15
15
  ```
16
16
 
17
17
  - Do not begin work until a packet is returned.
@@ -52,7 +52,7 @@ at cluster closeout.
52
52
  - Modify implementation source code (`src/`, tests, config)
53
53
  - Modify runtime state files outside this skill's owned artifacts (cluster-state, other skills' `.taskchain_artifacts/` state, or non-reconcile telemetry)
54
54
  - Move, ingest, classify, or promote documents
55
- - Call `npm run polaris -- loop continue` or `npm run polaris -- finalize`
55
+ - Call `polaris loop continue` or `polaris finalize`
56
56
  - Write to `packet.prohibited_write_paths`
57
57
  - Git push or create PRs
58
58
 
@@ -30,7 +30,7 @@ here because finalization is part of the run lifecycle governed by this skill. S
30
30
  Run the following command:
31
31
 
32
32
  ```
33
- npm run polaris -- skill packet run
33
+ polaris skill packet run
34
34
  ```
35
35
 
36
36
  - Do not begin work until a packet is returned.
@@ -60,7 +60,7 @@ This gate enforces the thin-parent model: the Foreman is a scheduler, not a cons
60
60
  Always use the repo-local Polaris CLI:
61
61
 
62
62
  ```
63
- npm run polaris -- <command>
63
+ polaris <command>
64
64
  ```
65
65
 
66
66
  Never assume a globally linked `polaris` command exists.
@@ -86,14 +86,14 @@ At each worker return boundary (step 07), apply the CHECKPOINT gate before proce
86
86
 
87
87
  1. Accept and discard worker output except the CompactReturn JSON object — all other session content is discarded.
88
88
  2. Parse the CompactReturn JSON. If it is missing or malformed, treat as a blocker and stop.
89
- 3. Pass the CompactReturn JSON to `npm run polaris -- loop continue` for state persistence.
89
+ 3. Pass the CompactReturn JSON to `polaris loop continue` for state persistence.
90
90
  4. Preserve the existing step order — do not reorder, skip, or repeat steps based on worker output content.
91
91
 
92
92
  ## Continuation rules
93
93
 
94
94
  After step 07 evaluates the session:
95
95
 
96
- - **DISPATCH (all remaining children)**: run `npm run polaris -- loop run <cluster-id>`. The runtime dispatches all eligible children serially, enforcing dispatch boundaries internally. The Foreman waits for the subprocess to exit. Progress signals are emitted as `[POLARIS] RUNNING <child-id> (N/M)` and `[POLARIS] COMPLETE <child-id> (commit: <sha>)`. No per-child CompactReturn handling or state repair is needed — the runtime owns that boundary.
96
+ - **DISPATCH (all remaining children)**: run `polaris loop run <cluster-id>`. The runtime dispatches all eligible children serially, enforcing dispatch boundaries internally. The Foreman waits for the subprocess to exit. Progress signals are emitted as `[POLARIS] RUNNING <child-id> (N/M)` and `[POLARIS] COMPLETE <child-id> (commit: <sha>)`. No per-child CompactReturn handling or state repair is needed — the runtime owns that boundary.
97
97
  - **STOP (blocked)**: halt immediately on blocker. Report unblock condition.
98
98
  - **STOP (all-done, awaiting delivery)**: `loop run` exits when all children are done. Report branch and last commit. Provide delivery command: `Use polaris-run on <PARENT-ID>. Finalize delivery.`
99
99
  - **DELIVER**: proceed to step 08 (Closeout Librarian) only when all children are Done and the user explicitly requests delivery in this session invocation.
@@ -172,7 +172,7 @@ This is not advisory. The runtime will hard-fail with `process.exit(1)` on viola
172
172
  ### Allowed transition (only legal path)
173
173
 
174
174
  ```
175
- Foreman → npm run polaris -- loop run <cluster-id>
175
+ Foreman → polaris loop run <cluster-id>
176
176
  ↓ (subprocess)
177
177
  runtime selects child
178
178
  runtime dispatches worker externally
@@ -202,14 +202,14 @@ polaris-run uses these Polaris CLI calls:
202
202
 
203
203
  | Step | Polaris call | Purpose |
204
204
  |---|---|---|
205
- | 07 | `npm run polaris -- loop run <cluster-id>` | Run all eligible children serially; emits `[POLARIS] RUNNING <child> (N/M)` per child and `[POLARIS] COMPLETE <child> (commit: <sha>)` on completion; exits when cluster-complete or blocked |
206
- | 08 | `npm run polaris -- medic packet <cluster-id>` | Generate Medic packet for failed worker result (if triage required) |
205
+ | 07 | `polaris loop run <cluster-id>` | Run all eligible children serially; emits `[POLARIS] RUNNING <child> (N/M)` per child and `[POLARIS] COMPLETE <child> (commit: <sha>)` on completion; exits when cluster-complete or blocked |
206
+ | 08 | `polaris medic packet <cluster-id>` | Generate Medic packet for failed worker result (if triage required) |
207
207
  | 08 | Medic subagent dispatch | Dispatch Medic; wait for sealed result; validate result before proceeding |
208
- | 09 | `npm run polaris -- librarian packet <cluster-id>` | Generate Closeout Librarian packet for the completed cluster |
208
+ | 09 | `polaris librarian packet <cluster-id>` | Generate Closeout Librarian packet for the completed cluster |
209
209
  | 09 | Librarian subagent dispatch | Dispatch Closeout Librarian; wait for sealed result; validate result before proceeding |
210
- | 10 | `npm run polaris -- finalize` | Push branch (including librarian commit), open PR, append JSONL closeout events, archive run snapshot |
210
+ | 10 | `polaris finalize` | Push branch (including librarian commit), open PR, append JSONL closeout events, archive run snapshot |
211
211
 
212
- `npm run polaris -- loop run <cluster-id>` is the standard execution command. It internally manages the dispatch→checkpoint loop for all children, emitting terse progress signals the Foreman can monitor. The Foreman does not call `loop dispatch` or `loop continue` — those boundaries are owned by `loop run`.
212
+ `polaris loop run <cluster-id>` is the standard execution command. It internally manages the dispatch→checkpoint loop for all children, emitting terse progress signals the Foreman can monitor. The Foreman does not call `loop dispatch` or `loop continue` — those boundaries are owned by `loop run`.
213
213
 
214
214
  ## Context budget
215
215
 
@@ -239,15 +239,15 @@ Telemetry file: `.taskchain_artifacts/polaris-run/runs/<run-id>/telemetry.jsonl`
239
239
  | Event | Emitted by | Step |
240
240
  |---|---|---|
241
241
  | `run-start` | agent | 01 — before any Linear access |
242
- | `child-dispatched` | `npm run polaris -- loop dispatch` | 07 — when one child is accepted by the execution adapter |
242
+ | `child-dispatched` | `polaris loop dispatch` | 07 — when one child is accepted by the execution adapter |
243
243
  | `child-complete` | parent runtime | 07 — after worker return validation and completion recording |
244
- | `loop-checkpoint` | `npm run polaris -- loop continue` | 07 — after each child |
245
- | `analyze-impl-boundary-enforced` | `npm run polaris -- loop continue` | 07 — blocker/state-repair boundary event only |
246
- | `loop-aborted` | `npm run polaris -- loop abort` | any blocker halt |
244
+ | `loop-checkpoint` | `polaris loop continue` | 07 — after each child |
245
+ | `analyze-impl-boundary-enforced` | `polaris loop continue` | 07 — blocker/state-repair boundary event only |
246
+ | `loop-aborted` | `polaris loop abort` | any blocker halt |
247
247
  | `medic-dispatched` | parent runtime | 08 — when Medic is dispatched for failed worker |
248
248
  | `medic-complete` | parent runtime | 08 — after Medic returns sealed result |
249
- | `pr-opened` | `npm run polaris -- finalize` | 10 |
250
- | `run-complete` | `npm run polaris -- finalize` | 10 |
249
+ | `pr-opened` | `polaris finalize` | 10 |
250
+ | `run-complete` | `polaris finalize` | 10 |
251
251
 
252
252
  Required fields on every event: `event`, `run_id`, `timestamp`.
253
253
 
@@ -255,14 +255,14 @@ Required fields on every event: `event`, `run_id`, `timestamp`.
255
255
 
256
256
  `.taskchain_artifacts/polaris-run/current-state.json` is the sole authoritative live state surface.
257
257
 
258
- - Update only at explicit checkpoint boundaries via `npm run polaris -- loop continue` after worker returns, or when DISPATCH boundaries mandate bootstrapping.
258
+ - Update only at explicit checkpoint boundaries via `polaris loop continue` after worker returns, or when DISPATCH boundaries mandate bootstrapping.
259
259
  - Parent agents must not update state inline between steps.
260
260
  - If the checkpoint fails: stop and report the persistence failure.
261
261
 
262
262
  ## Machine snapshot
263
263
 
264
264
  - **Path**: `.taskchain_artifacts/polaris-run/current-state.json`
265
- - **Update requirement**: only at checkpoint boundaries (via `npm run polaris -- loop continue`)
265
+ - **Update requirement**: only at checkpoint boundaries (via `polaris loop continue`)
266
266
  - **Purpose**: fast agent resume without replaying JSONL or markdown history
267
267
 
268
268
  ## Completion rule
@@ -21,7 +21,7 @@ version: "1.0"
21
21
 
22
22
  Provide targeted code intelligence and impact checks when polaris-run needs repository graph context.
23
23
 
24
- This linked-skill governs use of the configured repo-analysis provider (e.g., GitNexus). If no provider is available, the fallback path (polaris map query + ripgrep + direct file inspection) is authoritative. See `docs/Polaris/spec/provider-capabilities.md` for the full provider model.
24
+ This linked-skill governs repository code-intelligence for polaris-run. The primary path is Polaris-native: `polaris graph query`, `polaris graph impact`, and `polaris map query`. If the Polaris graph is unavailable or stale, fall back to `rg` (ripgrep) plus direct file inspection. See `docs/Polaris/spec/provider-capabilities.md` for the full provider model.
25
25
 
26
26
  ---
27
27
 
@@ -47,9 +47,8 @@ This linked-skill governs use of the configured repo-analysis provider (e.g., Gi
47
47
 
48
48
  ## Provider detection
49
49
 
50
- At step 01, check `polaris.config.json` for `providers.repoAnalysis.preferred`.
51
- If a provider is configured and available in the session environment: use it.
52
- If unavailable or not configured: note `repo_analysis_status: not-configured` in artifact and proceed with fallback.
50
+ At step 01, attempt `polaris graph query` to orient to the code surface. If the graph index is current, use it as primary.
51
+ If the graph is unavailable or returns stale results: note `repo_analysis_status: graph-unavailable` in artifact and proceed with `rg` + direct inspection fallback.
53
52
 
54
53
  ---
55
54
 
@@ -24,7 +24,7 @@ allowed_routes:
24
24
  allowed_skills:
25
25
  - repo-analysis
26
26
  expected_evidence:
27
- - runtime state queried via npm run polaris -- loop status
27
+ - runtime state queried via polaris loop status
28
28
  - run_id generated or read from prior state
29
29
  - run-start telemetry emitted
30
30
  - Linear parent and children fetched
@@ -40,7 +40,7 @@ stop_rules:
40
40
  ## Actions
41
41
 
42
42
  0. **Query runtime state**:
43
- Run `npm run polaris -- loop status` to check for existing session state.
43
+ Run `polaris loop status` to check for existing session state.
44
44
  - **Follow-up run** (state exists and is active for this cluster): read `cluster_id` and step context from runtime output. Mint a new `run_id` in `polaris-run-<slug>-<date>-<seq>` format (see `chain.md` for format rules) — do not reuse the prior `run_id`. Set `related_run_id` to the prior `run_id` read from runtime output. Runtime state is authoritative — do not infer session context from chat history.
45
45
  - **Fresh run** (no state file, or state belongs to a different cluster): generate new `run_id` in format `polaris-run-<slug>-<date>-<seq>` (see `chain.md` for format rules). `related_run_id` is `null`.
46
46
 
@@ -74,7 +74,7 @@ stop_rules:
74
74
  - Any blockers visible at this stage
75
75
  - Execution boundary (one parent cluster, this session)
76
76
 
77
- 6. Invoke `npm run polaris -- loop status` to confirm runtime state is consistent before advancing to the next step.
77
+ 6. Invoke `polaris loop status` to confirm runtime state is consistent before advancing to the next step.
78
78
 
79
79
  ## Artifact update
80
80
 
@@ -41,7 +41,7 @@ stop_rules:
41
41
  - Do not push. Do not create a PR.
42
42
  5. If clusters.json exists, use it to determine execution order and dependencies. If absent, use the child issue ordering from Linear (lowest-numbered first) as a last-resort fallback — do not improvise ordering from chat reasoning or assumptions.
43
43
  6. Verify the selected child is not blocked in Linear. If blocked:
44
- - Run `npm run polaris -- loop abort "<reason>"`.
44
+ - Run `polaris loop abort "<reason>"`.
45
45
  - Report blocked state and halt. Do not skip to a later child.
46
46
  7. Set the selected child as `active_child`.
47
47
 
@@ -42,12 +42,12 @@ stop_rules:
42
42
  Followed by: what was done, commit hash, validation result from step 05.
43
43
  4. Mark the child Done in Linear **only if** its acceptance criteria are satisfied.
44
44
  - If criteria are not met: leave the child open, add a comment with the gap, treat as blocked.
45
- 5. Do not run `npm run polaris -- map update --changed` per child. Map update belongs at final delivery/session end unless runtime requirements explicitly override this.
45
+ 5. Do not run `polaris map update --changed` per child. Map update belongs at final delivery/session end unless runtime requirements explicitly override this.
46
46
 
47
47
  ## Blocker escalation
48
48
 
49
49
  If the child cannot be marked Done:
50
- - Run `npm run polaris -- loop abort "<reason>"`.
50
+ - Run `polaris loop abort "<reason>"`.
51
51
  - Add a comment with the unblock condition.
52
52
  - Halt. Do not continue to the next child.
53
53
 
@@ -21,7 +21,7 @@ allowed_routes:
21
21
  - CLAUDE.md
22
22
  - .polaris/skills/polaris-run/chain.md
23
23
  expected_evidence:
24
- - npm run polaris -- loop run executed
24
+ - polaris loop run executed
25
25
  - RUNNING <child-id> (N/M) signal emitted per child
26
26
  - COMPLETE <child-id> (commit: <sha>) signal emitted per child
27
27
  - COMPLETE (cluster-complete) or blocked exit recorded
@@ -36,7 +36,7 @@ stop_rules:
36
36
  Run the batch dispatch loop:
37
37
 
38
38
  ```bash
39
- npm run polaris -- loop run <cluster-id>
39
+ polaris loop run <cluster-id>
40
40
  ```
41
41
 
42
42
  The runtime manages everything internally: child selection, packet compilation, provider dispatch
@@ -61,7 +61,7 @@ by the Foreman is needed. When `loop run` exits 0 with `cluster-complete`, proce
61
61
  If `loop run` exits non-zero:
62
62
  - Report the blocker and unblock condition from the output.
63
63
  - Do not push. Do not create a PR.
64
- - Resume instruction: resolve the blocker then run `npm run polaris -- loop run <cluster-id>`.
64
+ - Resume instruction: resolve the blocker then run `polaris loop run <cluster-id>`.
65
65
 
66
66
  ### STOP (all-done, awaiting delivery)
67
67
 
@@ -41,7 +41,7 @@ The Foreman does NOT:
41
41
 
42
42
  Run:
43
43
  ```bash
44
- npm run polaris -- librarian packet <cluster-id>
44
+ polaris librarian packet <cluster-id>
45
45
  ```
46
46
 
47
47
  This generates a `CloseoutLibrarianPacket` at:
@@ -44,9 +44,9 @@ stop_rules:
44
44
  2. Verify the working tree is clean.
45
45
  3. Run:
46
46
  ```bash
47
- npm run polaris -- finalize run
47
+ polaris finalize run
48
48
  ```
49
- `npm run polaris -- finalize run` executes the full 12-step sequence:
49
+ `polaris finalize run` executes the full 12-step sequence:
50
50
  - Validates the Polaris map
51
51
  - Validates `current-state.json` schema
52
52
  - Runs targeted checks
@@ -52,7 +52,7 @@ stop_rules:
52
52
  3. Verify the working tree is clean.
53
53
  4. Run:
54
54
  ```bash
55
- npm run polaris -- map index && npm run polaris -- finalize run --state-file .taskchain_artifacts/polaris-run/current-state.json
55
+ polaris map index && polaris finalize run --state-file .taskchain_artifacts/polaris-run/current-state.json
56
56
  ```
57
57
 
58
58
  `map index` rebuilds the atlas so finalize has accurate route data. `finalize run` then executes the full finalize sequence:
@@ -25,7 +25,7 @@ npm install -g polaris
25
25
  ### Verify
26
26
 
27
27
  ```bash
28
- npm run polaris -- --version
28
+ polaris --version
29
29
  ```
30
30
 
31
31
  If the binary is not found, the skill will attempt `npx --no-install polaris` as a fallback. If that also fails, the tool returns a clear error with install instructions.
@@ -0,0 +1,169 @@
1
+ # Polaris Rules
2
+
3
+ > This file is the single shared governance source for this Polaris-managed repository.
4
+ > Agent files (AGENTS.md, CLAUDE.md, etc.) are pointers to this file.
5
+ > This file is SmartDocs-ignored; it is bootstrap governance, not doctrine.
6
+
7
+ ## Repository Overview
8
+
9
+ {{REPO_OVERVIEW}}
10
+
11
+ ---
12
+
13
+ ## Temporary Worker Doctrine
14
+
15
+ Every model instance is a temporary occupant of a durable role. Roles persist;
16
+ model instances are disposable.
17
+
18
+ A worker should arrive at a task knowing only:
19
+
20
+ - what job it is doing
21
+ - what files it may touch
22
+ - what route governs the work
23
+ - what validation proves completion
24
+
25
+ If a worker requires broad repository context, the cognition structure has
26
+ failed, not the worker.
27
+
28
+ ---
29
+
30
+ ## Repository Memory Doctrine
31
+
32
+ Polaris stores institutional memory in repository artifacts rather than model
33
+ memory. Knowledge should be discoverable through navigation, route cognition,
34
+ SmartDocs, summaries, commits, telemetry, and runtime artifacts.
35
+
36
+ Workers should not rely on persistent model memory to perform assigned work.
37
+
38
+ ---
39
+
40
+ ## Navigation Before Retrieval
41
+
42
+ Links are retrieval paths, not reading assignments.
43
+
44
+ Workers should not read doctrine, charts, or supporting documents merely because
45
+ they exist.
46
+
47
+ Expected behavior:
48
+
49
+ 1. Attempt work
50
+ 2. Encounter problem
51
+ 3. Check local guidance
52
+ 4. Match symptom
53
+ 5. Retrieve relevant artifact
54
+ 6. Continue
55
+
56
+ Never preload all linked documents.
57
+ Never load all doctrine.
58
+ Never load all charts.
59
+
60
+ Navigation precedes retrieval.
61
+ Retrieval precedes loading.
62
+
63
+ ---
64
+
65
+ ## Skill Command Routing
66
+
67
+ When a Polaris skill command is received, load the skill packet before any other
68
+ action. Full routing table: `.polaris/skills/ROUTING.md`
69
+
70
+ Recognized command forms use `<CLUSTER-ID>` as the work identifier:
71
+
72
+ - `polaris-analyze <CLUSTER-ID>` / `run polaris-analyze on [issue] <CLUSTER-ID>`
73
+ - `polaris-run <CLUSTER-ID>` / `run polaris-run on [issue] <CLUSTER-ID>`
74
+ - `polaris-finalize` / `run polaris-finalize`
75
+ - `polaris-status` / `run polaris-status`
76
+ - `docs-ingest` / `run docs-ingest`
77
+ - `docs-review` / `run docs-review`
78
+ - `docs-triage` / `run docs-triage`
79
+ - `polaris-reconcile <CLUSTER-ID>` / `run polaris-reconcile on [issue] <CLUSTER-ID>`
80
+ - `polaris-catalog <CLUSTER-ID>` / `run polaris-catalog on [issue] <CLUSTER-ID>`
81
+
82
+ When a recognized command is received:
83
+
84
+ 1. Look up the target skill in `.polaris/skills/ROUTING.md`
85
+ 2. Read `.polaris/skills/<target-skill>/SKILL.md` first — before any repo inspection
86
+ 3. Run the bootloader command to obtain the runtime packet
87
+ 4. Execute the skill's `chain.md` in strict step order
88
+
89
+ ---
90
+
91
+ ## Map-Query Rule
92
+
93
+ The map is runtime infrastructure. Query results are model context.
94
+
95
+ **Agents may query the map. Agents may not consume map artifacts.**
96
+
97
+ Use:
98
+
99
+ ```sh
100
+ polaris map query <path>
101
+ ```
102
+
103
+ Never read these files directly:
104
+
105
+ - `.polaris/map/file-routes.json`
106
+ - `.polaris/map/index.json`
107
+ - `.polaris/map/needs-review.json`
108
+
109
+ These paths appear only in prohibition lists.
110
+
111
+ ---
112
+
113
+ ## Graph Navigation
114
+
115
+ Polaris maintains a code-intelligence graph for this repository.
116
+ Use Polaris graph commands as the primary code-intelligence path.
117
+ Fall back to `rg` (ripgrep) and direct file inspection when the graph is unavailable.
118
+
119
+ Primary commands:
120
+
121
+ ```sh
122
+ polaris graph build
123
+ polaris graph query <symbol-or-file>
124
+ polaris graph impact <symbol-or-file>
125
+ polaris map query <path>
126
+ ```
127
+
128
+ Fallback (graph unavailable):
129
+ - `rg <pattern>` for symbol and pattern search
130
+ - Direct file inspection for structure and content
131
+
132
+ Never prefer an external repo-analysis tool over Polaris graph for Polaris-managed repos.
133
+
134
+ ---
135
+
136
+ ## Tracker-Agnostic Work Intake
137
+
138
+ Work identifiers are opaque to the model. Polaris is tracker-agnostic.
139
+
140
+ Work may originate from Linear, GitHub, a SmartDocs spec, a local work contract,
141
+ a manual prompt, or a future provider. The runtime resolves identifiers. The
142
+ model does not interpret or construct cluster identifiers.
143
+
144
+ ---
145
+
146
+ ## Runtime Boundaries
147
+
148
+ - Resolve execution state before beginning work
149
+ - Follow the active cluster and child ordering
150
+ - Execute only the currently assigned child
151
+ - Do not expand scope outside the assigned child
152
+ - If blocked, stop and report the unblock condition
153
+ - Foreman orchestrates; Worker implements; Librarian reconciles
154
+ - A provider may occupy multiple roles, but role authority does not merge
155
+
156
+ ---
157
+
158
+ ## Canon Discovery
159
+
160
+ Project canon is route-local.
161
+
162
+ Use:
163
+
164
+ - `POLARIS.md` in the relevant route folder for operational guidance
165
+ - `SUMMARY.md` in the relevant route folder for informational context
166
+ - `polaris map query <path>` for route and ownership resolution
167
+ - Runtime state artifacts for execution state and resume handling
168
+
169
+ Do not assume global repository context unless explicitly provided by the runtime.
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@lsctech/polaris",
3
- "version": "0.3.21",
3
+ "version": "0.3.23",
4
4
  "description": "Polaris — standalone taskchain orchestration framework for governed AI agent workflows",
5
5
  "bin": {
6
+ "polaris": "dist/cli/index.js",
6
7
  "polaris-cli": "dist/cli/index.js"
7
8
  },
8
9
  "main": "dist/index.js",
@@ -21,7 +22,7 @@
21
22
  "node": ">=22.0.0"
22
23
  },
23
24
  "scripts": {
24
- "build": "tsc && cp -r src/workspace dist/workspace",
25
+ "build": "tsc && rm -rf dist/workspace && cp -r src/workspace dist/workspace",
25
26
  "lint": "tsc --noEmit",
26
27
  "typecheck": "tsc --noEmit --project tsconfig.typecheck.json",
27
28
  "test": "vitest run",
@@ -1,38 +0,0 @@
1
- ---
2
- role: analyst
3
- version: 1
4
- ---
5
-
6
- # Analyst Role
7
-
8
- The Analyst maps issues to code, assesses feasibility, and produces execution plans. It does not implement or dispatch workers.
9
-
10
- ## Responsibilities
11
-
12
- - Fetch issue from tracker and parse scope
13
- - Map relevant code files for the issue
14
- - Assess feasibility, detect blockers
15
- - Produce clusters.json defining child issues
16
- - Write analysis documents to `smartdocs/docs/raw/`
17
- - Create an "Implementation" parent Linear issue and corresponding child issues.
18
- - Ensure the "Implementation" parent is itself a child of the issue being analyzed.
19
-
20
- ## Authority Boundaries
21
-
22
- - Read: full repo (read-only)
23
- - Write: `smartdocs/docs/raw/`, `.polaris/clusters/<id>/clusters.json`
24
- - May create Linear issues: Yes
25
- - May implement: No
26
- - May dispatch: No
27
-
28
- ## Prohibited Actions
29
-
30
- - Source code mutation
31
- - `polaris loop dispatch` or `polaris loop continue`
32
- - PR creation
33
- - Promoting docs to `specs/active/` or `doctrine/active/` (that is Librarian's role)
34
-
35
- ## Escalation Rules
36
-
37
- - Blocked issue (missing dependency, unclear scope) → stop, write blocker report, do not create plan
38
- - Non-executable issue (already done, wrong type) → report and stop