@lsctech/polaris 0.3.3 → 0.3.5
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.
|
@@ -9,6 +9,7 @@ exports.SKILL_ROLE_MAP = {
|
|
|
9
9
|
ingest: "Librarian",
|
|
10
10
|
promote: "Librarian",
|
|
11
11
|
triage: "Librarian",
|
|
12
|
+
review: "Librarian",
|
|
12
13
|
};
|
|
13
14
|
const ROLE_SUMMARIES = {
|
|
14
15
|
Analyst: "The Analyst gathers evidence, assesses feasibility, and produces implementation-ready plans. The Analyst shapes work but never executes it.",
|
|
@@ -221,6 +222,41 @@ function buildTriagePacket() {
|
|
|
221
222
|
],
|
|
222
223
|
};
|
|
223
224
|
}
|
|
225
|
+
function buildReviewPacket() {
|
|
226
|
+
return {
|
|
227
|
+
authority_boundaries: [
|
|
228
|
+
"Read smartdocs/raw/_triage-queue.json to load pending review decisions",
|
|
229
|
+
"Read candidate documents from smartdocs/doctrine/candidate/ to inform decisions",
|
|
230
|
+
"Evaluate each flagged packet: read the doc, consider the flag type and stale symbols, decide approve/reject/defer",
|
|
231
|
+
"Write decisions back to the triage queue by calling polaris docs review --write-decision <sourcePath> <decision>",
|
|
232
|
+
"Call polaris docs ingest to apply approved/rejected decisions after review is complete",
|
|
233
|
+
"Emit telemetry events",
|
|
234
|
+
],
|
|
235
|
+
prohibited_actions: [
|
|
236
|
+
"Move, promote, or delete documents directly — decisions must go through polaris docs ingest",
|
|
237
|
+
"Auto-approve every packet without reading the document content",
|
|
238
|
+
"Mutate source files (src/, tests, config)",
|
|
239
|
+
"Call polaris loop continue or polaris finalize",
|
|
240
|
+
"Suppress or skip flagged packets without recording a decision",
|
|
241
|
+
],
|
|
242
|
+
allowed_outputs: [
|
|
243
|
+
"Review decisions written to smartdocs/raw/_triage-queue.json",
|
|
244
|
+
"Promoted documents (via polaris docs ingest for approved packets)",
|
|
245
|
+
"Deprecated documents (via polaris docs ingest for rejected packets)",
|
|
246
|
+
"Telemetry events",
|
|
247
|
+
],
|
|
248
|
+
deliverables: [
|
|
249
|
+
"All pending packets in _triage-queue.json reviewed with approve/reject/defer decision",
|
|
250
|
+
"Approved and rejected packets processed by polaris docs ingest",
|
|
251
|
+
"Summary of decisions reported to user",
|
|
252
|
+
],
|
|
253
|
+
stop_conditions: [
|
|
254
|
+
"All packets reviewed",
|
|
255
|
+
"Ambiguous packet that requires explicit user input",
|
|
256
|
+
"Ingest error on apply — report and wait for instruction",
|
|
257
|
+
],
|
|
258
|
+
};
|
|
259
|
+
}
|
|
224
260
|
function generateSkillPacket(skillName, config) {
|
|
225
261
|
const active_role = exports.SKILL_ROLE_MAP[skillName];
|
|
226
262
|
const role_summary = ROLE_SUMMARIES[active_role];
|
|
@@ -248,6 +284,9 @@ function generateSkillPacket(skillName, config) {
|
|
|
248
284
|
case "triage":
|
|
249
285
|
body = buildTriagePacket();
|
|
250
286
|
break;
|
|
287
|
+
case "review":
|
|
288
|
+
body = buildReviewPacket();
|
|
289
|
+
break;
|
|
251
290
|
}
|
|
252
291
|
return {
|
|
253
292
|
packet_id,
|
|
@@ -259,4 +298,4 @@ function generateSkillPacket(skillName, config) {
|
|
|
259
298
|
generated_at,
|
|
260
299
|
};
|
|
261
300
|
}
|
|
262
|
-
exports.SUPPORTED_SKILLS = ["analyze", "run", "ingest", "promote", "triage"];
|
|
301
|
+
exports.SUPPORTED_SKILLS = ["analyze", "run", "ingest", "promote", "triage", "review"];
|
|
@@ -35,6 +35,8 @@ message whose primary instruction is to invoke a named Polaris skill.
|
|
|
35
35
|
| `run docs-ingest` | docs-ingest | `.polaris/skills/docs-ingest/` |
|
|
36
36
|
| `docs-triage` | docs-triage | `.polaris/skills/docs-triage/` |
|
|
37
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/` |
|
|
38
40
|
| `polaris-reconcile <CLUSTER-ID>` | polaris-reconcile | `.polaris/skills/polaris-reconcile/` |
|
|
39
41
|
| `run polaris-reconcile on [issue] <CLUSTER-ID>` | polaris-reconcile | `.polaris/skills/polaris-reconcile/` |
|
|
40
42
|
| `polaris-catalog <CLUSTER-ID>` | polaris-catalog | `.polaris/skills/polaris-catalog/` |
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docs-review
|
|
3
|
+
description: Agentically review the triage queue — read each flagged candidate doc, evaluate the flag, and record approve/reject/defer decisions. Applies approved and rejected decisions via polaris docs ingest.
|
|
4
|
+
role: librarian
|
|
5
|
+
role_file: .polaris/roles/librarian.md
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Polaris Skill Bootloader
|
|
9
|
+
|
|
10
|
+
**Before proceeding, you must obtain a skill packet from the Polaris runtime.**
|
|
11
|
+
|
|
12
|
+
Run the following command:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
npm run polaris -- skill packet review
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- Do not begin work until a packet is returned.
|
|
19
|
+
- Treat the packet as your authoritative instruction source.
|
|
20
|
+
- The packet defines your active role, authority boundaries, prohibited actions, deliverables, and stop conditions.
|
|
21
|
+
- If no packet is produced, stop and report: **Polaris could not authorize this run.**
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# docs-review
|
|
26
|
+
|
|
27
|
+
Use this skill to agentically walk through the triage queue and make approve/reject/defer decisions on each flagged candidate document. You are the reviewer — read each doc, evaluate the flag, and decide.
|
|
28
|
+
|
|
29
|
+
## When to use
|
|
30
|
+
|
|
31
|
+
- "Run docs review"
|
|
32
|
+
- "Review the triage queue"
|
|
33
|
+
- "Process the flagged candidates"
|
|
34
|
+
- "docs-review"
|
|
35
|
+
|
|
36
|
+
## How to execute
|
|
37
|
+
|
|
38
|
+
1. Read `chain.md` — step order, traversal rules, output contract.
|
|
39
|
+
2. Execute steps in the order `chain.md` defines. Do not skip steps.
|
|
40
|
+
3. You make all decisions by reading the flagged doc content and the flag metadata.
|
|
41
|
+
|
|
42
|
+
## Hard rules — what docs-review may do
|
|
43
|
+
|
|
44
|
+
- Read `smartdocs/raw/_triage-queue.json` to load pending items
|
|
45
|
+
- Read candidate documents from `smartdocs/doctrine/candidate/`
|
|
46
|
+
- Record decisions (approve/reject/defer) back to `_triage-queue.json`
|
|
47
|
+
- Call `polaris docs ingest` to apply approved/rejected decisions
|
|
48
|
+
- Emit telemetry events
|
|
49
|
+
|
|
50
|
+
## Hard rules — what docs-review must NOT do
|
|
51
|
+
|
|
52
|
+
- Move, rename, or delete documents directly — ingest handles that
|
|
53
|
+
- Auto-approve every packet without reading the document
|
|
54
|
+
- Mutate source files (`src/`, tests, config)
|
|
55
|
+
- Call `polaris loop continue` or `polaris finalize`
|
|
56
|
+
- Skip packets without recording a decision
|
|
57
|
+
|
|
58
|
+
**Docs-review reads, evaluates, and decides. Ingest executes.**
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docs-review-chain
|
|
3
|
+
description: Route map for docs-review — step order, stop conditions, output contract, and decision protocol.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# docs-review chain
|
|
7
|
+
|
|
8
|
+
## Authority
|
|
9
|
+
|
|
10
|
+
**Polaris runtime state is authoritative. Chat reasoning is not authoritative.**
|
|
11
|
+
|
|
12
|
+
Query `smartdocs/raw/_triage-queue.json` before acting. Do not infer queue state from conversation context.
|
|
13
|
+
|
|
14
|
+
## Decision protocol
|
|
15
|
+
|
|
16
|
+
For each flagged packet you evaluate:
|
|
17
|
+
|
|
18
|
+
1. Read the source document at `sourcePath`
|
|
19
|
+
2. Consider the flag metadata: `triageFlag`, `staleSymbols`, `authorityRisk`, `reasoning`
|
|
20
|
+
3. Apply this decision rubric:
|
|
21
|
+
- **approve**: doc content is still valid doctrine; stale symbols are incidental (generic English words, external brand names, or aspirational references that don't affect correctness)
|
|
22
|
+
- **reject**: doc is clearly outdated, contradicted by current code, or describes systems that no longer exist
|
|
23
|
+
- **defer**: cannot determine from doc content alone — needs human review
|
|
24
|
+
|
|
25
|
+
4. Record your decision by editing `_triage-queue.json` directly: set `reviewDecision` to `"approve"`, `"reject"`, or `"defer"`, and set `reviewedAt` to the current ISO timestamp and `reviewedBy` to `"docs-review-agent"`.
|
|
26
|
+
|
|
27
|
+
## Output contract
|
|
28
|
+
|
|
29
|
+
All decision output written to `smartdocs/raw/`:
|
|
30
|
+
|
|
31
|
+
| File | Purpose |
|
|
32
|
+
|------|---------|
|
|
33
|
+
| `_triage-queue.json` | Updated with `reviewDecision` fields — source of truth for ingest |
|
|
34
|
+
|
|
35
|
+
## Step traversal order
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
01-load-queue ← read _triage-queue.json; count pending items; emit run-start telemetry
|
|
39
|
+
02-review-packets ← for each pending packet: read doc → evaluate → record decision
|
|
40
|
+
03-apply-decisions ← run polaris docs ingest to apply approved/rejected packets
|
|
41
|
+
04-hand-off ← report decision summary (approved / rejected / deferred); emit triage-review-complete telemetry
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Stop conditions
|
|
45
|
+
|
|
46
|
+
**Step 01:**
|
|
47
|
+
- `_triage-queue.json` not found → halt: "Run docs-triage first to generate the triage queue"
|
|
48
|
+
- Zero pending items → report "Nothing to review — all decisions already recorded" and stop
|
|
49
|
+
|
|
50
|
+
**Step 02:**
|
|
51
|
+
- If a document at `sourcePath` cannot be read → record `defer` and log the path
|
|
52
|
+
- Process all packets before moving to step 03 — do not apply decisions mid-loop
|
|
53
|
+
|
|
54
|
+
**Step 03:**
|
|
55
|
+
- If no packets were approved or rejected → skip ingest, report counts only
|
|
56
|
+
- Ingest error → report the error; do not retry automatically
|
|
57
|
+
|
|
58
|
+
## Run ID format
|
|
59
|
+
|
|
60
|
+
Format: `docs-review-<date>-<seq>`
|
|
61
|
+
- `<date>`: `YYYY-MM-DD`
|
|
62
|
+
- `<seq>`: zero-padded sequential number per day (`001`, `002`, …)
|
|
63
|
+
|
|
64
|
+
Example: `docs-review-2026-06-14-001`
|
|
65
|
+
|
|
66
|
+
## Telemetry
|
|
67
|
+
|
|
68
|
+
Telemetry file: `.taskchain_artifacts/docs-review/runs/<run-id>/telemetry.jsonl` (append-only).
|
|
69
|
+
|
|
70
|
+
| Event | Trigger |
|
|
71
|
+
|-------|---------|
|
|
72
|
+
| `run-start` | Begin step 01 |
|
|
73
|
+
| `step-complete` | End of every step |
|
|
74
|
+
| `review-complete` | All packets evaluated |
|
|
75
|
+
| `apply-complete` | Ingest finished |
|
|
76
|
+
|
|
77
|
+
Required fields on every event: `event`, `run_id`, `timestamp`.
|
|
78
|
+
|
|
79
|
+
## Execution reporting
|
|
80
|
+
|
|
81
|
+
After each completed step, emit a checkpoint:
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
**[step-name]** done | blocked | needs-input
|
|
85
|
+
Changed: <outputs written> or none
|
|
86
|
+
Validated: <checks passed> or none
|
|
87
|
+
Blockers: none | <explicit blocker>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Never compressed
|
|
91
|
+
|
|
92
|
+
Always write in full:
|
|
93
|
+
- Decision counts (approved / rejected / deferred) after step 02
|
|
94
|
+
- Any packets that could not be read (defaulted to defer)
|
|
95
|
+
- Ingest results after step 03
|