teamsmith 0.4.6 → 0.4.8
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/README.md +6 -6
- package/package.json +1 -1
- package/skills/teamsmith/CHANGELOG.md +35 -0
- package/skills/teamsmith/SKILL.md +43 -30
- package/skills/teamsmith/extension/team-bg.ts +5 -3
- package/skills/teamsmith/extension/team-inbox-watch.ts +14 -3
- package/skills/teamsmith/extension/team-notify.ts +20 -13
- package/skills/teamsmith/extension/team-remind.ts +189 -0
- package/skills/teamsmith/extension/team-reply.ts +4 -7
- package/skills/teamsmith/references/config.md +11 -12
- package/skills/teamsmith/references/migration.md +101 -0
- package/skills/teamsmith/references/openspec.md +43 -27
- package/skills/teamsmith/references/protocol.md +26 -15
- package/skills/teamsmith/references/reminders.md +153 -161
- package/skills/teamsmith/references/troubleshooting.md +12 -7
- package/skills/teamsmith/references/workflows.md +84 -31
- package/skills/teamsmith/scripts/lib/cmd-agents.sh +10 -4
- package/skills/teamsmith/scripts/lib/cmd-project.sh +88 -6
- package/skills/teamsmith/scripts/lib/cmd-remind.sh +88 -2
- package/skills/teamsmith/scripts/lib/cmd-review.sh +61 -35
- package/skills/teamsmith/scripts/lib/cmd-watch.sh +48 -11
- package/skills/teamsmith/scripts/lib/common.sh +83 -13
- package/skills/teamsmith/scripts/panel/README.md +35 -33
- package/skills/teamsmith/scripts/panel/panel.js +217 -199
- package/skills/teamsmith/scripts/panel/src/App.tsx +221 -66
- package/skills/teamsmith/scripts/panel/src/data.ts +71 -15
- package/skills/teamsmith/scripts/panel/src/layout.ts +159 -310
- package/skills/teamsmith/scripts/panel/src/main.tsx +83 -21
- package/skills/teamsmith/scripts/panel/src/project-settings.ts +46 -0
- package/skills/teamsmith/scripts/panel/src/strings/en.ts +71 -205
- package/skills/teamsmith/scripts/panel/src/strings/index.ts +3 -5
- package/skills/teamsmith/scripts/panel/src/strings/zh.ts +72 -204
- package/skills/teamsmith/scripts/panel/src/types.ts +23 -4
- package/skills/teamsmith/scripts/remind-capability.mjs +261 -0
- package/skills/teamsmith/scripts/remind-store.mjs +55 -24
- package/skills/teamsmith/scripts/remind-tick.mjs +5 -2
- package/skills/teamsmith/scripts/reply-capture.mjs +8 -9
- package/skills/teamsmith/scripts/state-authority.mjs +72 -6
- package/skills/teamsmith/scripts/strings/commands.tsv +1 -1
- package/skills/teamsmith/scripts/team +1 -0
- package/skills/teamsmith/templates/AGENTS.section.md.tmpl +18 -8
- package/skills/teamsmith/templates/DECISIONS.md.tmpl +2 -2
- package/skills/teamsmith/templates/OWNERSHIP.md.tmpl +3 -3
- package/skills/teamsmith/templates/PROTOCOL.md.tmpl +19 -14
- package/skills/teamsmith/templates/memory-seed.md.tmpl +2 -2
- package/skills/teamsmith/templates/pm-prompt.md.tmpl +41 -25
- package/skills/teamsmith/templates/report.md.tmpl +33 -0
- package/skills/teamsmith/tests/bg-ledger-harness.mjs +217 -33
- package/skills/teamsmith/tests/bg-ledger.sh +24 -10
- package/skills/teamsmith/tests/checkout-shape-probe.sh +7 -6
- package/skills/teamsmith/tests/fixtures/remind-adversarial-delay.ts +27 -0
- package/skills/teamsmith/tests/fixtures/remind-tool-provider.ts +65 -0
- package/skills/teamsmith/tests/help-surface.sh +78 -12
- package/skills/teamsmith/tests/install-shape.sh +7 -7
- package/skills/teamsmith/tests/isolation-ledger.sh +6 -2
- package/skills/teamsmith/tests/key-replies-ui.sh +64 -5
- package/skills/teamsmith/tests/key-replies.sh +307 -106
- package/skills/teamsmith/tests/lib/main-team-fingerprint.sh +2 -0
- package/skills/teamsmith/tests/lib/model-routing-boundary.sh +255 -90
- package/skills/teamsmith/tests/lib/model-routing-expansion.sh +181 -61
- package/skills/teamsmith/tests/lib/model-routing-roles.sh +125 -67
- package/skills/teamsmith/tests/lib/reply-fixture.sh +14 -9
- package/skills/teamsmith/tests/lib/routes-pages.sh +243 -0
- package/skills/teamsmith/tests/lib/tmp-root.sh +1 -1
- package/skills/teamsmith/tests/loop-inventory.tsv +3 -0
- package/skills/teamsmith/tests/panel-b2.sh +91 -31
- package/skills/teamsmith/tests/panel-b3-stub.sh +9 -2
- package/skills/teamsmith/tests/panel-p21.sh +607 -1162
- package/skills/teamsmith/tests/panel-strings.mjs +21 -113
- package/skills/teamsmith/tests/remind-adversarial-faults.mjs +190 -0
- package/skills/teamsmith/tests/remind-adversarial-faults.sh +78 -0
- package/skills/teamsmith/tests/remind-adversarial-real.sh +28 -0
- package/skills/teamsmith/tests/remind-cli.sh +108 -3
- package/skills/teamsmith/tests/remind-delivery-node.mjs +13 -0
- package/skills/teamsmith/tests/remind-delivery.sh +123 -35
- package/skills/teamsmith/tests/remind-lifecycle.sh +197 -0
- package/skills/teamsmith/tests/remind-pulse.sh +199 -0
- package/skills/teamsmith/tests/remind-recovery-real.sh +5 -0
- package/skills/teamsmith/tests/remind-recovery-unit.sh +118 -0
- package/skills/teamsmith/tests/remind-tool-node.mjs +159 -0
- package/skills/teamsmith/tests/remind-tool-real.mjs +801 -0
- package/skills/teamsmith/tests/remind-tool-real.sh +180 -0
- package/skills/teamsmith/tests/reply-capture-real.mjs +93 -2
- package/skills/teamsmith/tests/routes.sh +213 -293
- package/skills/teamsmith/tests/section-paths.tsv +19 -17
- package/skills/teamsmith/tests/smoke.sh +583 -133
- package/skills/teamsmith/tests/state-authority.sh +152 -8
- package/skills/teamsmith/tests/task-model-routing.sh +57 -26
- package/skills/teamsmith/tests/tmp-hygiene.sh +1 -1
- package/skills/teamsmith-init/SKILL.md +5 -5
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/__pycache__/judge-second.cpython-313.pyc +0 -0
|
@@ -38,11 +38,9 @@ export default async function (pi: ExtensionAPI) {
|
|
|
38
38
|
entry: (id: string) => ctx.sessionManager.getEntry(id),
|
|
39
39
|
})
|
|
40
40
|
const diagnostic = (d: { reason: string; entryId: string; path: string }) => {
|
|
41
|
-
// Never title/body/model text.
|
|
41
|
+
// Never title/body/model text. Pi renders extension stderr in the TUI, so routine diagnostics stay local.
|
|
42
42
|
const line = `[team-reply] ${d.reason}; source=${d.entryId || 'unbound'}; evidence=${d.path}\n`
|
|
43
|
-
|
|
44
|
-
// A TUI swallows stderr, so the same line also lands beside the journal: without it a refused
|
|
45
|
-
// publication leaves no trace at all and the only symptom is a reply page that never grows.
|
|
43
|
+
// Keep the line beside the journal: a refused publication remains diagnosable without changing the session output.
|
|
46
44
|
try {
|
|
47
45
|
const state = registration?.state
|
|
48
46
|
if (!state) return
|
|
@@ -67,9 +65,8 @@ export default async function (pi: ExtensionAPI) {
|
|
|
67
65
|
engine = undefined
|
|
68
66
|
let identity: any
|
|
69
67
|
try { identity = capture.resolvePMIdentity(context(ctx)) }
|
|
70
|
-
catch
|
|
71
|
-
|
|
72
|
-
return // Unproven worker/ordinary/custom/foreign contexts do not mutate messages or register ready.
|
|
68
|
+
catch {
|
|
69
|
+
return // Unproven contexts stay disabled; doctor/runtime evidence explains the absent registration.
|
|
73
70
|
}
|
|
74
71
|
key = capture.sessionKey(identity)
|
|
75
72
|
if (owners.has(key)) return // A second loaded path must not sanitize, stage, or register a second owner.
|
|
@@ -325,8 +325,10 @@ arbitrary file reader. Text is capped at 128 KiB (`TEAM_PANEL_DETAIL_CAP` overri
|
|
|
325
325
|
console spawns no `detail` child at all.
|
|
326
326
|
|
|
327
327
|
`--block settings` is the project-settings view's reader (P22/B2): its payload is exactly `team config list
|
|
328
|
-
--json` (
|
|
329
|
-
|
|
328
|
+
--json` (complete key metadata, effect classes and functional `group`, future category/PM policy and committed
|
|
329
|
+
model records). The selected console lists model and automatic-check operations; project commands and model
|
|
330
|
+
records are separate returnable views. Excluded keys remain in the full CLI, and genuine warnings and repair
|
|
331
|
+
routes remain accessible in settings. The audit is not read by this console view. Like `detail` it is
|
|
330
332
|
requested only while the view is open — a parked console spawns no `settings` child and `--print`/`--json` never
|
|
331
333
|
see it.
|
|
332
334
|
|
|
@@ -390,11 +392,9 @@ parsed from the `# ---- … ----` section comments, which stay documentation: a
|
|
|
390
392
|
a row between headings. The fields are positional, so the ninth column (`suggest`) is written empty for a row
|
|
391
393
|
that has no suggestions when the group follows; a row whose tenth field is missing or malformed is a schema
|
|
392
394
|
defect, and `tests/config-cli.sh`'s `groups` section names the key and fails — the read never invents a default
|
|
393
|
-
group or hides the row
|
|
394
|
-
`settingsGroupUngrouped` in the string tables).
|
|
395
|
+
group or hides the row from the complete CLI. The selected console's purpose groups do not follow this metadata.
|
|
395
396
|
|
|
396
|
-
The vocabulary is
|
|
397
|
-
**both** languages (the zh and en tables are the only place a heading's words live):
|
|
397
|
+
The complete CLI vocabulary is these twelve tokens; it is not the console's purpose-heading list:
|
|
398
398
|
|
|
399
399
|
| token | domain | example keys |
|
|
400
400
|
|---|---|---|
|
|
@@ -411,12 +411,11 @@ The vocabulary is exactly these twelve tokens; the visible heading is the table
|
|
|
411
411
|
| `session` | live sessions | the `TEAM_INBOX_WATCH_*` family |
|
|
412
412
|
| `meeting` | cross-project meetings | `TEAM_MEETING_TTL_HOURS`, `TEAM_MEETING_KNOCK` |
|
|
413
413
|
|
|
414
|
-
The token is the **only** declaration of
|
|
415
|
-
`group` verbatim
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
under its domain with the committed console bundle, and no group list exists anywhere else.
|
|
414
|
+
The token is the **only** declaration of this CLI vocabulary: `team config list --json` reports each key's
|
|
415
|
+
`group` verbatim, or empty for an unknown file key. New schema keys/groups remain in that complete read; they
|
|
416
|
+
do not automatically create console operations or headings. `tests/panel-strings.mjs` checks only displayed
|
|
417
|
+
references and selected-operation labels in both languages; complete schema/group validation remains in the
|
|
418
|
+
existing CLI fixture.
|
|
420
419
|
|
|
421
420
|
### The written form
|
|
422
421
|
|
|
@@ -455,3 +455,104 @@ team mark-loaded # re-record what this session sho
|
|
|
455
455
|
|
|
456
456
|
If something here does not match what `team doctor`, `team version --check` or `team smoke` actually print, that is a
|
|
457
457
|
bug in the guide (or in the tool): report it with the command and the output rather than working around it.
|
|
458
|
+
|
|
459
|
+
## 9. Reminder state and prompt-free recovery
|
|
460
|
+
|
|
461
|
+
The Reminder/Standby authority adds one shared snapshot and an OS `flock` dependency. This is a
|
|
462
|
+
required dependency **even for Standby in a project with no Reminders**. `team paths` reports the
|
|
463
|
+
executable used by the real transaction as `flock_runner` (an empty string means unresolved), and
|
|
464
|
+
`team doctor` fails with a concrete repair when it is absent or unusable:
|
|
465
|
+
|
|
466
|
+
```text
|
|
467
|
+
flock unavailable: no executable flock on PATH; install util-linux ...
|
|
468
|
+
flock unavailable: <path> is not an executable regular file ...
|
|
469
|
+
exclusive flock failed at <state>/reminders/authority.lock: flock: <OS error> ...
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
Install `util-linux` (which provides `flock`), fix the named file's execute permission, or correct
|
|
473
|
+
`PATH`. For the third form, repair the filesystem containing `<state>/reminders` or move the project
|
|
474
|
+
state to a filesystem that supports exclusive locks. There is no unlocked fallback and no
|
|
475
|
+
`TEAM_REQUIRE_*` switch that makes a mutation safe without the lock. Once the authority exists,
|
|
476
|
+
`doctor` probes its real `authority.lock` without changing the snapshot.
|
|
477
|
+
|
|
478
|
+
### 9a. Quiesced upgrade and migration failure
|
|
479
|
+
|
|
480
|
+
1. Stop the old PM, Pulse and every other old writer. `team pulse down` stops Pulse; use the existing
|
|
481
|
+
PM stop/restart procedure for the PM. Do not let an old Standby-marker writer run beside the new
|
|
482
|
+
authority.
|
|
483
|
+
2. Resolve and test the dependencies before writing:
|
|
484
|
+
|
|
485
|
+
```bash
|
|
486
|
+
team paths # inspect flock_runner and js_runner
|
|
487
|
+
team doctor # a missing/unusable flock is a failure
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
3. Preserve the old runtime state. The destination is outside the old code's state directory:
|
|
491
|
+
|
|
492
|
+
```bash
|
|
493
|
+
backup=".pi/team/reminder-rollback-$(date -u +%Y%m%dT%H%M%SZ)"
|
|
494
|
+
mkdir -p "$backup"
|
|
495
|
+
if [ -f .pi/team/state/reminders/state.json ]; then
|
|
496
|
+
cp .pi/team/state/reminders/state.json "$backup/state.json"
|
|
497
|
+
fi
|
|
498
|
+
if [ -f .pi/team/state/standby ]; then
|
|
499
|
+
cp .pi/team/state/standby "$backup/standby.before-upgrade"
|
|
500
|
+
fi
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
4. Migrate with the real command:
|
|
504
|
+
|
|
505
|
+
```bash
|
|
506
|
+
team standby migrate
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
A lock or legacy-import failure happens before snapshot commit: the previous snapshot and legacy
|
|
510
|
+
marker remain in place, so repair the named cause and rerun the same command. A write/fsync error
|
|
511
|
+
can instead be indeterminate after the atomic rename; inspect `standby.migrated` in the snapshot
|
|
512
|
+
rather than assuming the old state. Migration is idempotent. If the snapshot was committed but only
|
|
513
|
+
the marker rename failed, the command warns instead: the snapshot already says
|
|
514
|
+
`standby.migrated=true`, the leftover marker is inert, and this is **not** a rollback to the old
|
|
515
|
+
writer.
|
|
516
|
+
|
|
517
|
+
### 9b. Export and roll back
|
|
518
|
+
|
|
519
|
+
Stop the new PM, Pulse and writers first. Inspect outstanding Reminders and intents with
|
|
520
|
+
`team remind list --all`; resolve them from their observed outcomes rather than assuming delivery.
|
|
521
|
+
Then export the snapshot outside the old code's state path:
|
|
522
|
+
|
|
523
|
+
```bash
|
|
524
|
+
backup=".pi/team/reminder-rollback-$(date -u +%Y%m%dT%H%M%SZ)"
|
|
525
|
+
mkdir -p "$backup"
|
|
526
|
+
cp .pi/team/state/reminders/state.json "$backup/state.json"
|
|
527
|
+
node -e '
|
|
528
|
+
const fs = require("fs");
|
|
529
|
+
const [snapshotFile, markerFile, backupDir] = process.argv.slice(1);
|
|
530
|
+
const s = JSON.parse(fs.readFileSync(snapshotFile, "utf8"));
|
|
531
|
+
if (!s.standby.migrated) throw new Error("Standby migration has not completed");
|
|
532
|
+
if (s.standby.on) {
|
|
533
|
+
fs.writeFileSync(markerFile, `${s.standby.since} ${s.standby.reason}\n`);
|
|
534
|
+
} else if (fs.existsSync(markerFile)) {
|
|
535
|
+
fs.renameSync(markerFile, `${backupDir}/standby.pre-rollback`);
|
|
536
|
+
}
|
|
537
|
+
' "$backup/state.json" ".pi/team/state/standby" "$backup"
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
This recreates the only Standby file the old code reads, preserving the current generation's `since`
|
|
541
|
+
and `reason`; an authoritative off state has no marker. To prove the export can restore an on marker,
|
|
542
|
+
save the generated marker, move it away, rerun the same `node -e` command and compare the regenerated
|
|
543
|
+
file with the saved one. To verify the exported snapshot itself:
|
|
544
|
+
|
|
545
|
+
```bash
|
|
546
|
+
cp "$backup/state.json" "$backup/state.restore-check.json"
|
|
547
|
+
cmp "$backup/state.json" "$backup/state.restore-check.json"
|
|
548
|
+
node -e 'JSON.parse(require("fs").readFileSync(process.argv[1], "utf8"))' "$backup/state.json"
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
Pin the older tool using §7 only after the export, marker and stopped processes have been checked.
|
|
552
|
+
There is no `team remind export`, automatic rollback helper or old-code Reminder reader. Old binaries
|
|
553
|
+
cannot interpret or deliver outstanding Reminders: rollback suspends them and never auto-replays them.
|
|
554
|
+
Do not copy the exported snapshot back while old writers are running.
|
|
555
|
+
|
|
556
|
+
A stopped built-in Pi PM may be resumed for an eligible Reminder without `@pm-prompt`; custom PM
|
|
557
|
+
adapters report `unsupported-adapter` instead of receiving the ordinary startup prompt. State paths,
|
|
558
|
+
unknown handling and recovery outcomes are in `skills/teamsmith/references/reminders.md`.
|
|
@@ -41,16 +41,16 @@ CLI they are the equivalent prompt/skill files (§0).
|
|
|
41
41
|
| 1 | `opsx-explore` | an **explorer** worker — never the eventual implementer (the verify agent, or a dedicated explorer) | the user's request / problem statement, existing specs and code | exploration report: options, risks, recommended approach, effort — written as the task's report | **PM**: accepts the approach, records the decision in `docs/team/DECISIONS.md`, and writes the propose brief |
|
|
42
42
|
| 2 | `opsx-propose` | the **explorer** (the same agent — it holds the context) | the accepted approach | `openspec/changes/<id>/` (proposal, delta specs, design, tasks) — **planning only, no code** (the workflow itself states this boundary) | **PM proposal review — a recorded gate, same standing as `team review`**: `openspec validate --all --strict` green **and** the verdict written to `docs/team/reviews/<change>-proposal.md` as ACCEPTED (§4). **No apply brief may be dispatched before that.** |
|
|
43
43
|
| 3 | `opsx-apply` | a **dev** agent, different from 1 and 4 | the change + the brief | code committed on its task branch + report | **independent verification** is dispatched to a different agent |
|
|
44
|
-
| 4 | `opsx-verify` | an **independent verify** agent (never the implementer) | the change, the landed code, the report |
|
|
45
|
-
| 5 | `opsx-archive` | **
|
|
44
|
+
| 4 | `opsx-verify` | an **independent verify** agent (never the implementer) | the change, the landed code, the report | implementation-ID execution record + verifier assessment; candidate and merged SHAs, every applicable scenario and red/green evidence | after the PM merges, the **same verifier** resumes on a clean checkout pinned to the merged SHA and runs the applicable gates + OpenSpec assessment; the PM accepts passing evidence before `done` or archive authorization; inspection-only `team review --post-merge` is not that run |
|
|
45
|
+
| 5 | `opsx-archive` | a **non-implementer worker** (possibly that verifier), on its own worktree/task branch | the accepted merged change, completed assessment and valid confirmation | `openspec/changes/archive/<date>-<id>/` + updated capability specs + worker report | completed merged-revision verification, zero unresolved CRITICAL findings, disclosed WARNING/unverified checks, reconciled sibling/checklist evidence; `team change status <id>` may have only the exact archive-task-ID + literal `phase=archive` self blocker; **the user** confirms, or the PM explicitly records a proxy confirmation only for a small, reversible change already covered by the approved approach |
|
|
46
46
|
|
|
47
47
|
An exploration whose conclusion is "not worth doing", and a verification that fails twice, do not advance: see §7.
|
|
48
48
|
|
|
49
49
|
## 2. One phase = one task = one owner
|
|
50
50
|
|
|
51
|
-
- The phases are **never merged into a single brief**: explore, propose, apply, verify and archive are five briefs
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
- The phases are **never merged into a single brief**: explore, propose, apply, verify and archive are five briefs,
|
|
52
|
+
each with its own `task:` id, `agent:`, `deps:` and `phase:` header line. An archive brief declares the literal
|
|
53
|
+
`phase: archive`, not the command name `opsx-archive` or `-`.
|
|
54
54
|
- **No agent verifies its own work** — the `team review` rule applied to the OpenSpec phases. The verify phase is
|
|
55
55
|
owned by an agent that did not implement, and the apply phase by an agent that did not propose. Explore and
|
|
56
56
|
propose may be the same agent (it holds the context) — but neither may apply its own proposal.
|
|
@@ -150,10 +150,28 @@ $ <a command the proposal itself promises> # → spot-checked: it exists and run
|
|
|
150
150
|
| explore | the exploration report, the specs and code it cites | the recommendation is one option with its risks and effort, and the scope is the user's request — not a wish list | the decision in `docs/team/DECISIONS.md` + the propose brief |
|
|
151
151
|
| propose | `openspec/changes/<id>/` end to end | `openspec validate --all --strict` green and all eight checklist points pass | `docs/team/reviews/<change>-proposal.md` = ACCEPTED (or NEEDS-CHANGES + per-item findings) |
|
|
152
152
|
| apply | the brief, the change, the branch, the report | the branch carries exactly the change's scenarios; the acceptance commands really ran; nothing outside the boundaries was touched | the verify brief (a different agent) |
|
|
153
|
-
| verify | the change,
|
|
154
|
-
| archive | the
|
|
153
|
+
| verify | the change, landed code, implementation-ID execution record, verifier report and diff | the assigned non-implementer verifier ran every applicable scenario on the PM-prepared clean checkout; after merge the **same verifier** resumed on the pinned merged SHA and completed the applicable gates + OpenSpec assessment | PM accepts the merged-SHA evidence, then `team board set <ID> done`; when IDs differ the PM writes `reviews/<verify-task>.md` explicitly as **PM acceptance**, linking the implementation-ID execution record, verifier report and verified merged SHA |
|
|
154
|
+
| archive | the accepted merged baseline, linked execution record + completed assessment, and valid confirmation | zero unresolved CRITICAL findings; WARNING/SUGGESTION and every unverified applicable check/reason disclosed before confirmation; sibling/checklist evidence reconciled; `team change status <id>` need not exit zero while this archive task is active; the tool excludes only the row whose task ID equals this brief's ID, and the brief must declare literal `phase: archive` so that row reads as `archive` (`opsx-archive` and `-` do not satisfy the header) — the tool does not match self by phase text, and every other task/archive/checklist/unreadable blocker stops archive; user confirmation, or PM proxy only for a small, reversible change already covered by the approved approach with confirmer/reason recorded | the assigned worker trials and runs `openspec archive -y <id>` on its own authorized branch; PM inspects/integrates and closes the task after acceptance |
|
|
155
|
+
|
|
156
|
+
The archive worker trials native archive on a private disk-backed copy before using its own branch:
|
|
157
|
+
|
|
158
|
+
```sh
|
|
159
|
+
trial_root="$(mktemp -d -p /var/tmp teamsmith-archive.XXXXXX)" # substitute the project's declared disk root
|
|
160
|
+
mkdir "$trial_root/project"
|
|
161
|
+
cp -a openspec "$trial_root/project/openspec"
|
|
162
|
+
(cd "$trial_root/project" && openspec archive -y <id>)
|
|
163
|
+
# Inspect complete output and resulting specs; failure returns for correction, never a real archive.
|
|
164
|
+
rm -rf -- "$trial_root"
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
The archive grant covers only the selected change/native dated destination, enumerated capability specs and the
|
|
168
|
+
worker's report in its own worktree/task branch. Native synchronization preserves existing capability Purpose text.
|
|
169
|
+
The stale verification Purpose is updated only afterwards in a separate, explicitly authorized Purpose-only
|
|
170
|
+
documentation commit with its before/after diff. For dependent archives, the predecessor archive is accepted and
|
|
171
|
+
merged first; the successor starts from that baseline and reconciles every complete MODIFIED block/scenario. A stale
|
|
172
|
+
block or missing merged predecessor returns for authorized correction and independent re-verification.
|
|
155
173
|
|
|
156
|
-
The checklist half of
|
|
174
|
+
The checklist half of readiness is the apply phase's own ledger: three changes reached archive with 23/24/16
|
|
157
175
|
items unticked (P151 F3, P175 F3, P206 F1), each caught by a human instead of by the gate. The check counts
|
|
158
176
|
**empty boxes only** — an item ticked with its reason (`- [x] 2.3 … 引用 P206`) is complete, and a box ticked to
|
|
159
177
|
clear the gate is no evidence: the ledger is reconciled on the apply side (tick what was really done, say in the
|
|
@@ -185,23 +203,20 @@ tip.
|
|
|
185
203
|
|
|
186
204
|
## 6. Preconditions
|
|
187
205
|
|
|
188
|
-
- Generate what the installed OpenSpec can generate: `openspec init --tools pi` writes
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
prompt yourself and say it is yours; do not record a hand-written prompt as generated. What teamsmith gates on is
|
|
203
|
-
the **artifact** (the review record); the command file is only checked where the checkout carries one (a checkout
|
|
204
|
-
without the machine-generated surface gets a named skip, never a red — P222).
|
|
206
|
+
- Generate what the installed OpenSpec can generate: `openspec init --tools pi` writes command and skill files for
|
|
207
|
+
the active profile (use the tool's own id for a non-Pi CLI), and `openspec update` refreshes configured tools.
|
|
208
|
+
Inspect the **actually generated** `.pi/prompts/opsx-verify.md` and
|
|
209
|
+
`.pi/skills/openspec-verify-change/SKILL.md`: when present, the verifier follows that workflow's completeness,
|
|
210
|
+
correctness and coherence assessment and its CRITICAL/WARNING/SUGGESTION/Final assessment definitions. Do not infer
|
|
211
|
+
availability from an OpenSpec release number or prescribe `openspec instructions verify`, which is not an artifact
|
|
212
|
+
command for the `spec-driven` profile.
|
|
213
|
+
- **A missing generated verify workflow is a disclosed limitation, not a skipped phase.** The assigned different agent
|
|
214
|
+
performs the documented equivalent review of completeness, requirement/scenario correctness and design coherence,
|
|
215
|
+
using this guide's phase ownership plus the same findings/readiness structure; structural `openspec validate` alone
|
|
216
|
+
is not verification. The hand-out remains the implementation-ID execution record plus the verifier's completed
|
|
217
|
+
assessment report. What teamsmith gates on is the **artifact** (the review record and assessment); generated command
|
|
218
|
+
files are checked only where the checkout carries them (a checkout without the machine-generated surface gets a
|
|
219
|
+
named skip, never a red — P222).
|
|
205
220
|
- Whether the generated files are committed follows the project's own ignore rules. This repository ignores `.pi/**`
|
|
206
221
|
(`.gitignore`): the files are per-machine, every clone and every CI checkout starts without them, and the gate
|
|
207
222
|
reports the `.pi/prompts` / `.pi/skills` checks as named skips there. A project that does commit them gets those
|
|
@@ -216,7 +231,8 @@ tip.
|
|
|
216
231
|
propose, and says so in the ledger. Nothing is archived, nothing is left half-planned.
|
|
217
232
|
- **Verification fails twice** → the PM **stops the change**: leave it in `openspec/changes/<id>/` with a note
|
|
218
233
|
naming the blocker (and the failed findings), rather than pushing it through. The next PM can see it.
|
|
219
|
-
- **The user is not available for the archive decision** → the change stays open
|
|
220
|
-
|
|
234
|
+
- **The user is not available for the archive decision** → the change stays open unless the PM explicitly records
|
|
235
|
+
the limited proxy case: small, reversible, already covered by the approved approach, with confirmer and reason.
|
|
236
|
+
PM evidence acceptance alone is not confirmation; WARNING findings and unverified checks/reasons are disclosed first.
|
|
221
237
|
- Never archive to make a red thing disappear: `openspec archive` merges the deltas into `specs/` — after it, the
|
|
222
238
|
spec set claims the change is real. Archive only after the gate passed and the user confirmed.
|
|
@@ -18,8 +18,9 @@ reasons are what stop a future you (and future agents) from treating them as bur
|
|
|
18
18
|
| Authority | the protected branch, forge writes, repository settings | its own task branch |
|
|
19
19
|
|
|
20
20
|
Splitting "writing code" from "judging whether the code is acceptable" across different sessions is what creates
|
|
21
|
-
**independent verification**: the agent's report is a **claim**, the gate results
|
|
22
|
-
worktree are **evidence**.
|
|
21
|
+
**independent verification**: the agent's report is a **claim**, and the gate results a non-implementer verifier
|
|
22
|
+
obtains on the PM-prepared independent worktree are **evidence**. The PM reviews and accepts that evidence without
|
|
23
|
+
executing the gates.
|
|
23
24
|
|
|
24
25
|
> A real CEP lesson: a report claimed 28/28 tests passing, the PM re-ran it and 4 specs failed (the cause was a value
|
|
25
26
|
> import used to import a pure type under `verbatimModuleSyntax`). Conclusion: a report ≠ evidence, verification has
|
|
@@ -29,11 +30,11 @@ worktree are **evidence**.
|
|
|
29
30
|
|
|
30
31
|
1. **Claim**: the conclusion an agent writes in its report (least trustworthy).
|
|
31
32
|
2. **Checkable artefact**: commits, test files, log files, diffs.
|
|
32
|
-
3. **Independent verification**: the result
|
|
33
|
-
trustworthy).
|
|
33
|
+
3. **Independent verification**: the result a non-implementer verifier gets by running the same commands on **another
|
|
34
|
+
checkout** prepared by the PM (most trustworthy).
|
|
34
35
|
|
|
35
|
-
Any "passes/done" has to land in layers 2 and 3. The acceptance commands in a brief plus the
|
|
36
|
-
the implementation of that chain.
|
|
36
|
+
Any "passes/done" has to land in layers 2 and 3. The acceptance commands in a brief plus the verifier's `team review`
|
|
37
|
+
are the implementation of that chain; the PM independently reads and compares the evidence and diff.
|
|
37
38
|
|
|
38
39
|
## 3. Isolation: worktree + branch + a long-lived cwd
|
|
39
40
|
|
|
@@ -42,8 +43,10 @@ the implementation of that chain.
|
|
|
42
43
|
(CEP has been there).
|
|
43
44
|
- Why not "one worktree per task": sessions fragment, and both follow-up questions and resuming from a checkpoint get
|
|
44
45
|
harder; a long-lived worktree lets the agent keep its memory.
|
|
45
|
-
- The main worktree (main) belongs to the PM alone: merges,
|
|
46
|
-
fights an agent over the workspace.
|
|
46
|
+
- The main worktree (main) belongs to the PM alone: merges, evidence acceptance and documentation happen there, so
|
|
47
|
+
nobody fights an agent over the workspace. The only worker-side exception is that `team review`, invoked by the
|
|
48
|
+
assigned verifier from its own worktree, writes the brief-named `docs/team/reviews/<ID>.md` and `<ID>-verify.log`
|
|
49
|
+
plus its existing runtime bookkeeping. This grants no manual main edits or other paths.
|
|
47
50
|
- **A merged branch is deleted at once.** Landing is `merge --squash` + commit + push, then `close`, then
|
|
48
51
|
`git branch -D <branch>`: the commit on `main` is the deliverable and the branch is only the vehicle. Nothing of
|
|
49
52
|
value lives only on a branch, and keeping them turns the branch list into an archeology site (134 branches removed
|
|
@@ -71,7 +74,10 @@ Guards and limitations:
|
|
|
71
74
|
never falls back to `send-keys`, and a failed enqueue is logged while the inbox line stays.
|
|
72
75
|
- The inbox is transient state (gitignored); the durable record is still the report + verification + decision log.
|
|
73
76
|
- **Settles inside one stretch of work become one line, not one line each**: consecutive notices with the same
|
|
74
|
-
merge key (seat, task, state class, `awaiting=` set) fold into the line at the end of the
|
|
77
|
+
merge key (seat, task, state class, `awaiting=` set, delivered revision) fold into the line at the end of the
|
|
78
|
+
inbox file. The last component is the twelve-character `tip=` only for delivered lines, or one shared no-revision
|
|
79
|
+
marker when no tip can be proven; suspended and interrupted progress ignore tips and keep merging. Different
|
|
80
|
+
delivered tips start separate lines and wake once each; same-tip events merge without another wake. A merged line
|
|
75
81
|
carries `×N first=<ISO> last=<ISO>` and the **field values of the last event** (`tip=`, `branch=`, `uncommitted=`).
|
|
76
82
|
The line is a **window summary**, not the seat's current state: `last=` names the event whose revision it
|
|
77
83
|
describes, and the run's earlier events are read from the detail file with `team inbox <agent> --detail` (raw
|
|
@@ -129,7 +135,11 @@ Guards and limitations:
|
|
|
129
135
|
it, a harvested job stays silent, several finishing jobs arrive as one message, and every turn end appends
|
|
130
136
|
`settled-with-unharvested=<n>` to `state/bg.log` (runbook: `workflows.md` §E2).
|
|
131
137
|
- **The identity record** (P159): the extension writes `state/bg/<id>.job` **before** it returns the id — `id`,
|
|
132
|
-
`pid`, `pgid`, `start` (the start-time fingerprint from `/proc/<pid>/stat`), `cwd`, `log`, `cmd`.
|
|
138
|
+
`pid`, `pgid`, `start` (the start-time fingerprint from `/proc/<pid>/stat`), `session_cwd`, `cwd`, `log`, `cmd`.
|
|
139
|
+
`session_cwd` is the absolute initiating session directory; `cwd` remains the command's execution directory and
|
|
140
|
+
may be an independent checkout. Suspension ownership uses only `session_cwd` after the same live
|
|
141
|
+
`(pid, start-time)` validation. A legacy record without that field is accepted only when `cwd` resolves exactly
|
|
142
|
+
to the seat worktree; relative, missing, foreign, subdirectory and independent-checkout paths belong to no seat.
|
|
133
143
|
`team bg list` prints one row per record of **this** project's state directory and signals nothing;
|
|
134
144
|
`team bg stop <id>` signals exactly the recorded job and prints what it signalled. Identity is
|
|
135
145
|
`(pid, start-time)`: the pid must be alive **and** the fingerprint must match, so a reused pid is refused
|
|
@@ -646,8 +656,8 @@ A trap: an add/add conflict is often git's rename detection pairing two differen
|
|
|
646
656
|
refuses and explains why);
|
|
647
657
|
2. **Read-only observation**: `roster` / `digest` show the branch, dirty file count, commits ahead and a
|
|
648
658
|
"waiting to be wrapped up" list;
|
|
649
|
-
3. **Verification evidence**: `review <ID> --dir <the checkout the PM
|
|
650
|
-
`reviews/<ID>.md` (git is prepared by the PM).
|
|
659
|
+
3. **Verification evidence**: the assigned non-implementer verifier runs `review <ID> --dir <the checkout the PM
|
|
660
|
+
prepared>`; the tool writes the named central `reviews/<ID>.md` and companion log (git is prepared by the PM).
|
|
651
661
|
- The conventions (written in SKILL.md and the project's PROTOCOL, for the PM to follow): one long-lived worktree per
|
|
652
662
|
agent; task branches cut off the protected branch; verification on a detached independent checkout; merging =
|
|
653
663
|
squashing into the protected branch (with a PR, merge the PR first and then `fetch + merge --ff-only`);
|
|
@@ -829,9 +839,10 @@ what it cannot judge (P148's rule); an unchanged tree adds no stdout at all. The
|
|
|
829
839
|
`tests/flip-p158.sh` (four cases plus two `--break=` shadows), and suite section `0i` runs it.
|
|
830
840
|
|
|
831
841
|
**How often the full suite runs (2026-09-23, user directive).** The full suite takes 13-20 minutes and the
|
|
832
|
-
machine runs one at a time, so it is a *milestone* gate, not a per-change habit:
|
|
833
|
-
delivery** (not per batch),
|
|
834
|
-
|
|
842
|
+
machine runs one at a time, so it is a *milestone* gate, not a per-change habit: an implementation worker runs it
|
|
843
|
+
**once at delivery** (not per batch), the assigned verifier runs it **once per applicable review**, and a delegated
|
|
844
|
+
non-PM worker runs it on the protected branch **only at archive/release milestones** — per merge the PM reads the
|
|
845
|
+
delivered run plus CI and never substitutes a PM-owned background gate for delegation. A change whose diff touches no
|
|
835
846
|
product path (for example records under `docs/**` only) needs **no** suite run: say so in the report and let
|
|
836
847
|
the guarded FAST set (or nothing) stand as the evidence. When in doubt prefer FAST plus the affected
|
|
837
848
|
sections and name what you did not run; **never** claim a full run you did not do. Which sections a changed path affects is
|