@lsctech/polaris 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/adopt-assets.js +187 -0
- package/dist/cli/adopt-cognition.js +1 -2
- package/dist/cli/adopt-genesis.js +84 -0
- package/dist/cli/adopt-instructions.js +1 -2
- package/dist/cli/adopt-report.js +67 -0
- package/dist/cli/adopt-workspace.js +114 -0
- package/dist/cli/adoption-plan.js +11 -0
- package/dist/cli/init.js +79 -7
- package/dist/governance/authority-risk.js +56 -0
- package/dist/governance/index.js +12 -0
- package/dist/governance/review-packet.js +114 -0
- package/dist/governance/routing.js +63 -0
- package/dist/governance/types.js +8 -0
- package/dist/smartdocs-engine/index.js +16 -2
- package/dist/smartdocs-engine/ingest.js +146 -13
- package/dist/workspace/.polaris/roles/analyst.md +38 -0
- package/dist/workspace/.polaris/roles/closeout-librarian.md +122 -0
- package/dist/workspace/.polaris/roles/cognition-librarian.md +37 -0
- package/dist/workspace/.polaris/roles/finalizer.md +45 -0
- package/dist/workspace/.polaris/roles/foreman.md +165 -0
- package/dist/workspace/.polaris/roles/librarian.md +74 -0
- package/dist/workspace/.polaris/roles/worker.md +119 -0
- package/dist/workspace/.polaris/session-type +1 -0
- package/dist/workspace/.polaris/skills/ROUTING.md +109 -0
- package/dist/workspace/.polaris/skills/caveman/SKILL.md +74 -0
- package/dist/workspace/.polaris/skills/caveman-compress/scripts/compress.py +272 -0
- package/dist/workspace/.polaris/skills/closeout-librarian/POLARIS.md +46 -0
- package/dist/workspace/.polaris/skills/closeout-librarian/SKILL.md +59 -0
- package/dist/workspace/.polaris/skills/closeout-librarian/chain.md +116 -0
- package/dist/workspace/.polaris/skills/closeout-librarian/steps/01-load-cluster-context.md +78 -0
- package/dist/workspace/.polaris/skills/closeout-librarian/steps/02-drift-reconciliation.md +157 -0
- package/dist/workspace/.polaris/skills/closeout-librarian/steps/03-reconcile-polaris-md.md +93 -0
- package/dist/workspace/.polaris/skills/closeout-librarian/steps/04-reconcile-summary-md.md +106 -0
- package/dist/workspace/.polaris/skills/closeout-librarian/steps/05-doc-ingestion.md +114 -0
- package/dist/workspace/.polaris/skills/closeout-librarian/steps/06-link-validation.md +128 -0
- package/dist/workspace/.polaris/skills/closeout-librarian/steps/07-yaml-linking.md +95 -0
- package/dist/workspace/.polaris/skills/closeout-librarian/steps/08-librarian-commit.md +119 -0
- package/dist/workspace/.polaris/skills/closeout-librarian/steps/09-sealed-result.md +118 -0
- package/dist/workspace/.polaris/skills/docs-ingest/SKILL.md +68 -0
- package/dist/workspace/.polaris/skills/docs-ingest/chain.json +23 -0
- package/dist/workspace/.polaris/skills/docs-ingest/chain.md +149 -0
- package/dist/workspace/.polaris/skills/docs-ingest/steps/01-orient-ingest.md +85 -0
- package/dist/workspace/.polaris/skills/docs-ingest/steps/02-classify-batch.md +87 -0
- package/dist/workspace/.polaris/skills/docs-ingest/steps/03-conflict-check.md +66 -0
- package/dist/workspace/.polaris/skills/docs-ingest/steps/04-place-and-link.md +77 -0
- package/dist/workspace/.polaris/skills/docs-ingest/steps/05-finalize-ingest.md +49 -0
- package/dist/workspace/.polaris/skills/docs-promote/SKILL.md +79 -0
- package/dist/workspace/.polaris/skills/docs-promote/chain.json +25 -0
- package/dist/workspace/.polaris/skills/docs-promote/chain.md +80 -0
- package/dist/workspace/.polaris/skills/docs-promote/steps/01-orient-promote.md +53 -0
- package/dist/workspace/.polaris/skills/docs-promote/steps/02-review-candidates.md +51 -0
- package/dist/workspace/.polaris/skills/docs-promote/steps/03-read-linked-code.md +50 -0
- package/dist/workspace/.polaris/skills/docs-promote/steps/04-conflict-surface.md +65 -0
- package/dist/workspace/.polaris/skills/docs-promote/steps/05-await-approval.md +61 -0
- package/dist/workspace/.polaris/skills/docs-promote/steps/06-execute-promote-deprecate.md +65 -0
- package/dist/workspace/.polaris/skills/docs-promote/steps/07-finalize-promote.md +44 -0
- package/dist/workspace/.polaris/skills/polaris-analyze/SKILL.md +94 -0
- package/dist/workspace/.polaris/skills/polaris-analyze/chain.json +20 -0
- package/dist/workspace/.polaris/skills/polaris-analyze/chain.md +105 -0
- package/dist/workspace/.polaris/skills/polaris-analyze/issue-reconciliation.md +149 -0
- package/dist/workspace/.polaris/skills/polaris-analyze/issue-template.md +133 -0
- package/dist/workspace/.polaris/skills/polaris-analyze/linked-skills/repo-analysis.md +55 -0
- package/dist/workspace/.polaris/skills/polaris-analyze/steps/01-fetch-and-orient.md +79 -0
- package/dist/workspace/.polaris/skills/polaris-analyze/steps/02-map-affected-code.md +58 -0
- package/dist/workspace/.polaris/skills/polaris-analyze/steps/03-assess-issue.md +58 -0
- package/dist/workspace/.polaris/skills/polaris-analyze/steps/04-blocker-check.md +60 -0
- package/dist/workspace/.polaris/skills/polaris-analyze/steps/05-create-cluster-plan.md +197 -0
- package/dist/workspace/.polaris/skills/polaris-analyze/steps/06-final-report.md +60 -0
- package/dist/workspace/.polaris/skills/polaris-catalog/SKILL.md +91 -0
- package/dist/workspace/.polaris/skills/polaris-catalog/chain.json +22 -0
- package/dist/workspace/.polaris/skills/polaris-catalog/chain.md +85 -0
- package/dist/workspace/.polaris/skills/polaris-catalog/steps/01-orient-catalog.md +92 -0
- package/dist/workspace/.polaris/skills/polaris-catalog/steps/02-reconcile-polaris-md.md +33 -0
- package/dist/workspace/.polaris/skills/polaris-catalog/steps/03-reconcile-summary-md.md +70 -0
- package/dist/workspace/.polaris/skills/polaris-catalog/steps/04-classify-and-place.md +117 -0
- package/dist/workspace/.polaris/skills/polaris-catalog/steps/05-catalog-commit.md +94 -0
- package/dist/workspace/.polaris/skills/polaris-medic/SKILL.md +52 -0
- package/dist/workspace/.polaris/skills/polaris-medic/chain.md +111 -0
- package/dist/workspace/.polaris/skills/polaris-medic/steps/01-orient-medic.md +75 -0
- package/dist/workspace/.polaris/skills/polaris-medic/steps/02-diagnose.md +79 -0
- package/dist/workspace/.polaris/skills/polaris-medic/steps/03-repair.md +64 -0
- package/dist/workspace/.polaris/skills/polaris-medic/steps/04-validate.md +66 -0
- package/dist/workspace/.polaris/skills/polaris-medic/steps/05-create-chart.md +85 -0
- package/dist/workspace/.polaris/skills/polaris-medic/steps/06-closeout.md +86 -0
- package/dist/workspace/.polaris/skills/polaris-reconcile/SKILL.md +75 -0
- package/dist/workspace/.polaris/skills/polaris-reconcile/chain.json +20 -0
- package/dist/workspace/.polaris/skills/polaris-reconcile/chain.md +67 -0
- package/dist/workspace/.polaris/skills/polaris-reconcile/steps/01-orient-reconcile.md +82 -0
- package/dist/workspace/.polaris/skills/polaris-reconcile/steps/02-reconcile-polaris-md.md +95 -0
- package/dist/workspace/.polaris/skills/polaris-reconcile/steps/03-reconcile-summary-md.md +108 -0
- package/dist/workspace/.polaris/skills/polaris-reconcile/steps/04-reconcile-commit.md +88 -0
- package/dist/workspace/.polaris/skills/polaris-run/SKILL.md +135 -0
- package/dist/workspace/.polaris/skills/polaris-run/chain.json +19 -0
- package/dist/workspace/.polaris/skills/polaris-run/chain.md +298 -0
- package/dist/workspace/.polaris/skills/polaris-run/execution-adapter.md +34 -0
- package/dist/workspace/.polaris/skills/polaris-run/linked-skills/repo-analysis.md +58 -0
- package/dist/workspace/.polaris/skills/polaris-run/steps/01-orient-cluster.md +96 -0
- package/dist/workspace/.polaris/skills/polaris-run/steps/02-prepare-branch.md +53 -0
- package/dist/workspace/.polaris/skills/polaris-run/steps/03-select-child.md +63 -0
- package/dist/workspace/.polaris/skills/polaris-run/steps/04-execute-child.md +75 -0
- package/dist/workspace/.polaris/skills/polaris-run/steps/05-validate-child.md +57 -0
- package/dist/workspace/.polaris/skills/polaris-run/steps/06-commit-and-update-linear.md +74 -0
- package/dist/workspace/.polaris/skills/polaris-run/steps/07-decide-continuation.md +89 -0
- package/dist/workspace/.polaris/skills/polaris-run/steps/08-closeout-librarian.md +146 -0
- package/dist/workspace/.polaris/skills/polaris-run/steps/08-final-delivery.md +91 -0
- package/dist/workspace/.polaris/skills/polaris-run/steps/09-final-delivery.md +104 -0
- package/dist/workspace/.polaris/skills/polaris-tools/README.md +63 -0
- package/dist/workspace/.polaris/skills/polaris-tools/SKILL.md +94 -0
- package/dist/workspace/.polaris/skills/polaris-tools/tools.js +191 -0
- package/dist/workspace/smartdocs/architecture/.gitkeep +0 -0
- package/dist/workspace/smartdocs/audits/.gitkeep +0 -0
- package/dist/workspace/smartdocs/decisions/.gitkeep +0 -0
- package/dist/workspace/smartdocs/doctrine/active/.gitkeep +0 -0
- package/dist/workspace/smartdocs/runtime/.gitkeep +0 -0
- package/dist/workspace/smartdocs/specs/active/.gitkeep +0 -0
- package/dist/workspace/smartdocs/specs/archive/.gitkeep +0 -0
- package/dist/workspace/workspace/.polaris/roles/analyst.md +38 -0
- package/dist/workspace/workspace/.polaris/roles/closeout-librarian.md +122 -0
- package/dist/workspace/workspace/.polaris/roles/cognition-librarian.md +37 -0
- package/dist/workspace/workspace/.polaris/roles/finalizer.md +45 -0
- package/dist/workspace/workspace/.polaris/roles/foreman.md +165 -0
- package/dist/workspace/workspace/.polaris/roles/librarian.md +74 -0
- package/dist/workspace/workspace/.polaris/roles/worker.md +119 -0
- package/dist/workspace/workspace/.polaris/session-type +1 -0
- package/dist/workspace/workspace/.polaris/skills/ROUTING.md +109 -0
- package/dist/workspace/workspace/.polaris/skills/caveman/SKILL.md +74 -0
- package/dist/workspace/workspace/.polaris/skills/caveman-compress/scripts/compress.py +272 -0
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/POLARIS.md +46 -0
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/SKILL.md +59 -0
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/chain.md +116 -0
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/01-load-cluster-context.md +78 -0
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/02-drift-reconciliation.md +157 -0
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/03-reconcile-polaris-md.md +93 -0
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/04-reconcile-summary-md.md +106 -0
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/05-doc-ingestion.md +114 -0
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/06-link-validation.md +128 -0
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/07-yaml-linking.md +95 -0
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/08-librarian-commit.md +119 -0
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/09-sealed-result.md +118 -0
- package/dist/workspace/workspace/.polaris/skills/docs-ingest/SKILL.md +68 -0
- package/dist/workspace/workspace/.polaris/skills/docs-ingest/chain.json +23 -0
- package/dist/workspace/workspace/.polaris/skills/docs-ingest/chain.md +149 -0
- package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/01-orient-ingest.md +85 -0
- package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/02-classify-batch.md +87 -0
- package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/03-conflict-check.md +66 -0
- package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/04-place-and-link.md +77 -0
- package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/05-finalize-ingest.md +49 -0
- package/dist/workspace/workspace/.polaris/skills/docs-promote/SKILL.md +79 -0
- package/dist/workspace/workspace/.polaris/skills/docs-promote/chain.json +25 -0
- package/dist/workspace/workspace/.polaris/skills/docs-promote/chain.md +80 -0
- package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/01-orient-promote.md +53 -0
- package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/02-review-candidates.md +51 -0
- package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/03-read-linked-code.md +50 -0
- package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/04-conflict-surface.md +65 -0
- package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/05-await-approval.md +61 -0
- package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/06-execute-promote-deprecate.md +65 -0
- package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/07-finalize-promote.md +44 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/SKILL.md +94 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/chain.json +20 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/chain.md +105 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/issue-reconciliation.md +149 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/issue-template.md +133 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/linked-skills/repo-analysis.md +55 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/01-fetch-and-orient.md +79 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/02-map-affected-code.md +58 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/03-assess-issue.md +58 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/04-blocker-check.md +60 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/05-create-cluster-plan.md +197 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/06-final-report.md +60 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-catalog/SKILL.md +91 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-catalog/chain.json +22 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-catalog/chain.md +85 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/01-orient-catalog.md +92 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/02-reconcile-polaris-md.md +33 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/03-reconcile-summary-md.md +70 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/04-classify-and-place.md +117 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/05-catalog-commit.md +94 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-medic/SKILL.md +52 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-medic/chain.md +111 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/01-orient-medic.md +75 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/02-diagnose.md +79 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/03-repair.md +64 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/04-validate.md +66 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/05-create-chart.md +85 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/06-closeout.md +86 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/SKILL.md +75 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/chain.json +20 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/chain.md +67 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/01-orient-reconcile.md +82 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/02-reconcile-polaris-md.md +95 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/03-reconcile-summary-md.md +108 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/04-reconcile-commit.md +88 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-run/SKILL.md +135 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-run/chain.json +19 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-run/chain.md +298 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-run/execution-adapter.md +34 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-run/linked-skills/repo-analysis.md +58 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/01-orient-cluster.md +96 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/02-prepare-branch.md +53 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/03-select-child.md +63 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/04-execute-child.md +75 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/05-validate-child.md +57 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/06-commit-and-update-linear.md +74 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/07-decide-continuation.md +89 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/08-closeout-librarian.md +146 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/08-final-delivery.md +91 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/09-final-delivery.md +104 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-tools/README.md +63 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-tools/SKILL.md +94 -0
- package/dist/workspace/workspace/.polaris/skills/polaris-tools/tools.js +191 -0
- package/dist/workspace/workspace/smartdocs/architecture/.gitkeep +0 -0
- package/dist/workspace/workspace/smartdocs/audits/.gitkeep +0 -0
- package/dist/workspace/workspace/smartdocs/decisions/.gitkeep +0 -0
- package/dist/workspace/workspace/smartdocs/doctrine/active/.gitkeep +0 -0
- package/dist/workspace/workspace/smartdocs/runtime/.gitkeep +0 -0
- package/dist/workspace/workspace/smartdocs/specs/active/.gitkeep +0 -0
- package/dist/workspace/workspace/smartdocs/specs/archive/.gitkeep +0 -0
- package/package.json +2 -2
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: polaris-medic-step-01
|
|
3
|
+
description: Read packet, load failed result, and build the diagnosis inventory for this session.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Step 01 — Orient Medic
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Build a complete picture of the failure event. This is the foundation for all subsequent diagnosis and repair steps. Nothing is written in this step.
|
|
11
|
+
|
|
12
|
+
## Actions
|
|
13
|
+
|
|
14
|
+
### 1.1 Read and Validate Packet
|
|
15
|
+
|
|
16
|
+
Read the packet from the path provided in the dispatch prompt.
|
|
17
|
+
|
|
18
|
+
Validate required fields:
|
|
19
|
+
- `role` must be `"medic"`
|
|
20
|
+
- `run_id`, `dispatch_id`, `cluster_id` must be present and non-empty
|
|
21
|
+
- `failed_result_packet` must be present
|
|
22
|
+
- `result_path` must be present
|
|
23
|
+
- `allowed_write_paths` must be present
|
|
24
|
+
|
|
25
|
+
If validation fails: write a minimal failure result to `result_path` and terminate.
|
|
26
|
+
|
|
27
|
+
### 1.2 Load Failed Result Packet
|
|
28
|
+
|
|
29
|
+
Read the failed result packet from `packet.failed_result_packet`.
|
|
30
|
+
|
|
31
|
+
Extract:
|
|
32
|
+
- Child ID that failed
|
|
33
|
+
- Error message
|
|
34
|
+
- Files that were changed (if any)
|
|
35
|
+
- Validation failures (if any)
|
|
36
|
+
- Execution context (if any)
|
|
37
|
+
|
|
38
|
+
### 1.3 Load Cluster Context
|
|
39
|
+
|
|
40
|
+
Load cluster context from `packet.cluster_context`.
|
|
41
|
+
|
|
42
|
+
Extract:
|
|
43
|
+
- Cluster ID
|
|
44
|
+
- Branch name
|
|
45
|
+
- Related work items
|
|
46
|
+
- Route information (if available)
|
|
47
|
+
|
|
48
|
+
### 1.4 Build Diagnosis Inventory
|
|
49
|
+
|
|
50
|
+
Produce an internal inventory (not written to disk):
|
|
51
|
+
|
|
52
|
+
```yaml
|
|
53
|
+
diagnosis_inventory:
|
|
54
|
+
cluster_id: <from packet>
|
|
55
|
+
failed_child_id: <from failed_result_packet>
|
|
56
|
+
error_message: <from failed_result_packet>
|
|
57
|
+
changed_files: <from failed_result_packet>
|
|
58
|
+
validation_failures: <from failed_result_packet>
|
|
59
|
+
execution_context: <from failed_result_packet>
|
|
60
|
+
route: <from cluster_context>
|
|
61
|
+
branch: <from cluster_context>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 1.5 Emit Telemetry
|
|
65
|
+
|
|
66
|
+
Emit `medic-start` event (if telemetry path provided).
|
|
67
|
+
|
|
68
|
+
## Completion Criteria
|
|
69
|
+
|
|
70
|
+
- Packet validated
|
|
71
|
+
- Failed result packet loaded
|
|
72
|
+
- Cluster context loaded
|
|
73
|
+
- Diagnosis inventory built
|
|
74
|
+
|
|
75
|
+
Proceed to step 02.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: polaris-medic-step-02
|
|
3
|
+
description: Analyze the failure, identify root cause, and determine repair strategy.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Step 02 — Diagnose
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Analyze the failure event to understand what went wrong and determine a repair strategy. This step does not make any changes to the codebase.
|
|
11
|
+
|
|
12
|
+
## Actions
|
|
13
|
+
|
|
14
|
+
### 2.1 Analyze Error Message
|
|
15
|
+
|
|
16
|
+
Examine the error message from the failed result packet:
|
|
17
|
+
- What type of error occurred?
|
|
18
|
+
- Which file or component is implicated?
|
|
19
|
+
- Is this a syntax error, runtime error, validation error, or test failure?
|
|
20
|
+
|
|
21
|
+
### 2.2 Examine Changed Files
|
|
22
|
+
|
|
23
|
+
Review the files that were changed by the failed worker:
|
|
24
|
+
- Do the changes introduce syntax errors?
|
|
25
|
+
- Do the changes break existing functionality?
|
|
26
|
+
- Are there missing dependencies or imports?
|
|
27
|
+
- Are there type mismatches?
|
|
28
|
+
|
|
29
|
+
### 2.3 Identify Root Cause
|
|
30
|
+
|
|
31
|
+
Based on the error analysis and file examination, identify the root cause:
|
|
32
|
+
|
|
33
|
+
Common root causes:
|
|
34
|
+
- Syntax error in introduced code
|
|
35
|
+
- Missing or incorrect dependency
|
|
36
|
+
- Type mismatch or type error
|
|
37
|
+
- Logic error in implementation
|
|
38
|
+
- Test failure due to incorrect expectations
|
|
39
|
+
- Configuration error
|
|
40
|
+
- Environment mismatch
|
|
41
|
+
|
|
42
|
+
### 2.4 Determine Repair Strategy
|
|
43
|
+
|
|
44
|
+
Based on the root cause, determine the appropriate repair strategy:
|
|
45
|
+
|
|
46
|
+
Repair strategies:
|
|
47
|
+
- Fix syntax errors
|
|
48
|
+
- Add missing dependencies
|
|
49
|
+
- Correct type annotations
|
|
50
|
+
- Adjust logic implementation
|
|
51
|
+
- Update test expectations
|
|
52
|
+
- Fix configuration
|
|
53
|
+
- Document environment requirements
|
|
54
|
+
|
|
55
|
+
If the root cause is unclear or the repair strategy is uncertain, record this as a blocker and proceed with best-effort repair or defer treatment.
|
|
56
|
+
|
|
57
|
+
### 2.5 Record Diagnosis
|
|
58
|
+
|
|
59
|
+
Record the diagnosis internally (not written to disk):
|
|
60
|
+
|
|
61
|
+
```yaml
|
|
62
|
+
diagnosis:
|
|
63
|
+
root_cause: <identified root cause>
|
|
64
|
+
repair_strategy: <chosen repair strategy>
|
|
65
|
+
uncertainty: <any doubts or blockers>
|
|
66
|
+
deferred: <true if treatment deferred>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 2.6 Emit Telemetry
|
|
70
|
+
|
|
71
|
+
Emit `medic-step-complete` event for step 02 (if telemetry path provided).
|
|
72
|
+
|
|
73
|
+
## Completion Criteria
|
|
74
|
+
|
|
75
|
+
- Error analyzed
|
|
76
|
+
- Root cause identified (or uncertainty recorded)
|
|
77
|
+
- Repair strategy determined (or deferred)
|
|
78
|
+
|
|
79
|
+
Proceed to step 03.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: polaris-medic-step-03
|
|
3
|
+
description: Execute repair changes to implementation code based on diagnosis.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Step 03 — Repair
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Execute the repair strategy identified in step 02 to fix the failure. This step makes changes to implementation code only.
|
|
11
|
+
|
|
12
|
+
## Actions
|
|
13
|
+
|
|
14
|
+
### 3.1 Verify Write Permissions
|
|
15
|
+
|
|
16
|
+
Before making any changes, verify that the target files are in `packet.allowed_write_paths` and not in `packet.prohibited_write_paths`.
|
|
17
|
+
|
|
18
|
+
If a target file is prohibited, skip and record as a blocker.
|
|
19
|
+
|
|
20
|
+
### 3.2 Execute Repair Strategy
|
|
21
|
+
|
|
22
|
+
Apply the repair strategy determined in step 02:
|
|
23
|
+
|
|
24
|
+
- **Syntax errors**: Fix syntax in the identified files
|
|
25
|
+
- **Missing dependencies**: Add missing imports or dependencies
|
|
26
|
+
- **Type mismatches**: Correct type annotations
|
|
27
|
+
- **Logic errors**: Adjust the implementation logic
|
|
28
|
+
- **Test failures**: Update test expectations or fix implementation
|
|
29
|
+
- **Configuration errors**: Fix configuration files
|
|
30
|
+
- **Environment issues**: Document requirements (do not change environment)
|
|
31
|
+
|
|
32
|
+
Make the smallest scoped change that addresses the root cause.
|
|
33
|
+
|
|
34
|
+
### 3.3 Verify Repair Completeness
|
|
35
|
+
|
|
36
|
+
After applying the repair, verify:
|
|
37
|
+
- The identified root cause is addressed
|
|
38
|
+
- No new syntax errors are introduced
|
|
39
|
+
- Changes are within the scope of the failed child's work
|
|
40
|
+
|
|
41
|
+
If the repair cannot be completed (e.g., root cause unclear, changes too broad), record this as a blocker.
|
|
42
|
+
|
|
43
|
+
### 3.4 Record Changes
|
|
44
|
+
|
|
45
|
+
Record the changes made internally (not written to disk):
|
|
46
|
+
|
|
47
|
+
```yaml
|
|
48
|
+
repair_changes:
|
|
49
|
+
files_modified: [<list of files>]
|
|
50
|
+
changes_summary: <brief description of changes>
|
|
51
|
+
blockers: [<any blockers encountered>]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 3.5 Emit Telemetry
|
|
55
|
+
|
|
56
|
+
Emit `medic-step-complete` event for step 03 (if telemetry path provided).
|
|
57
|
+
|
|
58
|
+
## Completion Criteria
|
|
59
|
+
|
|
60
|
+
- Repair strategy executed (or blocked)
|
|
61
|
+
- Changes made are minimal and scoped
|
|
62
|
+
- No prohibited files were modified
|
|
63
|
+
|
|
64
|
+
Proceed to step 04.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: polaris-medic-step-04
|
|
3
|
+
description: Verify that the repair resolves the failure.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Step 04 — Validate
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Verify that the repair changes successfully resolve the original failure. This step runs validation to confirm the fix works.
|
|
11
|
+
|
|
12
|
+
## Actions
|
|
13
|
+
|
|
14
|
+
### 4.1 Run Validation Commands
|
|
15
|
+
|
|
16
|
+
Run the validation commands specified in the failed result packet or cluster context:
|
|
17
|
+
|
|
18
|
+
Common validation commands:
|
|
19
|
+
- `npm run build` — verify TypeScript compilation
|
|
20
|
+
- `npm test` — verify test suite passes
|
|
21
|
+
- Specific test commands for the affected route
|
|
22
|
+
|
|
23
|
+
If no validation commands are specified, run:
|
|
24
|
+
- `npm run build`
|
|
25
|
+
- `npm test`
|
|
26
|
+
|
|
27
|
+
### 4.2 Analyze Validation Results
|
|
28
|
+
|
|
29
|
+
Examine the validation output:
|
|
30
|
+
- Did the build succeed?
|
|
31
|
+
- Did the tests pass?
|
|
32
|
+
- Are there any remaining errors related to the original failure?
|
|
33
|
+
|
|
34
|
+
### 4.3 Determine Validation Outcome
|
|
35
|
+
|
|
36
|
+
Based on the validation results, determine the outcome:
|
|
37
|
+
|
|
38
|
+
- **Success**: All validation passes, original failure resolved
|
|
39
|
+
- **Partial**: Some validation passes, but issues remain
|
|
40
|
+
- **Failure**: Validation still fails, repair unsuccessful
|
|
41
|
+
|
|
42
|
+
If validation fails, record this as a blocker. The Medic may proceed to chart creation to document the partial treatment.
|
|
43
|
+
|
|
44
|
+
### 4.4 Record Validation Result
|
|
45
|
+
|
|
46
|
+
Record the validation result internally (not written to disk):
|
|
47
|
+
|
|
48
|
+
```yaml
|
|
49
|
+
validation_result:
|
|
50
|
+
outcome: <success | partial | failure>
|
|
51
|
+
build_passed: <true | false>
|
|
52
|
+
tests_passed: <true | false>
|
|
53
|
+
remaining_errors: [<any remaining errors>]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 4.5 Emit Telemetry
|
|
57
|
+
|
|
58
|
+
Emit `medic-step-complete` event for step 04 (if telemetry path provided).
|
|
59
|
+
|
|
60
|
+
## Completion Criteria
|
|
61
|
+
|
|
62
|
+
- Validation commands executed
|
|
63
|
+
- Validation outcome determined
|
|
64
|
+
- Result recorded
|
|
65
|
+
|
|
66
|
+
Proceed to step 05.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: polaris-medic-step-05
|
|
3
|
+
description: Create a medical chart documenting the failure and treatment.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Step 05 — Create Chart
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Create a medical chart in `smartdocs/medic/charts/` documenting the failure event, diagnosis, treatment, and validation outcome. This chart becomes part of the repository's medical history.
|
|
11
|
+
|
|
12
|
+
## Actions
|
|
13
|
+
|
|
14
|
+
### 5.1 Generate Chart ID
|
|
15
|
+
|
|
16
|
+
Use the chart ID generator from the Chart system (POL-327):
|
|
17
|
+
- Import `generateNextChartId` from `src/medic/chart-id.ts`
|
|
18
|
+
- Generate the next chart ID for today
|
|
19
|
+
- Charts directory: `smartdocs/medic/charts/`
|
|
20
|
+
|
|
21
|
+
### 5.2 Prepare Chart Front-Matter
|
|
22
|
+
|
|
23
|
+
Prepare the YAML front-matter for the chart:
|
|
24
|
+
|
|
25
|
+
```yaml
|
|
26
|
+
---
|
|
27
|
+
chart_id: <generated chart ID>
|
|
28
|
+
cluster_id: <from packet>
|
|
29
|
+
route: <from cluster context>
|
|
30
|
+
status: <open | resolved | deferred>
|
|
31
|
+
related_charts: []
|
|
32
|
+
created: <ISO8601 timestamp>
|
|
33
|
+
updated: <ISO8601 timestamp>
|
|
34
|
+
drift_observations: []
|
|
35
|
+
---
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Set status based on validation outcome:
|
|
39
|
+
- `resolved` if validation succeeded
|
|
40
|
+
- `deferred` if validation failed or repair was incomplete
|
|
41
|
+
- `open` if diagnosis was uncertain
|
|
42
|
+
|
|
43
|
+
### 5.3 Prepare Chart Sections
|
|
44
|
+
|
|
45
|
+
Write the required chart sections:
|
|
46
|
+
|
|
47
|
+
- **Problem**: Description of the original failure
|
|
48
|
+
- **Symptoms**: Error messages, validation failures, observable behavior
|
|
49
|
+
- **Root Cause**: Identified root cause from step 02
|
|
50
|
+
- **Affected Files**: List of files involved in the failure and repair
|
|
51
|
+
- **Treatment**: Description of repair changes made in step 03
|
|
52
|
+
- **Validation**: Validation outcome from step 04
|
|
53
|
+
- **Prevention**: Recommendations to prevent similar failures
|
|
54
|
+
- **When To Read This Chart**: Conditions under which this chart is relevant
|
|
55
|
+
|
|
56
|
+
### 5.4 Write Chart File
|
|
57
|
+
|
|
58
|
+
Write the chart to `smartdocs/medic/charts/<chart_id>.md`
|
|
59
|
+
|
|
60
|
+
Verify the chart passes schema validation using the Chart system (POL-327):
|
|
61
|
+
- Front-matter must match `ChartFrontMatter` schema
|
|
62
|
+
- All required sections must be present
|
|
63
|
+
|
|
64
|
+
### 5.5 Record Chart Creation
|
|
65
|
+
|
|
66
|
+
Record the chart creation internally (not written to disk):
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
chart_created:
|
|
70
|
+
chart_id: <generated chart ID>
|
|
71
|
+
file_path: <path to chart file>
|
|
72
|
+
validation_passed: <true | false>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 5.6 Emit Telemetry
|
|
76
|
+
|
|
77
|
+
Emit `medic-step-complete` event for step 05 (if telemetry path provided).
|
|
78
|
+
|
|
79
|
+
## Completion Criteria
|
|
80
|
+
|
|
81
|
+
- Chart ID generated
|
|
82
|
+
- Chart file created with valid front-matter and sections
|
|
83
|
+
- Chart passes schema validation
|
|
84
|
+
|
|
85
|
+
Proceed to step 06.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: polaris-medic-step-06
|
|
3
|
+
description: Commit repair changes, write sealed result, and terminate.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Step 06 — Closeout
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Commit all changes from this session (repairs and chart), write the sealed result, and terminate. This is the final step.
|
|
11
|
+
|
|
12
|
+
## Actions
|
|
13
|
+
|
|
14
|
+
### 6.1 Determine Commit Strategy
|
|
15
|
+
|
|
16
|
+
Based on the work completed:
|
|
17
|
+
- If repairs were made and/or chart was created: create a commit
|
|
18
|
+
- If no changes were made (e.g., diagnosis deferred): do not create a commit
|
|
19
|
+
|
|
20
|
+
### 6.2 Create Commit (if changes exist)
|
|
21
|
+
|
|
22
|
+
If changes were made:
|
|
23
|
+
1. Stage all modified files
|
|
24
|
+
2. Create a commit with message:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
[POL-326] Medic: <brief description of repair>
|
|
28
|
+
|
|
29
|
+
Generated with [Devin](https://cli.devin.ai/docs)
|
|
30
|
+
|
|
31
|
+
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
3. Record the commit SHA
|
|
35
|
+
|
|
36
|
+
If no changes were made, set `commit_sha: null`.
|
|
37
|
+
|
|
38
|
+
### 6.3 Prepare Sealed Result
|
|
39
|
+
|
|
40
|
+
Prepare the sealed result JSON:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"run_id": "<from packet>",
|
|
45
|
+
"dispatch_id": "<from packet>",
|
|
46
|
+
"cluster_id": "<from packet>",
|
|
47
|
+
"status": "<success | partial | failure | blocked>",
|
|
48
|
+
"commit_sha": "<commit SHA or null>",
|
|
49
|
+
"chart_id": "<chart ID or null>",
|
|
50
|
+
"diagnosis": {
|
|
51
|
+
"root_cause": "<root cause>",
|
|
52
|
+
"repair_strategy": "<repair strategy>"
|
|
53
|
+
},
|
|
54
|
+
"validation": {
|
|
55
|
+
"outcome": "<success | partial | failure>",
|
|
56
|
+
"build_passed": <true | false>,
|
|
57
|
+
"tests_passed": <true | false>
|
|
58
|
+
},
|
|
59
|
+
"blockers": [<any blockers encountered>],
|
|
60
|
+
"timestamp": "<ISO8601 timestamp>"
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Set status based on overall outcome:
|
|
65
|
+
- `success`: Repair completed, validation passed, chart created
|
|
66
|
+
- `partial`: Some work done, but blockers remain
|
|
67
|
+
- `failure`: Fatal error encountered
|
|
68
|
+
- `blocked`: All work blocked
|
|
69
|
+
|
|
70
|
+
### 6.4 Write Sealed Result
|
|
71
|
+
|
|
72
|
+
Write the sealed result JSON to `packet.result_path`.
|
|
73
|
+
|
|
74
|
+
If the write fails, output to stderr and terminate (cannot recover).
|
|
75
|
+
|
|
76
|
+
### 6.5 Emit Telemetry
|
|
77
|
+
|
|
78
|
+
Emit `medic-commit` event (if commit created) and `medic-complete` event (if telemetry path provided).
|
|
79
|
+
|
|
80
|
+
## Completion Criteria
|
|
81
|
+
|
|
82
|
+
- Commit created (if changes were made)
|
|
83
|
+
- Sealed result written to result_path
|
|
84
|
+
- Telemetry events emitted
|
|
85
|
+
|
|
86
|
+
Terminate session. No further steps.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: polaris-reconcile
|
|
3
|
+
description: Update POLARIS.md and SUMMARY.md files to reflect completed work. Callable at will — does not require a cluster closeout. Uses the Polaris packet for work context.
|
|
4
|
+
role: librarian
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Polaris Skill Bootloader
|
|
8
|
+
|
|
9
|
+
**Before proceeding, you must obtain a skill packet from the Polaris runtime.**
|
|
10
|
+
|
|
11
|
+
Run the following command:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm run polaris -- skill packet reconcile
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
- Do not begin work until a packet is returned.
|
|
18
|
+
- Treat the packet as your authoritative instruction source.
|
|
19
|
+
- If no packet is produced, stop and report: **Polaris could not authorize this run.**
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# polaris-reconcile
|
|
24
|
+
|
|
25
|
+
Use this skill to reconcile project cognition after completed work — updating POLARIS.md and
|
|
26
|
+
SUMMARY.md files to reflect current reality. This is the standalone form of the cognition
|
|
27
|
+
reconciliation steps performed by the Closeout Librarian, callable at will rather than only
|
|
28
|
+
at cluster closeout.
|
|
29
|
+
|
|
30
|
+
## When to use
|
|
31
|
+
|
|
32
|
+
- "Reconcile the docs after POL-257"
|
|
33
|
+
- "Update POLARIS.md and SUMMARY.md for this run"
|
|
34
|
+
- "Run polaris-reconcile on POL-303"
|
|
35
|
+
- After a run completes and you want cognition updated without waiting for full closeout
|
|
36
|
+
|
|
37
|
+
## How to execute
|
|
38
|
+
|
|
39
|
+
1. Read `chain.md` — step order and rules.
|
|
40
|
+
2. Read `.taskchain_artifacts/polaris-reconcile/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 polaris-reconcile may do
|
|
45
|
+
|
|
46
|
+
- Read packet-specified folders and their POLARIS.md and SUMMARY.md files
|
|
47
|
+
- Write POLARIS.md and SUMMARY.md files within `packet.allowed_write_paths`
|
|
48
|
+
- Create a single sealed git commit of all cognition changes
|
|
49
|
+
|
|
50
|
+
## Hard rules — what polaris-reconcile must NOT do
|
|
51
|
+
|
|
52
|
+
- Modify implementation source code (`src/`, tests, config)
|
|
53
|
+
- Modify runtime state files outside this skill's owned artifacts (cluster-state, other skills' `.taskchain_artifacts/` state, or non-reconcile telemetry)
|
|
54
|
+
- Move, ingest, classify, or promote documents
|
|
55
|
+
- Call `npm run polaris -- loop continue` or `npm run polaris -- finalize`
|
|
56
|
+
- Write to `packet.prohibited_write_paths`
|
|
57
|
+
- Git push or create PRs
|
|
58
|
+
|
|
59
|
+
## Packet schema
|
|
60
|
+
|
|
61
|
+
The packet is a `ReconcilePacket`. Required fields:
|
|
62
|
+
|
|
63
|
+
| Field | Description |
|
|
64
|
+
|---|---|
|
|
65
|
+
| `run_id` | Identifier for this reconcile run |
|
|
66
|
+
| `issue_id` | Bound issue (e.g. `POL-257`) |
|
|
67
|
+
| `affected_folders` | Folders whose POLARIS.md and/or SUMMARY.md may need updating |
|
|
68
|
+
| `work_inventory` | Summary of completed work: changed files, child summaries, cognition notes |
|
|
69
|
+
| `allowed_write_paths` | Paths this skill may write |
|
|
70
|
+
| `prohibited_write_paths` | Paths this skill must not write |
|
|
71
|
+
| `constraints.max_summary_addition_lines` | Net new line cap per SUMMARY.md update (default: 50) |
|
|
72
|
+
|
|
73
|
+
## Execution
|
|
74
|
+
|
|
75
|
+
Read `chain.md` and execute steps in strict order. Do not skip steps. Do not reorder steps.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "polaris-reconcile-chain",
|
|
3
|
+
"steps": [
|
|
4
|
+
"01-orient-reconcile",
|
|
5
|
+
"02-reconcile-polaris-md",
|
|
6
|
+
"03-reconcile-summary-md",
|
|
7
|
+
"04-reconcile-commit"
|
|
8
|
+
],
|
|
9
|
+
"terminal_steps": ["04-reconcile-commit"],
|
|
10
|
+
"scope": "cognition-only",
|
|
11
|
+
"forbidden_actions": [
|
|
12
|
+
"src file mutations",
|
|
13
|
+
"runtime state file mutations",
|
|
14
|
+
"document ingestion or promotion",
|
|
15
|
+
"polaris loop continue",
|
|
16
|
+
"polaris finalize",
|
|
17
|
+
"git push",
|
|
18
|
+
"pr creation"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: polaris-reconcile-chain
|
|
3
|
+
description: Step order, CLI reference, canonical paths, run ID format, telemetry, and artifact authority for polaris-reconcile.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# polaris-reconcile 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 affected folders or change scope from
|
|
13
|
+
conversation context.
|
|
14
|
+
|
|
15
|
+
## Step traversal order
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
01-orient-reconcile
|
|
19
|
+
02-reconcile-polaris-md
|
|
20
|
+
03-reconcile-summary-md
|
|
21
|
+
04-reconcile-commit
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Read the current step's file in `steps/` before acting. Do not read ahead.
|
|
25
|
+
|
|
26
|
+
## Canonical paths
|
|
27
|
+
|
|
28
|
+
| State | Path |
|
|
29
|
+
|---|---|
|
|
30
|
+
| Skill state | `.taskchain_artifacts/polaris-reconcile/current-state.json` |
|
|
31
|
+
| Telemetry | `.taskchain_artifacts/polaris-reconcile/runs/<run-id>/telemetry.jsonl` |
|
|
32
|
+
|
|
33
|
+
## Run ID format
|
|
34
|
+
|
|
35
|
+
`polaris-reconcile-<slug>-<YYYY-MM-DD>-<seq>` — e.g. `polaris-reconcile-POL-257-2026-06-04-001`
|
|
36
|
+
|
|
37
|
+
## Telemetry
|
|
38
|
+
|
|
39
|
+
Append-only JSONL. Required fields: `event`, `run_id`, `timestamp`.
|
|
40
|
+
|
|
41
|
+
| Event | Trigger |
|
|
42
|
+
|---|---|
|
|
43
|
+
| `run-start` | Begin orient step |
|
|
44
|
+
| `step-complete` | End of every step |
|
|
45
|
+
| `polaris-md-updated` | POLARIS.md written for a folder |
|
|
46
|
+
| `summary-md-updated` | SUMMARY.md written for a folder |
|
|
47
|
+
| `reconcile-commit` | Commit created |
|
|
48
|
+
| `reconcile-complete` | All steps done |
|
|
49
|
+
|
|
50
|
+
## Artifact authority
|
|
51
|
+
|
|
52
|
+
`.taskchain_artifacts/polaris-reconcile/current-state.json` is the sole authoritative
|
|
53
|
+
live state surface.
|
|
54
|
+
|
|
55
|
+
- Update after every completed step — before advancing.
|
|
56
|
+
- A step is NOT complete until the state update succeeds.
|
|
57
|
+
- If the update fails: stop and report the persistence failure.
|
|
58
|
+
|
|
59
|
+
## Forbidden actions
|
|
60
|
+
|
|
61
|
+
- src file mutations
|
|
62
|
+
- runtime state file mutations
|
|
63
|
+
- document ingestion or promotion
|
|
64
|
+
- polaris loop continue
|
|
65
|
+
- polaris finalize
|
|
66
|
+
- git push
|
|
67
|
+
- PR creation
|
package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/01-orient-reconcile.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: polaris-reconcile-step-01
|
|
3
|
+
description: Generate run_id, emit run-start telemetry, load packet, validate schema, and establish work_inventory.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Step 01 — Orient reconcile
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Establish bounded execution context before touching any files. Validate the packet,
|
|
11
|
+
confirm which folders are in scope, and build the work inventory.
|
|
12
|
+
|
|
13
|
+
## Actions
|
|
14
|
+
|
|
15
|
+
### 1.1 Generate run_id
|
|
16
|
+
|
|
17
|
+
Format: `polaris-reconcile-<issue-slug>-<YYYY-MM-DD>-<seq>`
|
|
18
|
+
Example: `polaris-reconcile-POL-257-2026-06-04-001`
|
|
19
|
+
|
|
20
|
+
### 1.2 Emit run-start telemetry
|
|
21
|
+
|
|
22
|
+
First I/O action, before any file access:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
mkdir -p .taskchain_artifacts/polaris-reconcile/runs/<run-id>
|
|
26
|
+
echo '{"event":"run-start","run_id":"<run-id>","issue_id":"<issue_id>","timestamp":"<ISO>"}' \
|
|
27
|
+
>> .taskchain_artifacts/polaris-reconcile/runs/<run-id>/telemetry.jsonl
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
If this write fails: halt. Do not continue.
|
|
31
|
+
|
|
32
|
+
### 1.3 Validate packet
|
|
33
|
+
|
|
34
|
+
Confirm the packet contains all required fields:
|
|
35
|
+
`run_id`, `issue_id`, `affected_folders`, `work_inventory`, `allowed_write_paths`,
|
|
36
|
+
`prohibited_write_paths`, `constraints`
|
|
37
|
+
|
|
38
|
+
If any required field is missing: halt and report which field is absent.
|
|
39
|
+
|
|
40
|
+
### 1.4 Build work inventory snapshot
|
|
41
|
+
|
|
42
|
+
From `packet.work_inventory`, confirm:
|
|
43
|
+
- `affected_folders` — list of folder paths whose cognition may need updating
|
|
44
|
+
- `all_changed_files` — files changed by the completed work
|
|
45
|
+
- `child_summaries` — summaries of completed children (if cluster-based)
|
|
46
|
+
- `pending_cognition_notes` — any pending cognition notes per folder
|
|
47
|
+
- `polaris_md_files` — current POLARIS.md paths per folder
|
|
48
|
+
- `summary_md_files` — current SUMMARY.md paths per folder
|
|
49
|
+
|
|
50
|
+
If `affected_folders` is empty: record as no-op, skip to step 04.
|
|
51
|
+
|
|
52
|
+
### 1.5 Restate working context
|
|
53
|
+
|
|
54
|
+
Summarize in under 8 bullets:
|
|
55
|
+
- `run_id` and fresh/resumed
|
|
56
|
+
- Bound issue
|
|
57
|
+
- Affected folders (count and paths)
|
|
58
|
+
- `allowed_write_paths` count
|
|
59
|
+
- `prohibited_write_paths` count
|
|
60
|
+
|
|
61
|
+
## Scope declarations
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
allowed_files:
|
|
65
|
+
- .polaris/skills/polaris-reconcile/SKILL.md
|
|
66
|
+
- .polaris/skills/polaris-reconcile/chain.md
|
|
67
|
+
- .taskchain_artifacts/polaris-reconcile/current-state.json
|
|
68
|
+
- packet (read only)
|
|
69
|
+
stop_rules:
|
|
70
|
+
- run-start telemetry write fails
|
|
71
|
+
- packet missing required fields
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Artifact update
|
|
75
|
+
|
|
76
|
+
Update `.taskchain_artifacts/polaris-reconcile/current-state.json`:
|
|
77
|
+
- `run_id`, `issue_id`, `status: orienting`, `current_step_id: 01-orient-reconcile`
|
|
78
|
+
- `affected_folders`, `updated_at: <timestamp>`
|
|
79
|
+
|
|
80
|
+
## Next step
|
|
81
|
+
|
|
82
|
+
02-reconcile-polaris-md
|