@lsctech/polaris 0.3.22 → 0.3.24
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 +13 -0
- package/dist/cli/adopt-genesis.js +85 -4
- package/dist/cli/adopt-instructions.js +3 -3
- package/dist/cli/adopt-report.js +15 -1
- package/dist/cli/adopt-rules.js +44 -8
- package/dist/cli/adopt-workspace.js +2 -2
- package/dist/cli/adoption-inventory.js +5 -2
- package/dist/cli/init.js +5 -4
- package/dist/config/provider-detect.js +19 -2
- package/dist/workspace/.polaris/skills/ROUTING.md +4 -0
- package/dist/workspace/.polaris/skills/closeout-librarian/POLARIS.md +9 -8
- package/dist/workspace/.polaris/skills/docs-ingest/SKILL.md +2 -2
- package/dist/workspace/.polaris/skills/docs-ingest/chain.md +1 -1
- package/dist/workspace/.polaris/skills/docs-ingest/steps/04-place-and-link.md +5 -5
- package/dist/workspace/.polaris/skills/docs-ingest/steps/05-finalize-ingest.md +1 -1
- package/dist/workspace/.polaris/skills/docs-promote/SKILL.md +6 -6
- package/dist/workspace/.polaris/skills/docs-promote/chain.md +5 -5
- package/dist/workspace/.polaris/skills/docs-promote/steps/04-conflict-surface.md +1 -1
- package/dist/workspace/.polaris/skills/docs-promote/steps/06-execute-promote-deprecate.md +3 -3
- package/dist/workspace/{workspace/.polaris → .polaris}/skills/docs-review/SKILL.md +1 -1
- package/dist/workspace/{workspace/.polaris → .polaris}/skills/docs-triage/SKILL.md +1 -1
- package/dist/workspace/{workspace/.polaris → .polaris}/skills/docs-triage/chain.md +1 -1
- package/dist/workspace/.polaris/skills/polaris-analyze/SKILL.md +1 -1
- package/dist/workspace/.polaris/skills/polaris-analyze/chain.md +2 -2
- package/dist/workspace/.polaris/skills/polaris-analyze/issue-reconciliation.md +1 -1
- package/dist/workspace/.polaris/skills/polaris-analyze/linked-skills/repo-analysis.md +3 -4
- package/dist/workspace/.polaris/skills/polaris-analyze/steps/02-map-affected-code.md +2 -2
- package/dist/workspace/.polaris/skills/polaris-catalog/SKILL.md +5 -5
- package/dist/workspace/.polaris/skills/polaris-catalog/chain.md +3 -3
- package/dist/workspace/.polaris/skills/polaris-catalog/steps/04-classify-and-place.md +3 -3
- package/dist/workspace/.polaris/skills/polaris-reconcile/SKILL.md +2 -2
- package/dist/workspace/.polaris/skills/polaris-run/SKILL.md +2 -2
- package/dist/workspace/.polaris/skills/polaris-run/chain.md +17 -17
- package/dist/workspace/.polaris/skills/polaris-run/linked-skills/repo-analysis.md +3 -4
- package/dist/workspace/.polaris/skills/polaris-run/steps/01-orient-cluster.md +3 -3
- package/dist/workspace/.polaris/skills/polaris-run/steps/03-select-child.md +1 -1
- package/dist/workspace/.polaris/skills/polaris-run/steps/06-commit-and-update-linear.md +2 -2
- package/dist/workspace/.polaris/skills/polaris-run/steps/07-decide-continuation.md +3 -3
- package/dist/workspace/.polaris/skills/polaris-run/steps/08-closeout-librarian.md +1 -1
- package/dist/workspace/.polaris/skills/polaris-run/steps/08-final-delivery.md +2 -2
- package/dist/workspace/.polaris/skills/polaris-run/steps/09-final-delivery.md +1 -1
- package/dist/workspace/.polaris/skills/polaris-tools/README.md +1 -1
- package/dist/workspace/.polaris/skills/polaris-tools/SKILL.md +1 -1
- package/dist/workspace/POLARIS_RULES.md +169 -0
- package/package.json +3 -2
- package/dist/workspace/workspace/.polaris/roles/analyst.md +0 -38
- package/dist/workspace/workspace/.polaris/roles/closeout-librarian.md +0 -122
- package/dist/workspace/workspace/.polaris/roles/cognition-librarian.md +0 -37
- package/dist/workspace/workspace/.polaris/roles/finalizer.md +0 -45
- package/dist/workspace/workspace/.polaris/roles/foreman.md +0 -165
- package/dist/workspace/workspace/.polaris/roles/librarian.md +0 -74
- package/dist/workspace/workspace/.polaris/roles/worker.md +0 -119
- package/dist/workspace/workspace/.polaris/session-type +0 -1
- package/dist/workspace/workspace/.polaris/skills/ROUTING.md +0 -113
- package/dist/workspace/workspace/.polaris/skills/caveman/SKILL.md +0 -74
- package/dist/workspace/workspace/.polaris/skills/caveman-compress/scripts/compress.py +0 -272
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/POLARIS.md +0 -46
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/SKILL.md +0 -59
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/chain.md +0 -116
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/01-load-cluster-context.md +0 -78
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/02-drift-reconciliation.md +0 -157
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/03-reconcile-polaris-md.md +0 -93
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/04-reconcile-summary-md.md +0 -106
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/05-doc-ingestion.md +0 -114
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/06-link-validation.md +0 -128
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/07-yaml-linking.md +0 -95
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/08-librarian-commit.md +0 -119
- package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/09-sealed-result.md +0 -118
- package/dist/workspace/workspace/.polaris/skills/docs-ingest/SKILL.md +0 -68
- package/dist/workspace/workspace/.polaris/skills/docs-ingest/chain.json +0 -23
- package/dist/workspace/workspace/.polaris/skills/docs-ingest/chain.md +0 -149
- package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/01-orient-ingest.md +0 -85
- package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/02-classify-batch.md +0 -87
- package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/03-conflict-check.md +0 -66
- package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/04-place-and-link.md +0 -77
- package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/05-finalize-ingest.md +0 -49
- package/dist/workspace/workspace/.polaris/skills/docs-promote/SKILL.md +0 -79
- package/dist/workspace/workspace/.polaris/skills/docs-promote/chain.json +0 -25
- package/dist/workspace/workspace/.polaris/skills/docs-promote/chain.md +0 -80
- package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/01-orient-promote.md +0 -53
- package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/02-review-candidates.md +0 -51
- package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/03-read-linked-code.md +0 -50
- package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/04-conflict-surface.md +0 -65
- package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/05-await-approval.md +0 -61
- package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/06-execute-promote-deprecate.md +0 -65
- package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/07-finalize-promote.md +0 -44
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/SKILL.md +0 -94
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/chain.json +0 -20
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/chain.md +0 -105
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/issue-reconciliation.md +0 -149
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/issue-template.md +0 -133
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/linked-skills/repo-analysis.md +0 -55
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/01-fetch-and-orient.md +0 -79
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/02-map-affected-code.md +0 -58
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/03-assess-issue.md +0 -58
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/04-blocker-check.md +0 -60
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/05-create-cluster-plan.md +0 -197
- package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/06-final-report.md +0 -60
- package/dist/workspace/workspace/.polaris/skills/polaris-catalog/SKILL.md +0 -91
- package/dist/workspace/workspace/.polaris/skills/polaris-catalog/chain.json +0 -22
- package/dist/workspace/workspace/.polaris/skills/polaris-catalog/chain.md +0 -85
- package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/01-orient-catalog.md +0 -92
- package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/02-reconcile-polaris-md.md +0 -33
- package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/03-reconcile-summary-md.md +0 -70
- package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/04-classify-and-place.md +0 -117
- package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/05-catalog-commit.md +0 -94
- package/dist/workspace/workspace/.polaris/skills/polaris-medic/SKILL.md +0 -52
- package/dist/workspace/workspace/.polaris/skills/polaris-medic/chain.md +0 -111
- package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/01-orient-medic.md +0 -75
- package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/02-diagnose.md +0 -79
- package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/03-repair.md +0 -64
- package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/04-validate.md +0 -66
- package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/05-create-chart.md +0 -85
- package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/06-closeout.md +0 -86
- package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/SKILL.md +0 -75
- package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/chain.json +0 -20
- package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/chain.md +0 -67
- package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/01-orient-reconcile.md +0 -82
- package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/02-reconcile-polaris-md.md +0 -95
- package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/03-reconcile-summary-md.md +0 -108
- package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/04-reconcile-commit.md +0 -88
- package/dist/workspace/workspace/.polaris/skills/polaris-run/SKILL.md +0 -135
- package/dist/workspace/workspace/.polaris/skills/polaris-run/chain.json +0 -19
- package/dist/workspace/workspace/.polaris/skills/polaris-run/chain.md +0 -298
- package/dist/workspace/workspace/.polaris/skills/polaris-run/execution-adapter.md +0 -34
- package/dist/workspace/workspace/.polaris/skills/polaris-run/linked-skills/repo-analysis.md +0 -58
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/01-orient-cluster.md +0 -96
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/02-prepare-branch.md +0 -53
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/03-select-child.md +0 -63
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/04-execute-child.md +0 -75
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/05-validate-child.md +0 -57
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/06-commit-and-update-linear.md +0 -74
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/07-decide-continuation.md +0 -89
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/08-closeout-librarian.md +0 -146
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/08-final-delivery.md +0 -91
- package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/09-final-delivery.md +0 -104
- package/dist/workspace/workspace/.polaris/skills/polaris-tools/README.md +0 -63
- package/dist/workspace/workspace/.polaris/skills/polaris-tools/SKILL.md +0 -94
- package/dist/workspace/workspace/.polaris/skills/polaris-tools/tools.js +0 -191
- 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/dist/workspace/{workspace/.polaris → .polaris}/skills/docs-review/chain.md +0 -0
package/dist/cli/adopt-assets.js
CHANGED
|
@@ -155,6 +155,19 @@ function installWorkspaceAssets(repoRoot, workspaceDir) {
|
|
|
155
155
|
const smartdocsPreExisted = (0, node_fs_1.existsSync)(dstSmartdocs);
|
|
156
156
|
installSmartdocsDir(srcSmartdocs, dstSmartdocs, "smartdocs", installed, alreadyPresent, smartdocsPreExisted);
|
|
157
157
|
}
|
|
158
|
+
// 5. POLARIS_RULES.md template
|
|
159
|
+
const rulesRel = "POLARIS_RULES.md";
|
|
160
|
+
const srcRules = (0, node_path_1.join)(workspaceDir, rulesRel);
|
|
161
|
+
const dstRules = (0, node_path_1.join)(repoRoot, rulesRel);
|
|
162
|
+
if ((0, node_fs_1.existsSync)(srcRules)) {
|
|
163
|
+
if ((0, node_fs_1.existsSync)(dstRules)) {
|
|
164
|
+
alreadyPresent.push(rulesRel);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
(0, node_fs_1.copyFileSync)(srcRules, dstRules);
|
|
168
|
+
installed.push(rulesRel);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
158
171
|
return { installed, alreadyPresent, skipped, conflicted };
|
|
159
172
|
}
|
|
160
173
|
function runGraphBuild(repoRoot) {
|
|
@@ -9,16 +9,69 @@ const AGENT_FILES = ["CLAUDE.md", "AGENTS.md", ".github/copilot-instructions.md"
|
|
|
9
9
|
function formatDate(d) {
|
|
10
10
|
return d.toISOString().slice(0, 10);
|
|
11
11
|
}
|
|
12
|
+
function isAlreadyPointer(content) {
|
|
13
|
+
// isThinPointer checks for POLARIS.md; also accept POLARIS_RULES.md references
|
|
14
|
+
if ((0, adopt_assets_js_1.isThinPointer)(content))
|
|
15
|
+
return true;
|
|
16
|
+
// Check for POLARIS_RULES.md thin pointer (≤3 meaningful lines + POLARIS_RULES.md reference)
|
|
17
|
+
const lines = content.split("\n");
|
|
18
|
+
const meaningfulLines = lines.filter((line) => {
|
|
19
|
+
const trimmed = line.trim();
|
|
20
|
+
if (!trimmed)
|
|
21
|
+
return false;
|
|
22
|
+
if (/^<!--.*-->$/.test(trimmed))
|
|
23
|
+
return false;
|
|
24
|
+
return true;
|
|
25
|
+
});
|
|
26
|
+
return meaningfulLines.length <= 3 && meaningfulLines.some((line) => line.includes("POLARIS_RULES.md"));
|
|
27
|
+
}
|
|
28
|
+
function appendGenesisProvenance(repoRoot, records) {
|
|
29
|
+
if (records.length === 0)
|
|
30
|
+
return;
|
|
31
|
+
const provenancePath = (0, node_path_1.join)(repoRoot, ".polaris", "adoption-provenance.json");
|
|
32
|
+
(0, node_fs_1.mkdirSync)((0, node_path_1.join)(repoRoot, ".polaris"), { recursive: true });
|
|
33
|
+
let existing = {};
|
|
34
|
+
if ((0, node_fs_1.existsSync)(provenancePath)) {
|
|
35
|
+
try {
|
|
36
|
+
const parsed = JSON.parse((0, node_fs_1.readFileSync)(provenancePath, "utf-8"));
|
|
37
|
+
if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
|
|
38
|
+
existing = parsed;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
existing = {};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const prior = Array.isArray(existing.genesis_reconcile_actions)
|
|
46
|
+
? existing.genesis_reconcile_actions
|
|
47
|
+
: [];
|
|
48
|
+
const updated = {
|
|
49
|
+
...existing,
|
|
50
|
+
updated_at: new Date().toISOString(),
|
|
51
|
+
genesis_reconcile_actions: [...prior, ...records],
|
|
52
|
+
};
|
|
53
|
+
(0, node_fs_1.writeFileSync)(provenancePath, `${JSON.stringify(updated, null, 2)}\n`, "utf-8");
|
|
54
|
+
}
|
|
12
55
|
async function reconcileAgentFiles(repoRoot, options) {
|
|
13
56
|
const results = [];
|
|
57
|
+
const provenanceRecords = [];
|
|
58
|
+
const now = options?.now ?? new Date();
|
|
59
|
+
const timestamp = now.toISOString();
|
|
14
60
|
for (const file of AGENT_FILES) {
|
|
15
61
|
const filePath = (0, node_path_1.join)(repoRoot, file);
|
|
16
62
|
if (!(0, node_fs_1.existsSync)(filePath)) {
|
|
17
63
|
continue;
|
|
18
64
|
}
|
|
19
65
|
const content = (0, node_fs_1.readFileSync)(filePath, "utf8");
|
|
20
|
-
if ((
|
|
66
|
+
if (isAlreadyPointer(content)) {
|
|
21
67
|
results.push({ file, outcome: "already-present" });
|
|
68
|
+
provenanceRecords.push({
|
|
69
|
+
source_path: file,
|
|
70
|
+
backup_path: null,
|
|
71
|
+
decision: "already-pointer",
|
|
72
|
+
timestamp,
|
|
73
|
+
migration_outcome: "already-present",
|
|
74
|
+
});
|
|
22
75
|
continue;
|
|
23
76
|
}
|
|
24
77
|
const rl = (0, promises_1.createInterface)({ input: process.stdin, output: process.stdout });
|
|
@@ -31,9 +84,16 @@ async function reconcileAgentFiles(repoRoot, options) {
|
|
|
31
84
|
}
|
|
32
85
|
const trimmed = answer.trim().toLowerCase();
|
|
33
86
|
if (trimmed === "n" || trimmed === "no") {
|
|
34
|
-
const pointer = `<!-- See [
|
|
87
|
+
const pointer = `<!-- See [POLARIS_RULES.md](POLARIS_RULES.md) for repo instructions -->\n`;
|
|
35
88
|
(0, node_fs_1.writeFileSync)(filePath, pointer + content, "utf8");
|
|
36
89
|
results.push({ file, outcome: "refused" });
|
|
90
|
+
provenanceRecords.push({
|
|
91
|
+
source_path: file,
|
|
92
|
+
backup_path: null,
|
|
93
|
+
decision: "refused-compression",
|
|
94
|
+
timestamp,
|
|
95
|
+
migration_outcome: "refused",
|
|
96
|
+
});
|
|
37
97
|
continue;
|
|
38
98
|
}
|
|
39
99
|
// Accepted — attempt compression
|
|
@@ -41,6 +101,13 @@ async function reconcileAgentFiles(repoRoot, options) {
|
|
|
41
101
|
if (!apiKey) {
|
|
42
102
|
process.stderr.write(`Warning: ANTHROPIC_API_KEY not found. Skipping compression of ${file}.\n`);
|
|
43
103
|
results.push({ file, outcome: "skipped" });
|
|
104
|
+
provenanceRecords.push({
|
|
105
|
+
source_path: file,
|
|
106
|
+
backup_path: null,
|
|
107
|
+
decision: "skipped-no-api-key",
|
|
108
|
+
timestamp,
|
|
109
|
+
migration_outcome: "skipped",
|
|
110
|
+
});
|
|
44
111
|
continue;
|
|
45
112
|
}
|
|
46
113
|
let Anthropic;
|
|
@@ -52,6 +119,13 @@ async function reconcileAgentFiles(repoRoot, options) {
|
|
|
52
119
|
catch {
|
|
53
120
|
process.stderr.write(`Warning: @anthropic-ai/sdk not installed. Skipping compression of ${file}.\n`);
|
|
54
121
|
results.push({ file, outcome: "skipped" });
|
|
122
|
+
provenanceRecords.push({
|
|
123
|
+
source_path: file,
|
|
124
|
+
backup_path: null,
|
|
125
|
+
decision: "skipped-no-sdk",
|
|
126
|
+
timestamp,
|
|
127
|
+
migration_outcome: "skipped",
|
|
128
|
+
});
|
|
55
129
|
continue;
|
|
56
130
|
}
|
|
57
131
|
const client = new Anthropic({ apiKey });
|
|
@@ -69,16 +143,23 @@ async function reconcileAgentFiles(repoRoot, options) {
|
|
|
69
143
|
.filter((b) => b.type === "text")
|
|
70
144
|
.map((b) => b.text)
|
|
71
145
|
.join("\n");
|
|
72
|
-
const now = options?.now ?? new Date();
|
|
73
146
|
const dateStr = formatDate(now);
|
|
74
147
|
const genesisPath = `smartdocs/doctrine/active/${dateStr}-genesis-agent-doctrine.md`;
|
|
75
148
|
const genesisFullPath = (0, node_path_1.join)(repoRoot, genesisPath);
|
|
76
149
|
(0, node_fs_1.mkdirSync)((0, node_path_1.join)(repoRoot, "smartdocs/doctrine/active"), { recursive: true });
|
|
77
150
|
(0, node_fs_1.writeFileSync)(genesisFullPath, distilled, "utf8");
|
|
78
|
-
const thinPointer = `# Agent Instructions\n\nRead [
|
|
151
|
+
const thinPointer = `# Agent Instructions\n\nRead [POLARIS_RULES.md](POLARIS_RULES.md) before beginning any work.\n\n` +
|
|
79
152
|
`<!-- genesis doctrine archived: ${genesisPath} -->\n`;
|
|
80
153
|
(0, node_fs_1.writeFileSync)(filePath, thinPointer, "utf8");
|
|
81
154
|
results.push({ file, outcome: "compressed", genesisPath });
|
|
155
|
+
provenanceRecords.push({
|
|
156
|
+
source_path: file,
|
|
157
|
+
backup_path: genesisPath,
|
|
158
|
+
decision: "accepted-compression",
|
|
159
|
+
timestamp,
|
|
160
|
+
migration_outcome: "compressed",
|
|
161
|
+
});
|
|
82
162
|
}
|
|
163
|
+
appendGenesisProvenance(repoRoot, provenanceRecords);
|
|
83
164
|
return results;
|
|
84
165
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.handleInstructionFiles = handleInstructionFiles;
|
|
4
4
|
const node_fs_1 = require("node:fs");
|
|
5
5
|
const node_path_1 = require("node:path");
|
|
6
|
-
const DELEGATION_MARKERS = ["<!-- polaris:delegate", "POLARIS.md", "Polaris runtime"];
|
|
6
|
+
const DELEGATION_MARKERS = ["<!-- polaris:delegate", "POLARIS_RULES.md", "POLARIS.md", "Polaris runtime"];
|
|
7
7
|
function isSupportedInstructionPath(path) {
|
|
8
8
|
return (path === "CLAUDE.md" ||
|
|
9
9
|
path === "AGENTS.md" ||
|
|
@@ -102,7 +102,7 @@ function appendInstructionProvenance(repoRoot, records) {
|
|
|
102
102
|
}
|
|
103
103
|
function handleInstructionFiles(plan, inventory, repoRoot) {
|
|
104
104
|
if (plan.dry_run) {
|
|
105
|
-
return Promise.resolve();
|
|
105
|
+
return Promise.resolve([]);
|
|
106
106
|
}
|
|
107
107
|
const doctrineExists = hasDoctrine(repoRoot);
|
|
108
108
|
const now = new Date().toISOString();
|
|
@@ -138,5 +138,5 @@ function handleInstructionFiles(plan, inventory, repoRoot) {
|
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
140
|
appendInstructionProvenance(repoRoot, provenance);
|
|
141
|
-
return Promise.resolve();
|
|
141
|
+
return Promise.resolve(provenance);
|
|
142
142
|
}
|
package/dist/cli/adopt-report.js
CHANGED
|
@@ -6,7 +6,7 @@ exports.printAdoptionReport = printAdoptionReport;
|
|
|
6
6
|
const node_fs_1 = require("node:fs");
|
|
7
7
|
const node_path_1 = require("node:path");
|
|
8
8
|
function buildAdoptionReport(options) {
|
|
9
|
-
const { install, graph, agents, now } = options;
|
|
9
|
+
const { install, graph, agents, instructionMigration, now } = options;
|
|
10
10
|
const timestamp = (now ?? new Date()).toISOString();
|
|
11
11
|
return {
|
|
12
12
|
timestamp,
|
|
@@ -18,6 +18,7 @@ function buildAdoptionReport(options) {
|
|
|
18
18
|
graphDetail: graph.stdout ?? graph.reason,
|
|
19
19
|
graphFollowUp: graph.followUpCommand,
|
|
20
20
|
agents,
|
|
21
|
+
instructionMigration: instructionMigration ?? [],
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
24
|
function writeAdoptionReport(repoRoot, report) {
|
|
@@ -56,6 +57,19 @@ function printAdoptionReport(report) {
|
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
console.log("");
|
|
60
|
+
console.log("Instruction Migration:");
|
|
61
|
+
if (report.instructionMigration.length === 0) {
|
|
62
|
+
console.log(" (none)");
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
for (const record of report.instructionMigration) {
|
|
66
|
+
console.log(` ${record.source_path}: ${record.decision}`);
|
|
67
|
+
if (record.backup_path) {
|
|
68
|
+
console.log(` -> archived to ${record.backup_path}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
console.log("");
|
|
59
73
|
console.log("Graph Build:");
|
|
60
74
|
console.log(` Status: ${report.graphStatus}`);
|
|
61
75
|
if (report.graphDetail) {
|
package/dist/cli/adopt-rules.js
CHANGED
|
@@ -15,14 +15,12 @@ function buildRepoOverview(inventory) {
|
|
|
15
15
|
}
|
|
16
16
|
return lines.join(" ").trim() || "Repository managed by Polaris.";
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const overview = buildRepoOverview(inventory);
|
|
25
|
-
const content = [
|
|
18
|
+
function buildContentFromTemplate(templatePath, overview) {
|
|
19
|
+
const template = (0, node_fs_1.readFileSync)(templatePath, "utf-8");
|
|
20
|
+
return template.replace("{{REPO_OVERVIEW}}", overview);
|
|
21
|
+
}
|
|
22
|
+
function buildContentInline(overview) {
|
|
23
|
+
return [
|
|
26
24
|
"# Polaris Rules",
|
|
27
25
|
"",
|
|
28
26
|
"> This file is the single shared governance source for this Polaris-managed repository.",
|
|
@@ -130,6 +128,28 @@ async function generatePolarisRules(repoRoot, inventory, options = {}) {
|
|
|
130
128
|
"",
|
|
131
129
|
"---",
|
|
132
130
|
"",
|
|
131
|
+
"## Graph Navigation",
|
|
132
|
+
"",
|
|
133
|
+
"Polaris maintains a code-intelligence graph for this repository.",
|
|
134
|
+
"Use Polaris graph commands as the primary code-intelligence path.",
|
|
135
|
+
"Fall back to `rg` (ripgrep) and direct file inspection when the graph is unavailable.",
|
|
136
|
+
"",
|
|
137
|
+
"Primary commands:",
|
|
138
|
+
"```",
|
|
139
|
+
"polaris graph build",
|
|
140
|
+
"polaris graph query <symbol-or-file>",
|
|
141
|
+
"polaris graph impact <symbol-or-file>",
|
|
142
|
+
"polaris map query <path>",
|
|
143
|
+
"```",
|
|
144
|
+
"",
|
|
145
|
+
"Fallback (graph unavailable):",
|
|
146
|
+
"- `rg <pattern>` for symbol and pattern search",
|
|
147
|
+
"- Direct file inspection for structure and content",
|
|
148
|
+
"",
|
|
149
|
+
"Never prefer an external repo-analysis tool over Polaris graph for Polaris-managed repos.",
|
|
150
|
+
"",
|
|
151
|
+
"---",
|
|
152
|
+
"",
|
|
133
153
|
"## Tracker-Agnostic Work Intake",
|
|
134
154
|
"",
|
|
135
155
|
"Work identifiers are opaque to the model. Polaris is tracker-agnostic.",
|
|
@@ -165,6 +185,22 @@ async function generatePolarisRules(repoRoot, inventory, options = {}) {
|
|
|
165
185
|
"Do not assume global repository context unless explicitly provided by the runtime.",
|
|
166
186
|
"",
|
|
167
187
|
].join("\n");
|
|
188
|
+
}
|
|
189
|
+
async function generatePolarisRules(repoRoot, inventory, options = {}) {
|
|
190
|
+
const { overwrite = false, workspaceDir } = options;
|
|
191
|
+
const outputPath = (0, node_path_1.join)(repoRoot, "POLARIS_RULES.md");
|
|
192
|
+
if ((0, node_fs_1.existsSync)(outputPath) && !overwrite) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const overview = buildRepoOverview(inventory);
|
|
196
|
+
let content;
|
|
197
|
+
const templatePath = workspaceDir ? (0, node_path_1.join)(workspaceDir, "POLARIS_RULES.md") : undefined;
|
|
198
|
+
if (templatePath && (0, node_fs_1.existsSync)(templatePath)) {
|
|
199
|
+
content = buildContentFromTemplate(templatePath, overview);
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
content = buildContentInline(overview);
|
|
203
|
+
}
|
|
168
204
|
const dir = (0, node_path_1.dirname)(outputPath);
|
|
169
205
|
(0, node_fs_1.mkdirSync)(dir, { recursive: true });
|
|
170
206
|
(0, node_fs_1.writeFileSync)(outputPath, content, "utf-8");
|
|
@@ -71,7 +71,7 @@ function buildAgentPointer() {
|
|
|
71
71
|
"# Agent Instructions",
|
|
72
72
|
"",
|
|
73
73
|
"This repository is managed by Polaris.",
|
|
74
|
-
"Read [
|
|
74
|
+
"Read [POLARIS_RULES.md](POLARIS_RULES.md) before beginning any work.",
|
|
75
75
|
"",
|
|
76
76
|
].join("\n");
|
|
77
77
|
}
|
|
@@ -80,7 +80,7 @@ function buildCopilotPointer() {
|
|
|
80
80
|
"# Copilot Instructions",
|
|
81
81
|
"",
|
|
82
82
|
"This repository is managed by Polaris.",
|
|
83
|
-
"Read [
|
|
83
|
+
"Read [POLARIS_RULES.md](../../POLARIS_RULES.md) before beginning any work.",
|
|
84
84
|
"",
|
|
85
85
|
].join("\n");
|
|
86
86
|
}
|
|
@@ -204,7 +204,9 @@ function detectAgentInstructionFiles(repoRoot, entries, doctrineExists) {
|
|
|
204
204
|
return null;
|
|
205
205
|
}
|
|
206
206
|
const content = safeRead((0, node_path_1.join)(repoRoot, entry.path));
|
|
207
|
-
const hasPolarisDelegation = content.includes("<!-- polaris:delegate") ||
|
|
207
|
+
const hasPolarisDelegation = content.includes("<!-- polaris:delegate") ||
|
|
208
|
+
content.toLowerCase().includes("polaris.md") ||
|
|
209
|
+
content.includes("POLARIS_RULES.md");
|
|
208
210
|
const recommendation = recommendationForInstruction(hasPolarisDelegation, doctrineExists, entry.sizeBytes);
|
|
209
211
|
return {
|
|
210
212
|
path: entry.path,
|
|
@@ -322,7 +324,8 @@ function scanAdoptionInventory(repoRoot, options = {}) {
|
|
|
322
324
|
const generatedRoots = detectRoots(allEntries, GENERATED_ROOT_HINTS);
|
|
323
325
|
const cacheRoots = detectRoots(allEntries, CACHE_ROOT_HINTS);
|
|
324
326
|
const fixtureRoots = detectRoots(allEntries, FIXTURE_ROOT_HINTS);
|
|
325
|
-
const doctrineExists = (0, node_fs_1.existsSync)((0, node_path_1.join)(repoRoot, "POLARIS.md"))
|
|
327
|
+
const doctrineExists = (0, node_fs_1.existsSync)((0, node_path_1.join)(repoRoot, "POLARIS.md")) ||
|
|
328
|
+
(0, node_fs_1.existsSync)((0, node_path_1.join)(repoRoot, "POLARIS_RULES.md"));
|
|
326
329
|
const inventory = {
|
|
327
330
|
scan_date: now.toISOString(),
|
|
328
331
|
repo_state: detectRepoState(repoRoot, topLevelEntries),
|
package/dist/cli/init.js
CHANGED
|
@@ -498,13 +498,14 @@ async function runInit(options = {}) {
|
|
|
498
498
|
}
|
|
499
499
|
void (options.generateFolderCognition ?? adopt_cognition_js_1.generateFolderCognition)(adoptionArtifacts.plan, inventory, repoRoot);
|
|
500
500
|
process.stdout.write("Folder cognition generation step completed.\n");
|
|
501
|
-
(
|
|
502
|
-
|
|
503
|
-
// Phase B — install bundled workspace assets
|
|
501
|
+
// Phase B — install bundled workspace assets (including POLARIS_RULES.md) before instruction
|
|
502
|
+
// file handling so that hasDoctrine() sees POLARIS_RULES.md during instruction classification.
|
|
504
503
|
const installFn = options.installWorkspaceAssets ?? adopt_assets_js_1.installWorkspaceAssets;
|
|
505
504
|
const workspaceDir = (0, node_path_1.resolve)(__dirname, "../workspace");
|
|
506
505
|
const installResult = installFn(repoRoot, workspaceDir);
|
|
507
506
|
process.stdout.write(`Workspace assets installed: ${installResult.installed.length} installed, ${installResult.alreadyPresent.length} already present.\n`);
|
|
507
|
+
const instructionResults = await (0, adopt_instructions_js_1.handleInstructionFiles)(adoptionArtifacts.plan, inventory, repoRoot);
|
|
508
|
+
process.stdout.write("Instruction file handling step completed.\n");
|
|
508
509
|
const finalizeAdoptionFn = options.finalizeAdoption ?? finalizeAdoption;
|
|
509
510
|
if (adoptionArtifacts.plan.steps.some((step) => step.category === "stage")) {
|
|
510
511
|
await finalizeAdoptionFn(adoptionArtifacts.plan, {
|
|
@@ -521,7 +522,7 @@ async function runInit(options = {}) {
|
|
|
521
522
|
const reconcileFn = options.reconcileAgentFiles ?? adopt_genesis_js_1.reconcileAgentFiles;
|
|
522
523
|
const agentResults = await reconcileFn(repoRoot);
|
|
523
524
|
// Phase E — adoption report
|
|
524
|
-
const adoptReport = (0, adopt_report_js_1.buildAdoptionReport)({ install: installResult, graph: graphResult, agents: agentResults });
|
|
525
|
+
const adoptReport = (0, adopt_report_js_1.buildAdoptionReport)({ install: installResult, graph: graphResult, agents: agentResults, instructionMigration: instructionResults });
|
|
525
526
|
(0, adopt_report_js_1.printAdoptionReport)(adoptReport);
|
|
526
527
|
(0, adopt_report_js_1.writeAdoptionReport)(repoRoot, adoptReport);
|
|
527
528
|
// Phase F — safe stage + optional commit
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.detectCaveman = detectCaveman;
|
|
4
4
|
exports.detectGitNexus = detectGitNexus;
|
|
5
5
|
exports.detectCompactionProviders = detectCompactionProviders;
|
|
6
|
+
exports.detectPolarisGraph = detectPolarisGraph;
|
|
6
7
|
exports.detectRepoAnalysisProviders = detectRepoAnalysisProviders;
|
|
7
8
|
const node_fs_1 = require("node:fs");
|
|
8
9
|
const node_child_process_1 = require("node:child_process");
|
|
@@ -50,11 +51,27 @@ function detectCompactionProviders(repoRoot) {
|
|
|
50
51
|
}
|
|
51
52
|
return detected;
|
|
52
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Detects whether the Polaris graph provider is available.
|
|
56
|
+
*
|
|
57
|
+
* Polaris graph is considered present when the `polaris` executable is
|
|
58
|
+
* found on PATH (cross-platform: uses `where` on Windows, `which` on Unix).
|
|
59
|
+
*/
|
|
60
|
+
function detectPolarisGraph() {
|
|
61
|
+
try {
|
|
62
|
+
const command = process.platform === "win32" ? "where" : "which";
|
|
63
|
+
(0, node_child_process_1.execFileSync)(command, ["polaris"], { stdio: "ignore" });
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
53
70
|
/**
|
|
54
71
|
* Runs repo-analysis provider detection and returns detected provider IDs.
|
|
55
72
|
*
|
|
56
|
-
* Recognised repo-analysis provider names: "
|
|
73
|
+
* Recognised repo-analysis provider names: "polaris-graph".
|
|
57
74
|
*/
|
|
58
75
|
function detectRepoAnalysisProviders() {
|
|
59
|
-
return
|
|
76
|
+
return detectPolarisGraph() ? ["polaris-graph"] : [];
|
|
60
77
|
}
|
|
@@ -33,6 +33,10 @@ message whose primary instruction is to invoke a named Polaris skill.
|
|
|
33
33
|
| `run polaris-status` | polaris-tools | `.polaris/skills/polaris-tools/` |
|
|
34
34
|
| `docs-ingest` | docs-ingest | `.polaris/skills/docs-ingest/` |
|
|
35
35
|
| `run docs-ingest` | docs-ingest | `.polaris/skills/docs-ingest/` |
|
|
36
|
+
| `docs-triage` | docs-triage | `.polaris/skills/docs-triage/` |
|
|
37
|
+
| `run docs-triage` | docs-triage | `.polaris/skills/docs-triage/` |
|
|
38
|
+
| `docs-review` | docs-review | `.polaris/skills/docs-review/` |
|
|
39
|
+
| `run docs-review` | docs-review | `.polaris/skills/docs-review/` |
|
|
36
40
|
| `polaris-reconcile <CLUSTER-ID>` | polaris-reconcile | `.polaris/skills/polaris-reconcile/` |
|
|
37
41
|
| `run polaris-reconcile on [issue] <CLUSTER-ID>` | polaris-reconcile | `.polaris/skills/polaris-reconcile/` |
|
|
38
42
|
| `polaris-catalog <CLUSTER-ID>` | polaris-catalog | `.polaris/skills/polaris-catalog/` |
|
|
@@ -14,13 +14,14 @@ per completed cluster, after all children are done and before PR creation.
|
|
|
14
14
|
| `SKILL.md` | Skill entry point — read first, contains bootloader instructions and packet schema reference |
|
|
15
15
|
| `chain.md` | Step-order execution map — the Librarian executes this in strict step order |
|
|
16
16
|
| `steps/01-load-cluster-context.md` | Build work inventory from packet and cluster evidence |
|
|
17
|
-
| `steps/02-
|
|
18
|
-
| `steps/03-reconcile-
|
|
19
|
-
| `steps/04-
|
|
20
|
-
| `steps/05-
|
|
21
|
-
| `steps/06-
|
|
22
|
-
| `steps/07-
|
|
23
|
-
| `steps/08-
|
|
17
|
+
| `steps/02-drift-reconciliation.md` | Run formal drift reconciliation |
|
|
18
|
+
| `steps/03-reconcile-polaris-md.md` | Update affected POLARIS.md files |
|
|
19
|
+
| `steps/04-reconcile-summary-md.md` | Refresh SUMMARY.md as continuation artifact |
|
|
20
|
+
| `steps/05-doc-ingestion.md` | Ingest/promote/archive documentation |
|
|
21
|
+
| `steps/06-link-validation.md` | Validate and repair broken links |
|
|
22
|
+
| `steps/07-yaml-linking.md` | Update YAML references for promoted documents |
|
|
23
|
+
| `steps/08-librarian-commit.md` | Commit documentation changes |
|
|
24
|
+
| `steps/09-sealed-result.md` | Write sealed result JSON and terminate |
|
|
24
25
|
|
|
25
26
|
## Invocation
|
|
26
27
|
|
|
@@ -29,7 +30,7 @@ step 08 of the `polaris-run` chain after cluster-complete is confirmed.
|
|
|
29
30
|
|
|
30
31
|
The Foreman generates the packet via:
|
|
31
32
|
```bash
|
|
32
|
-
|
|
33
|
+
polaris librarian packet <cluster-id>
|
|
33
34
|
```
|
|
34
35
|
|
|
35
36
|
Then dispatches the Librarian as a bounded subagent session.
|
|
@@ -12,7 +12,7 @@ role_file: .polaris/roles/librarian.md
|
|
|
12
12
|
Run the following command:
|
|
13
13
|
|
|
14
14
|
```
|
|
15
|
-
|
|
15
|
+
polaris skill packet ingest
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
- Do not begin work until a packet is returned.
|
|
@@ -62,7 +62,7 @@ No document may be written directly to `specs/active/`, `doctrine/active/`, `arc
|
|
|
62
62
|
- Write new Smart Docs to root `docs/` — `smartdocs/` is the canonical target
|
|
63
63
|
- Silently promote documents to `doctrine/active/`, `specs/active/`, `architecture/`, or `decisions/`
|
|
64
64
|
- Mutate source files (`src/`, tests, config)
|
|
65
|
-
- Call `
|
|
65
|
+
- Call `polaris loop continue` or `polaris finalize`
|
|
66
66
|
- Suppress detected conflicts
|
|
67
67
|
|
|
68
68
|
**Docs-ingest routes and classifies. It does not implement or promote without explicit approval.**
|
|
@@ -16,7 +16,7 @@ Query runtime state before acting. Do not infer ingest scope or prior progress f
|
|
|
16
16
|
Always use the repo-local Polaris CLI:
|
|
17
17
|
|
|
18
18
|
```
|
|
19
|
-
|
|
19
|
+
polaris docs ingest [--file <path>] [--batch <cluster-id>] [--dry-run]
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
Drop zone: `smartdocs/raw/` — this is the single ingest entry point.
|
|
@@ -21,9 +21,9 @@ Execute placements for all files that cleared steps 02–03. High-confidence, no
|
|
|
21
21
|
3. **Check for existing file** at the target path. If a file already exists there: halt for that file and report. Do not overwrite without explicit approval.
|
|
22
22
|
|
|
23
23
|
4. **Use the Polaris CLI** — do not move files manually. The CLI handles provenance, map updates, and duplicate detection:
|
|
24
|
-
- `spec-raw` or low-confidence fallback: `
|
|
25
|
-
- `doctrine-candidate`: `
|
|
26
|
-
- All other classifications: use `
|
|
24
|
+
- `spec-raw` or low-confidence fallback: `polaris docs ingest --file <path>` (CLI routes to `smartdocs/raw/`; if source is already there, no move occurs)
|
|
25
|
+
- `doctrine-candidate`: `polaris doctrine draft <path>`
|
|
26
|
+
- All other classifications: use `polaris docs ingest --file <path>`
|
|
27
27
|
- If source is already in `smartdocs/` (reclassification): update front-matter only, re-run ingest to refresh provenance.
|
|
28
28
|
- Do not write anything to root `docs/`.
|
|
29
29
|
|
|
@@ -37,7 +37,7 @@ Execute placements for all files that cleared steps 02–03. High-confidence, no
|
|
|
37
37
|
|
|
38
38
|
6. **Provenance record** — the CLI writes `<filename>.provenance.json` alongside the placed file automatically. Verify it exists after placement.
|
|
39
39
|
|
|
40
|
-
7. **Update Polaris map** — the CLI calls `updateMapEntry` internally. After the batch: run `
|
|
40
|
+
7. **Update Polaris map** — the CLI calls `updateMapEntry` internally. After the batch: run `polaris map update --changed` to synchronize the atlas.
|
|
41
41
|
|
|
42
42
|
## Hard rules
|
|
43
43
|
|
|
@@ -58,7 +58,7 @@ allowed_files:
|
|
|
58
58
|
expected_evidence:
|
|
59
59
|
- all approved files placed at correct target paths within smartdocs/
|
|
60
60
|
- provenance records written alongside each placed file
|
|
61
|
-
- map updated via
|
|
61
|
+
- map updated via polaris map update --changed
|
|
62
62
|
- low-confidence files confirmed routed to smartdocs/raw/
|
|
63
63
|
- no placements to root docs/ or high-authority paths without approval
|
|
64
64
|
stop_rules:
|
|
@@ -37,7 +37,7 @@ Close out the ingest session cleanly. Emit telemetry. Write final state. Report.
|
|
|
37
37
|
|
|
38
38
|
5. **Bootstrap packet** — if more clusters remain pending in `.polaris/docs-ingest/`, emit guidance for the next session:
|
|
39
39
|
```text
|
|
40
|
-
Next:
|
|
40
|
+
Next: polaris docs ingest --batch <next-cluster-id>
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
## Completion rule
|
|
@@ -27,7 +27,7 @@ stop and use `polaris-catalog <POL-###>` instead.
|
|
|
27
27
|
Run the following command:
|
|
28
28
|
|
|
29
29
|
```
|
|
30
|
-
|
|
30
|
+
polaris skill packet promote
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
- Do not begin work until a packet is returned.
|
|
@@ -61,10 +61,10 @@ Use this skill when documents have been ingested and need to be reviewed for pro
|
|
|
61
61
|
- Read `smartdocs/raw/` and `smartdocs/doctrine/candidate/` to identify promotion candidates
|
|
62
62
|
- Read linked source files (from `linkedMapArea` in provenance sidecar) to verify relevance and staleness
|
|
63
63
|
- Read `smartdocs/doctrine/active/` and `smartdocs/specs/active/` to check for conflicts
|
|
64
|
-
- Call `
|
|
65
|
-
- Call `
|
|
66
|
-
- Call `
|
|
67
|
-
- Call `
|
|
64
|
+
- Call `polaris doctrine spec-promote <path>` to surface the conflict report (without `--approve`)
|
|
65
|
+
- Call `polaris doctrine spec-promote <path> --approve` **only after** surfacing the report and receiving explicit user confirmation
|
|
66
|
+
- Call `polaris doctrine promote <path>` for doctrine candidates that pass governance checks
|
|
67
|
+
- Call `polaris doctrine deprecate <path>` for active docs that are superseded or stale
|
|
68
68
|
- Emit telemetry events
|
|
69
69
|
|
|
70
70
|
## Hard rules — what docs-promote must NOT do
|
|
@@ -72,7 +72,7 @@ Use this skill when documents have been ingested and need to be reviewed for pro
|
|
|
72
72
|
- Auto-promote without surfacing the conflict report first
|
|
73
73
|
- Call `--approve` without explicit user confirmation in the session
|
|
74
74
|
- Mutate source files (`src/`, tests, config)
|
|
75
|
-
- Call `
|
|
75
|
+
- Call `polaris loop continue` or `polaris finalize`
|
|
76
76
|
- Promote to `architecture/` or `decisions/` — those require explicit ADR process
|
|
77
77
|
- Suppress or ignore detected conflicts
|
|
78
78
|
|
|
@@ -30,11 +30,11 @@ Read the current step's file in `steps/` before acting. Do not read ahead.
|
|
|
30
30
|
Always use the repo-local Polaris CLI:
|
|
31
31
|
|
|
32
32
|
```
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
polaris doctrine draft <path>
|
|
34
|
+
polaris doctrine promote <path>
|
|
35
|
+
polaris doctrine deprecate <path>
|
|
36
|
+
polaris doctrine spec-promote <path>
|
|
37
|
+
polaris doctrine spec-promote <path> --approve
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
Never assume a globally linked `polaris` command exists.
|
|
@@ -16,7 +16,7 @@ Surface every conflict before asking for approval. The agent must not approve an
|
|
|
16
16
|
Run the dry gate for each:
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
|
|
19
|
+
polaris doctrine spec-promote <path>
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
Capture the full stdout. This is the conflict report. Do **not** pass `--approve`.
|
|
@@ -15,17 +15,17 @@ For each candidate with `decision: approved`:
|
|
|
15
15
|
|
|
16
16
|
### Spec promotion
|
|
17
17
|
```bash
|
|
18
|
-
|
|
18
|
+
polaris doctrine spec-promote <path> --approve
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
### Doctrine candidate promotion
|
|
22
22
|
```bash
|
|
23
|
-
|
|
23
|
+
polaris doctrine promote <path>
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
### Active doctrine deprecation
|
|
27
27
|
```bash
|
|
28
|
-
|
|
28
|
+
polaris doctrine deprecate <path>
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
After each command:
|
|
@@ -16,7 +16,7 @@ Query runtime state before acting. Do not infer triage scope or prior progress f
|
|
|
16
16
|
Always use the repo-local Polaris CLI:
|
|
17
17
|
|
|
18
18
|
```
|
|
19
|
-
|
|
19
|
+
polaris docs triage [--dry-run] [--batch-size <n>] [--resume] [--repo-root <path>]
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
- `--dry-run`: prints cluster count, estimated batches, estimated tokens, and model — no LLM calls
|