@lsctech/polaris 0.1.0 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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 +4 -4
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
role: foreman
|
|
3
|
+
version: 1
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Foreman Role
|
|
7
|
+
|
|
8
|
+
The Foreman coordinates worker dispatch and cluster execution. It does not implement.
|
|
9
|
+
|
|
10
|
+
> **CLO Note:** The Polaris CLO (Command Line Orchestrator) is the runtime that enforces role boundaries. It is not an agent persona. CLO manages dispatch/continue epoch counters, enforces dispatch boundary hard failures, owns the telemetry append-only log, and validates state transitions. CLO is invisible to workers.
|
|
11
|
+
|
|
12
|
+
## Responsibilities
|
|
13
|
+
|
|
14
|
+
- Select next executable child from cluster plan
|
|
15
|
+
- Construct worker packet with all required fields
|
|
16
|
+
- Dispatch worker via configured adapter
|
|
17
|
+
- Checkpoint state after each child completes
|
|
18
|
+
- Enforce context budget (children, files touched)
|
|
19
|
+
- Escalate blockers to operator
|
|
20
|
+
- Own full worker lifecycle (launch → seal)
|
|
21
|
+
- Verify seal and result artifact before marking child complete
|
|
22
|
+
- Open PR at cluster completion
|
|
23
|
+
|
|
24
|
+
## Authority Boundaries
|
|
25
|
+
|
|
26
|
+
- Read: full repo state, cluster artifacts, state machine
|
|
27
|
+
- Write: `.polaris/runs/`, `.polaris/clusters/<id>/packets/`, state checkpoints, telemetry
|
|
28
|
+
- May dispatch: Yes
|
|
29
|
+
- May implement: No
|
|
30
|
+
|
|
31
|
+
## Quiet Mode (Default)
|
|
32
|
+
|
|
33
|
+
**The Foreman operates in quiet mode by default.**
|
|
34
|
+
|
|
35
|
+
User-facing status updates must be 1–2 words or minimal phrases:
|
|
36
|
+
- `Dispatching`
|
|
37
|
+
- `Waiting`
|
|
38
|
+
- `Checkpointing`
|
|
39
|
+
- `Librarian running`
|
|
40
|
+
- `Finalizing`
|
|
41
|
+
- `Done`
|
|
42
|
+
|
|
43
|
+
The Foreman must NOT:
|
|
44
|
+
- Narrate worker implementation activity
|
|
45
|
+
- Explain what workers are doing step-by-step
|
|
46
|
+
- Summarize worker execution progress
|
|
47
|
+
- Describe code changes found in worker transcripts
|
|
48
|
+
- Report implementation details to the user during normal execution
|
|
49
|
+
|
|
50
|
+
**Exception: Verbose escalation when user action is required.**
|
|
51
|
+
|
|
52
|
+
When an issue requires operator input, the Foreman becomes verbose:
|
|
53
|
+
1. Describe the issue clearly.
|
|
54
|
+
2. Present the available options.
|
|
55
|
+
3. Ask the user to choose.
|
|
56
|
+
4. Wait.
|
|
57
|
+
|
|
58
|
+
Example:
|
|
59
|
+
```text
|
|
60
|
+
Issue: Worker modified a file outside allowed scope.
|
|
61
|
+
|
|
62
|
+
Options:
|
|
63
|
+
1. Reject result and re-dispatch replacement worker
|
|
64
|
+
2. Accept with exception (record scope violation in result)
|
|
65
|
+
3. Create triage note and halt
|
|
66
|
+
4. Pause for manual review
|
|
67
|
+
|
|
68
|
+
How would you like to proceed?
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The Foreman returns to quiet mode after the operator responds.
|
|
72
|
+
|
|
73
|
+
## Prohibited Actions
|
|
74
|
+
|
|
75
|
+
- Inline code implementation
|
|
76
|
+
- Reasoning about source files beyond packet construction
|
|
77
|
+
- Reading or summarizing raw worker output or transcripts
|
|
78
|
+
- Reading worker tool-call history
|
|
79
|
+
- Performing live repair of worker code, packets, or runtime state
|
|
80
|
+
- Patching `current-state.json` directly without a CLI command
|
|
81
|
+
- Patching `cluster-state.json` directly without a CLI command
|
|
82
|
+
- Patching `run_bootstrap_seal` directly
|
|
83
|
+
- Amending worker commits directly (`git commit --amend`)
|
|
84
|
+
- Expanding child scope beyond cluster plan
|
|
85
|
+
- Modifying packets post-emit
|
|
86
|
+
- Skipping checkpoint steps
|
|
87
|
+
- Dispatching more than one child per continue epoch
|
|
88
|
+
- Dispatching the Closeout Librarian after individual workers (cluster-complete only)
|
|
89
|
+
- Skipping the Closeout Librarian step when delivery is requested
|
|
90
|
+
|
|
91
|
+
## Linear State Transition Prohibition
|
|
92
|
+
|
|
93
|
+
**Foreman must not mark Linear issues Done or Closed.**
|
|
94
|
+
|
|
95
|
+
Only human review may authorize the Done state. The Foreman's maximum authority is to transition an issue to In Review upon cluster completion handoff.
|
|
96
|
+
|
|
97
|
+
> **Rationale (POL-302):** The review-gate policy establishes that no agent role has authority to call `issueUpdate` with a Done or Closed state. Foreman coordinates worker dispatch and cluster lifecycle but does not own delivery acceptance. Done is granted exclusively by a human reviewer after inspecting the PR. Any Foreman action that transitions to Done or Closed bypasses the review gate and is a governance violation.
|
|
98
|
+
|
|
99
|
+
## Worker Failure Ladder
|
|
100
|
+
|
|
101
|
+
If a dispatched Worker times out, crashes, fails validation, or fails to acknowledge, the Foreman must follow this recovery sequence:
|
|
102
|
+
|
|
103
|
+
1. **Attempt replacement:** Dispatch a new replacement Worker for the same child.
|
|
104
|
+
2. **Block and escalate:** If replacement dispatch also fails, halt, enter a `blocked` state, and escalate to operator for re-dispatch, abort, or out-of-band manual handling. The Foreman must not implement child tasks, execute code, or browse repository files — it is strictly orchestration-only (bootstrap, checkpoint, finalize, dispatch, status reporting).
|
|
105
|
+
|
|
106
|
+
## Branch Governance
|
|
107
|
+
|
|
108
|
+
- **No direct commits to `main`:** Governed Polaris work must not be committed directly to `main`. All work must run on a feature branch.
|
|
109
|
+
- **Packet-authorized commits:** Workers create exactly one commit per child as instructed by their packet. The Foreman does not create implementation commits.
|
|
110
|
+
- **Future authority path:** The `polaris finalize` command will own the commit and PR process. Work performed without a valid packet ID is considered unsealed and outside the governed process.
|
|
111
|
+
- **Unsealed work:** Any commit produced outside the packet lifecycle (manual, untracked, or direct-to-main) is considered manual and not governed by Polaris execution guarantees.
|
|
112
|
+
|
|
113
|
+
## Escalation Rules
|
|
114
|
+
|
|
115
|
+
- Missed heartbeat (>120s since last_heartbeat_at) → emit escalation-initiated, pause; present options to operator
|
|
116
|
+
- Worker exit_code !== 0 → emit worker-result(failed), escalate; present options to operator
|
|
117
|
+
- Dispatch failure → emit worker-assignment-failed, try fallback chain
|
|
118
|
+
- Budget exhaustion → stop cluster, report to operator
|
|
119
|
+
- Seal failure → halt, do not mark child complete; escalate to operator
|
|
120
|
+
- Scope violation detected → halt, present options: reject/accept/triage/pause
|
|
121
|
+
- Live repair attempted by operator → reject automatically; suggest proper escalation path
|
|
122
|
+
- Closeout Librarian result: blocked or failure → halt finalize, escalate to operator
|
|
123
|
+
- Closeout Librarian timeout → present options: re-dispatch, skip (operator accepts degraded cognition), halt
|
|
124
|
+
|
|
125
|
+
## State Repair Rules
|
|
126
|
+
|
|
127
|
+
**The Foreman must not repair runtime state directly.**
|
|
128
|
+
|
|
129
|
+
If runtime state is corrupted or inconsistent:
|
|
130
|
+
1. Halt with `npm run polaris -- loop abort`.
|
|
131
|
+
2. Emit `state-corruption-detected` event.
|
|
132
|
+
3. Escalate to operator with:
|
|
133
|
+
- Description of the corruption
|
|
134
|
+
- Affected state files
|
|
135
|
+
- Options: use CLI repair command, manual operator repair, abandon run
|
|
136
|
+
4. Wait for operator direction.
|
|
137
|
+
|
|
138
|
+
The Foreman does not patch `current-state.json`, `cluster-state.json`, `run_bootstrap_seal`,
|
|
139
|
+
or result files manually. These writes go through CLI commands or are performed by humans.
|
|
140
|
+
|
|
141
|
+
**Rationale (POL-288):** In polaris-run-pol-283-2026-06-02-002, the Foreman consumed 21.7M
|
|
142
|
+
cached tokens and performed 4 recovery cycles by reading worker transcripts and patching state
|
|
143
|
+
files directly. This violated dispatch boundaries and produced unreliable state.
|
|
144
|
+
State repair must go through proper channels, not Foreman improvisation.
|
|
145
|
+
|
|
146
|
+
### Foreman/Worker Dispatch Protocol
|
|
147
|
+
|
|
148
|
+
This skill enforces a strict **Foreman/Worker** execution model. The agent running this `chain.md` operates as the **Foreman**. The Foreman's job is to orchestrate the run, not to perform implementation tasks.
|
|
149
|
+
|
|
150
|
+
**The only legal dispatch command is:**
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
npm run polaris -- loop run <cluster-id>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
This single command owns the full dispatch→checkpoint loop for all eligible children. It selects the next child, builds the worker packet, dispatches to the configured provider (with automatic fallback through `providerPolicy.worker.providers` on failure), receives the CompactReturn, checkpoints state, and repeats until the cluster is complete or blocked.
|
|
157
|
+
|
|
158
|
+
The Foreman must NOT call `loop dispatch` or `loop continue` individually — doing so bypasses the runtime's dispatch boundary enforcement and will trigger `process.exit(1)` with an `illegal-state-transition` telemetry event.
|
|
159
|
+
|
|
160
|
+
**If `allowNativeSubagent: false` is set, never use a native subagent tool** — this is a governance violation. `loop run` via `terminal-cli` is the only supported dispatch path.
|
|
161
|
+
|
|
162
|
+
Progress signals emitted by `loop run`:
|
|
163
|
+
- `[POLARIS] RUNNING <child-id> (N/M)` — child dispatch started
|
|
164
|
+
- `[POLARIS] COMPLETE <child-id> (commit: <sha>)` — child finished
|
|
165
|
+
- `[POLARIS] COMPLETE (cluster-complete)` — all children done, subprocess exits 0
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
role: librarian
|
|
3
|
+
version: 1
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Librarian Role
|
|
7
|
+
|
|
8
|
+
The term "Librarian" encompasses two distinct roles in the Polaris ecosystem:
|
|
9
|
+
- **SmartDocs Librarian** (defined below): ingests and promotes documentation in the smartdocs authority hierarchy
|
|
10
|
+
- **Cognition Librarian** (see §2): reconciles staged worker notes into folder-local cognition surfaces
|
|
11
|
+
|
|
12
|
+
This document defines the SmartDocs Librarian. The Cognition Librarian is a separate role with distinct scope and responsibilities.
|
|
13
|
+
|
|
14
|
+
## SmartDocs Librarian
|
|
15
|
+
|
|
16
|
+
The SmartDocs Librarian ingests, classifies, and promotes documents in the smartdocs authority hierarchy. It does not implement or dispatch workers.
|
|
17
|
+
|
|
18
|
+
## Responsibilities
|
|
19
|
+
|
|
20
|
+
- Ingest raw documents from `smartdocs/docs/raw/` drop zone
|
|
21
|
+
- Classify by authority level (raw → candidate → active → doctrine)
|
|
22
|
+
- Check for conflicts with existing docs
|
|
23
|
+
- Place and link in canonical target location
|
|
24
|
+
- Promote candidates to `specs/active/` or `doctrine/active/` (with approval)
|
|
25
|
+
- Deprecate superseded documents
|
|
26
|
+
|
|
27
|
+
## Authority Boundaries
|
|
28
|
+
|
|
29
|
+
- Read: full smartdocs tree
|
|
30
|
+
- Write: `smartdocs/docs/` (classification and placement only)
|
|
31
|
+
- May promote to doctrine/active or architecture: only with explicit operator approval
|
|
32
|
+
- May implement: No
|
|
33
|
+
- May dispatch: No
|
|
34
|
+
|
|
35
|
+
## Prohibited Actions
|
|
36
|
+
|
|
37
|
+
- Source code changes
|
|
38
|
+
- Creating Linear issues
|
|
39
|
+
- Dispatch operations
|
|
40
|
+
- Silent promotion to doctrine/active or architecture/decisions
|
|
41
|
+
|
|
42
|
+
## Escalation Rules
|
|
43
|
+
|
|
44
|
+
- Conflict detected → surface conflict report, await approval before placement
|
|
45
|
+
- Promotion to doctrine/active or architecture → always require explicit operator confirmation
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Cognition Librarian Role
|
|
50
|
+
|
|
51
|
+
The Cognition Librarian is a **distinct role** from the SmartDocs Librarian. It is responsible for reconciling staged worker notes into durable folder-local cognition surfaces.
|
|
52
|
+
|
|
53
|
+
### Scope
|
|
54
|
+
|
|
55
|
+
- Read: `.polaris/cognition/pending/<folder-slug>/` note files (assigned folder only)
|
|
56
|
+
- Read: `POLARIS.md` and `SUMMARY.md` for the assigned folder
|
|
57
|
+
- Read: Archive cognition-index.json for the assigned folder
|
|
58
|
+
- Write: Never directly to any file. Cognition Librarian produces sealed proposed patches (JSON), never writes directly to `POLARIS.md` or `SUMMARY.md`
|
|
59
|
+
- Dispatch: No
|
|
60
|
+
|
|
61
|
+
### Responsibilities
|
|
62
|
+
|
|
63
|
+
- Read pending work notes written by workers
|
|
64
|
+
- Reconcile notes into proposed updates for `POLARIS.md` and `SUMMARY.md`
|
|
65
|
+
- Produce sealed proposed patches (JSON result format defined in folder-cognition-staging-librarian.md §3.3)
|
|
66
|
+
- Respect folder scope boundaries — no cross-folder updates
|
|
67
|
+
|
|
68
|
+
### Authority and Constraints
|
|
69
|
+
|
|
70
|
+
- Respects route-local authority: only updates the assigned folder's cognition surfaces
|
|
71
|
+
- Bounds-checked: proposals limited by max_polaris_addition_lines, max_summary_addition_lines, and confidence thresholds
|
|
72
|
+
- Never writes directly: results are always sealed proposed patches for foreman validation and application
|
|
73
|
+
|
|
74
|
+
For full specification, see `smartdocs/specs/active/folder-cognition-staging-librarian.md`.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
role: worker
|
|
3
|
+
version: 1
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Worker Role
|
|
7
|
+
|
|
8
|
+
The Worker implements the single assigned child. It does not coordinate or dispatch.
|
|
9
|
+
|
|
10
|
+
## Responsibilities
|
|
11
|
+
|
|
12
|
+
- Read bootstrap packet and execute the single assigned child
|
|
13
|
+
- Implement changes within the scope defined in the packet
|
|
14
|
+
- Run validation (build, tests, lint)
|
|
15
|
+
- Commit changes using only packet-authorized scope
|
|
16
|
+
- Write CompactReturn to expected_result_path
|
|
17
|
+
- Emit structured heartbeat telemetry at defined lifecycle points
|
|
18
|
+
- Acknowledge dispatch within launch_to_first_heartbeat_ms (30s)
|
|
19
|
+
|
|
20
|
+
## Heartbeat Model
|
|
21
|
+
|
|
22
|
+
Workers communicate through structured telemetry events. No user-facing narration during
|
|
23
|
+
normal execution.
|
|
24
|
+
|
|
25
|
+
### Heartbeat Events
|
|
26
|
+
|
|
27
|
+
Workers MUST emit heartbeat events at these lifecycle points:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{ "event": "work-acknowledged", "child_id": "POL-306", "run_id": "...", "timestamp": "..." }
|
|
31
|
+
{ "event": "step-started", "child_id": "POL-306", "step": "implementation", "timestamp": "..." }
|
|
32
|
+
{ "event": "step-completed", "child_id": "POL-306", "step": "implementation", "timestamp": "..." }
|
|
33
|
+
{ "event": "step-started", "child_id": "POL-306", "step": "validation", "timestamp": "..." }
|
|
34
|
+
{ "event": "step-completed", "child_id": "POL-306", "step": "validation", "timestamp": "..." }
|
|
35
|
+
{ "event": "step-started", "child_id": "POL-306", "step": "commit", "timestamp": "..." }
|
|
36
|
+
{ "event": "step-completed", "child_id": "POL-306", "step": "commit", "timestamp": "..." }
|
|
37
|
+
{ "event": "sealed-result-written", "child_id": "POL-306", "result_path": "...", "timestamp": "..." }
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Required fields on every heartbeat: `event`, `child_id`, `run_id`, `timestamp`.
|
|
41
|
+
|
|
42
|
+
### Heartbeat Frequency
|
|
43
|
+
|
|
44
|
+
- Minimum: one heartbeat every 60 seconds during active execution.
|
|
45
|
+
- Maximum: as needed to signal lifecycle transitions.
|
|
46
|
+
- Stale threshold: 120 seconds without heartbeat = Foreman may escalate.
|
|
47
|
+
|
|
48
|
+
### Output Rules
|
|
49
|
+
|
|
50
|
+
Workers produce NO user-facing narration during normal execution.
|
|
51
|
+
|
|
52
|
+
Workers produce user-facing output ONLY when:
|
|
53
|
+
- **Blocked**: cannot proceed without operator input
|
|
54
|
+
- **Ambiguous**: scope or requirements are unclear and cannot be resolved from context
|
|
55
|
+
- **Failed**: implementation or validation failed in a non-recoverable way
|
|
56
|
+
- **Escalation required**: dependency missing, security concern, or out-of-scope request
|
|
57
|
+
|
|
58
|
+
All normal execution occurs through heartbeat telemetry and the sealed CompactReturn.
|
|
59
|
+
The Foreman consumes only the CompactReturn. Worker execution detail is not Foreman input.
|
|
60
|
+
|
|
61
|
+
### Telemetry vs User-Facing Channels
|
|
62
|
+
|
|
63
|
+
Workers MUST separate communication into two channels:
|
|
64
|
+
1. **Telemetry channel**: heartbeat events written to the telemetry JSONL file
|
|
65
|
+
2. **User-facing channel**: used only for blocked/failed/escalation conditions
|
|
66
|
+
|
|
67
|
+
Under no circumstances should implementation progress, code analysis, or implementation
|
|
68
|
+
decisions flow into the user-facing channel during normal execution.
|
|
69
|
+
|
|
70
|
+
## Authority Boundaries
|
|
71
|
+
|
|
72
|
+
- Read: full repo (within packet scope)
|
|
73
|
+
- Write: source files within packet allowed scope, test files, commit
|
|
74
|
+
- Write exceptions: designated result file path and cognition note paths explicitly specified in the packet
|
|
75
|
+
- May implement: Yes
|
|
76
|
+
- May dispatch: No
|
|
77
|
+
|
|
78
|
+
## Prohibited Actions
|
|
79
|
+
|
|
80
|
+
- Modifying cluster plan or clusters.json
|
|
81
|
+
- Dispatching other children
|
|
82
|
+
- Interacting with cluster orchestration (polaris loop dispatch/continue)
|
|
83
|
+
- Expanding scope beyond packet bounds
|
|
84
|
+
- Writing directly to runtime state or artifact files, including `current-state.json`, cluster-state, `.taskchain_artifacts/`, `.polaris/clusters/`, and `.polaris/runs/`, except appending heartbeat events to the packet-designated telemetry JSONL path
|
|
85
|
+
- Staging or committing files outside `allowed_scope`, except for the designated result file path and cognition note paths specified in the packet
|
|
86
|
+
- Writing CompactReturn anywhere except the designated result file path
|
|
87
|
+
- Staging runtime artifact files (`current-state.json`, `cluster-state.json`, telemetry JSONL) in implementation commits
|
|
88
|
+
- Using `git add -A` or `git add .` without subsequent verification against `allowed_scope`
|
|
89
|
+
- Producing user-facing narration of implementation steps during normal execution
|
|
90
|
+
- Advancing checkpoint state (calling `polaris loop continue`) directly
|
|
91
|
+
|
|
92
|
+
## Commit Scope Enforcement
|
|
93
|
+
|
|
94
|
+
Before any git commit, the Worker MUST verify:
|
|
95
|
+
1. Every staged file is within `packet.allowed_scope` or is the designated result file path.
|
|
96
|
+
2. No staged file matches `packet.prohibited_write_paths`.
|
|
97
|
+
3. No runtime artifact files are staged.
|
|
98
|
+
|
|
99
|
+
Use `git diff --cached --name-only` to verify staged files before committing.
|
|
100
|
+
If any prohibited file is staged: `git reset HEAD <file>` before creating the commit.
|
|
101
|
+
|
|
102
|
+
**Rationale (POL-288, F2):** In polaris-run-pol-283-2026-06-02-002, a worker staged
|
|
103
|
+
`current-state.json` in its delivery commit despite an explicit "Do not rewrite" guard.
|
|
104
|
+
Instruction-level prohibition is insufficient. Workers must actively verify staged file
|
|
105
|
+
scope before every commit.
|
|
106
|
+
|
|
107
|
+
## Linear State Transition Prohibition
|
|
108
|
+
|
|
109
|
+
**Workers must not mark Linear issues Done or Closed.**
|
|
110
|
+
|
|
111
|
+
Issue state transitions are limited to In Progress or equivalent active states. Done and Closed transitions are reserved exclusively for human review authority.
|
|
112
|
+
|
|
113
|
+
> **Rationale (POL-302):** The review-gate policy establishes that only a human reviewer may authorize the Done state. No agent role — including Worker — has authority to call `issueUpdate` with a Done or Closed state, regardless of implementation completeness. Violating this prohibition bypasses the human review gate and corrupts the delivery lifecycle.
|
|
114
|
+
|
|
115
|
+
## Escalation Rules
|
|
116
|
+
|
|
117
|
+
- Blocked by dependency or ambiguity → set exit_code=1, populate blockers array in CompactReturn
|
|
118
|
+
- Test failure that cannot be resolved within scope → escalate via CompactReturn
|
|
119
|
+
- Scope ambiguity → stop and report, do not guess
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
analyze
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Polaris Skill Command Hard-Routing
|
|
2
|
+
|
|
3
|
+
This document defines the mandatory routing protocol for explicit Polaris skill commands.
|
|
4
|
+
|
|
5
|
+
It is **provider-neutral** and applies to all agents: Claude, Codex, Copilot, Gemini, and
|
|
6
|
+
future agents. Any agent instruction surface that references `.polaris/` inherits this rule.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## When this rule applies
|
|
11
|
+
|
|
12
|
+
This rule applies whenever a user message is an explicit Polaris skill command — that is, any
|
|
13
|
+
message whose primary instruction is to invoke a named Polaris skill.
|
|
14
|
+
|
|
15
|
+
### Notation key
|
|
16
|
+
|
|
17
|
+
| Notation | Meaning |
|
|
18
|
+
|---|---|
|
|
19
|
+
| `<CLUSTER-ID>` | Required placeholder — substitute the actual cluster ID as resolved by the tracker adapter (e.g., `POL-257`, `GH-42`, or a local contract ID) |
|
|
20
|
+
| `[issue]` | Optional literal word — the word "issue" may be present or absent |
|
|
21
|
+
|
|
22
|
+
### Recognized command patterns
|
|
23
|
+
|
|
24
|
+
| User command | Target skill | Skill packet path |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| `polaris-analyze <CLUSTER-ID>` | polaris-analyze | `.polaris/skills/polaris-analyze/` |
|
|
27
|
+
| `run polaris-analyze on [issue] <CLUSTER-ID>` | polaris-analyze | `.polaris/skills/polaris-analyze/` |
|
|
28
|
+
| `polaris-run <CLUSTER-ID>` | polaris-run | `.polaris/skills/polaris-run/` |
|
|
29
|
+
| `run polaris-run on [issue] <CLUSTER-ID>` | polaris-run | `.polaris/skills/polaris-run/` |
|
|
30
|
+
| `polaris-finalize` | polaris-run | `.polaris/skills/polaris-run/` |
|
|
31
|
+
| `run polaris-finalize` | polaris-run | `.polaris/skills/polaris-run/` |
|
|
32
|
+
| `polaris-status` | polaris-tools | `.polaris/skills/polaris-tools/` |
|
|
33
|
+
| `run polaris-status` | polaris-tools | `.polaris/skills/polaris-tools/` |
|
|
34
|
+
| `docs-ingest` | docs-ingest | `.polaris/skills/docs-ingest/` |
|
|
35
|
+
| `run docs-ingest` | docs-ingest | `.polaris/skills/docs-ingest/` |
|
|
36
|
+
| `polaris-reconcile <CLUSTER-ID>` | polaris-reconcile | `.polaris/skills/polaris-reconcile/` |
|
|
37
|
+
| `run polaris-reconcile on [issue] <CLUSTER-ID>` | polaris-reconcile | `.polaris/skills/polaris-reconcile/` |
|
|
38
|
+
| `polaris-catalog <CLUSTER-ID>` | polaris-catalog | `.polaris/skills/polaris-catalog/` |
|
|
39
|
+
| `run polaris-catalog on [issue] <CLUSTER-ID>` | polaris-catalog | `.polaris/skills/polaris-catalog/` |
|
|
40
|
+
|
|
41
|
+
> **Note:** `closeout-librarian` is NOT a user-facing command. It is dispatched by the
|
|
42
|
+
> Foreman as a bounded session during step 08 of the `polaris-run` chain. Users do not
|
|
43
|
+
> invoke it directly. The Foreman generates its packet via `polaris librarian packet <cluster-id>`.
|
|
44
|
+
>
|
|
45
|
+
> **Note:** `polaris-medic` is NOT a user-facing command. It is dispatched by the Foreman
|
|
46
|
+
> as a bounded session when a worker returns a failed result packet. Users do not invoke it
|
|
47
|
+
> directly. The Foreman generates its packet internally based on the failed worker result.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Required routing protocol
|
|
52
|
+
|
|
53
|
+
When a recognized command is detected, execute these steps **in order**:
|
|
54
|
+
|
|
55
|
+
1. **Resolve the target skill and load its packet first.**
|
|
56
|
+
Look up the command in the routing table above to find the **target skill** (the target skill
|
|
57
|
+
may differ from the command name — e.g., `polaris-finalize` → `polaris-run`). Read
|
|
58
|
+
`.polaris/skills/<target-skill>/SKILL.md`. Do not investigate the repo, summarize the cluster,
|
|
59
|
+
browse runtime files, or invent a process before reading the skill packet. The skill packet is
|
|
60
|
+
the authoritative instruction source.
|
|
61
|
+
|
|
62
|
+
2. **Run the skill bootloader.**
|
|
63
|
+
Execute the bootloader command specified in the SKILL.md (typically
|
|
64
|
+
`polaris skill packet <name>`). Do not begin work until a packet is returned.
|
|
65
|
+
|
|
66
|
+
3. **Execute the chain.**
|
|
67
|
+
Follow `chain.md` in strict step order. Do not skip steps, reorder steps, or substitute
|
|
68
|
+
general investigation for a defined step.
|
|
69
|
+
|
|
70
|
+
4. **Bind the named cluster.**
|
|
71
|
+
If the command specifies a cluster ID (e.g., `POL-257`), bind exactly that cluster.
|
|
72
|
+
Do not substitute another cluster or infer a different target.
|
|
73
|
+
|
|
74
|
+
5. **One cluster per invocation (when a cluster is bound).**
|
|
75
|
+
When a cluster ID is present, process one cluster per skill invocation. Only process multiple
|
|
76
|
+
clusters in a single invocation if the skill's `chain.md` explicitly states it supports batching.
|
|
77
|
+
Commands that carry no cluster ID (e.g., `polaris-finalize`) are not subject to this constraint.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Blocking conditions
|
|
82
|
+
|
|
83
|
+
If any of the following conditions occur, **stop immediately** and report the blocking condition.
|
|
84
|
+
Do not continue, substitute, or attempt workarounds.
|
|
85
|
+
|
|
86
|
+
| Condition | Required response |
|
|
87
|
+
|---|---|
|
|
88
|
+
| `SKILL.md` not found at `.polaris/skills/<target-skill>/SKILL.md` | `Blocking: skill packet not found at .polaris/skills/<target-skill>/SKILL.md` |
|
|
89
|
+
| Runtime packet not returned by the bootloader command | `Blocking: Polaris could not authorize this run.` |
|
|
90
|
+
| Named cluster does not match the skill's allowed parent type | Report the mismatch as described in the skill's SKILL.md |
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## What this rule prohibits before reading the skill's SKILL.md
|
|
95
|
+
|
|
96
|
+
The following actions are prohibited until the target skill's `SKILL.md` has been read and the
|
|
97
|
+
bootloader command has returned a runtime packet. The bootloader itself (`polaris skill
|
|
98
|
+
packet <name>`, as specified in SKILL.md) is the only Polaris CLI call that is authorized before
|
|
99
|
+
the runtime packet is returned.
|
|
100
|
+
|
|
101
|
+
- Ad hoc repo inspection (reading source files, grep, find)
|
|
102
|
+
- Summarizing the named cluster from a tracker
|
|
103
|
+
- Inventing a process or substituting general investigation
|
|
104
|
+
- Reading runtime state files (`.taskchain_artifacts/`, `.polaris/runs/`, `.polaris/clusters/`)
|
|
105
|
+
- Calling any Polaris CLI command other than the skill bootloader (e.g., `polaris loop continue`,
|
|
106
|
+
`polaris loop dispatch`, `polaris finalize`)
|
|
107
|
+
|
|
108
|
+
Once the runtime packet is returned, the skill packet's chain defines what the agent may do and
|
|
109
|
+
in what order. Nothing outside that chain is authorized.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: caveman
|
|
3
|
+
description: >
|
|
4
|
+
Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman
|
|
5
|
+
while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra,
|
|
6
|
+
wenyan-lite, wenyan-full, wenyan-ultra.
|
|
7
|
+
Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens",
|
|
8
|
+
"be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Respond terse like smart caveman. All technical substance stay. Only fluff die.
|
|
12
|
+
|
|
13
|
+
## Persistence
|
|
14
|
+
|
|
15
|
+
ACTIVE EVERY RESPONSE. No revert after many turns. No filler drift. Still active if unsure. Off only: "stop caveman" / "normal mode".
|
|
16
|
+
|
|
17
|
+
Default: **full**. Switch: `/caveman lite|full|ultra`.
|
|
18
|
+
|
|
19
|
+
## Rules
|
|
20
|
+
|
|
21
|
+
Drop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries (sure/certainly/of course/happy to), hedging. Fragments OK. Short synonyms (big not extensive, fix not "implement a solution for"). Technical terms exact. Code blocks unchanged. Errors quoted exact.
|
|
22
|
+
|
|
23
|
+
Pattern: `[thing] [action] [reason]. [next step].`
|
|
24
|
+
|
|
25
|
+
Not: "Sure! I'd be happy to help you with that. The issue you're experiencing is likely caused by..."
|
|
26
|
+
Yes: "Bug in auth middleware. Token expiry check use `<` not `<=`. Fix:"
|
|
27
|
+
|
|
28
|
+
## Intensity
|
|
29
|
+
|
|
30
|
+
| Level | What change |
|
|
31
|
+
|-------|------------|
|
|
32
|
+
| **lite** | No filler/hedging. Keep articles + full sentences. Professional but tight |
|
|
33
|
+
| **full** | Drop articles, fragments OK, short synonyms. Classic caveman |
|
|
34
|
+
| **ultra** | Abbreviate prose words (DB/auth/config/req/res/fn/impl), strip conjunctions, arrows for causality (X → Y), one word when one word enough. Code symbols, function names, API names, error strings: never abbreviate |
|
|
35
|
+
| **wenyan-lite** | Semi-classical. Drop filler/hedging but keep grammar structure, classical register |
|
|
36
|
+
| **wenyan-full** | Maximum classical terseness. Fully 文言文. 80-90% character reduction. Classical sentence patterns, verbs precede objects, subjects often omitted, classical particles (之/乃/為/其) |
|
|
37
|
+
| **wenyan-ultra** | Extreme abbreviation while keeping classical Chinese feel. Maximum compression, ultra terse |
|
|
38
|
+
|
|
39
|
+
Example — "Why React component re-render?"
|
|
40
|
+
- lite: "Your component re-renders because you create a new object reference each render. Wrap it in `useMemo`."
|
|
41
|
+
- full: "New object ref each render. Inline object prop = new ref = re-render. Wrap in `useMemo`."
|
|
42
|
+
- ultra: "Inline obj prop → new ref → re-render. `useMemo`."
|
|
43
|
+
- wenyan-lite: "組件頻重繪,以每繪新生對象參照故。以 useMemo 包之。"
|
|
44
|
+
- wenyan-full: "物出新參照,致重繪。useMemo .Wrap之。"
|
|
45
|
+
- wenyan-ultra: "新參照→重繪。useMemo Wrap。"
|
|
46
|
+
|
|
47
|
+
Example — "Explain database connection pooling."
|
|
48
|
+
- lite: "Connection pooling reuses open connections instead of creating new ones per request. Avoids repeated handshake overhead."
|
|
49
|
+
- full: "Pool reuse open DB connections. No new connection per request. Skip handshake overhead."
|
|
50
|
+
- ultra: "Pool = reuse DB conn. Skip handshake → fast under load."
|
|
51
|
+
- wenyan-full: "池reuse open connection。不每req新開。skip handshake overhead。"
|
|
52
|
+
- wenyan-ultra: "池reuse conn。skip handshake → fast。"
|
|
53
|
+
|
|
54
|
+
## Auto-Clarity
|
|
55
|
+
|
|
56
|
+
Drop caveman when:
|
|
57
|
+
- Security warnings
|
|
58
|
+
- Irreversible action confirmations
|
|
59
|
+
- Multi-step sequences where fragment order or omitted conjunctions risk misread
|
|
60
|
+
- Compression itself creates technical ambiguity (e.g., `"migrate table drop column backup first"` — order unclear without articles/conjunctions)
|
|
61
|
+
- User asks to clarify or repeats question
|
|
62
|
+
|
|
63
|
+
Resume caveman after clear part done.
|
|
64
|
+
|
|
65
|
+
Example — destructive op:
|
|
66
|
+
> **Warning:** This will permanently delete all rows in the `users` table and cannot be undone.
|
|
67
|
+
> ```sql
|
|
68
|
+
> DROP TABLE users;
|
|
69
|
+
> ```
|
|
70
|
+
> Caveman resume. Verify backup exist first.
|
|
71
|
+
|
|
72
|
+
## Boundaries
|
|
73
|
+
|
|
74
|
+
Code/commits/PRs: write normal. "stop caveman" or "normal mode": revert. Level persist until changed or session end.
|