@hassangameryt/freeflow 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +2 -2
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +2 -2
- package/.codex-plugin/plugin.json +3 -3
- package/.cursor-plugin/plugin.json +1 -1
- package/README.md +96 -149
- package/capabilities/cognitive-routing/SKILL.md +21 -129
- package/capabilities/cognitive-routing/references/coordinator.md +163 -0
- package/capabilities/cognitive-routing/references/worker.md +38 -0
- package/capabilities/compaction/SKILL.md +3 -3
- package/capabilities/compaction/references/summary-format.md +26 -15
- package/capabilities/messaging/SKILL.md +49 -0
- package/capabilities/task-memory/SKILL.md +87 -0
- package/command-surface.json +6 -54
- package/gemini-extension.json +1 -1
- package/hooks/claude/hooks.json +13 -3
- package/hooks/codex/hooks.json +2 -1
- package/hooks/shared/runtime-context.mjs +69 -77
- package/package.json +25 -8
- package/pi-extension/dist/ask-user/ask.js +108 -0
- package/pi-extension/dist/ask-user/form.js +250 -0
- package/pi-extension/dist/ask-user/questions.js +66 -0
- package/pi-extension/dist/ask-user/tool.js +124 -0
- package/pi-extension/dist/cognitive-routing/assembler.js +35 -11
- package/pi-extension/dist/cognitive-routing/bootstrap.js +90 -0
- package/pi-extension/dist/cognitive-routing/config.js +3 -4
- package/pi-extension/dist/cognitive-routing/event-store.js +4 -1
- package/pi-extension/dist/cognitive-routing/gate.js +20 -5
- package/pi-extension/dist/cognitive-routing/handlers.js +15 -13
- package/pi-extension/dist/cognitive-routing/model-control.js +17 -8
- package/pi-extension/dist/cognitive-routing/projection.js +23 -6
- package/pi-extension/dist/cognitive-routing/provenance.js +3 -1
- package/pi-extension/dist/cognitive-routing/render.js +15 -15
- package/pi-extension/dist/cognitive-routing/runtime.js +4 -2
- package/pi-extension/dist/cognitive-routing/schemas.js +4 -4
- package/pi-extension/dist/cognitive-routing/session.js +3 -1
- package/pi-extension/dist/cognitive-routing/sources.js +29 -4
- package/pi-extension/dist/cognitive-routing/state.js +18 -8
- package/pi-extension/dist/cognitive-routing/status.js +4 -3
- package/pi-extension/dist/cognitive-routing/tools.js +29 -15
- package/pi-extension/dist/cognitive-routing/types.js +10 -1
- package/pi-extension/dist/compaction/carry.js +36 -22
- package/pi-extension/dist/compaction/config.js +4 -2
- package/pi-extension/dist/compaction/controller.js +52 -29
- package/pi-extension/dist/compaction/harness.js +19 -3
- package/pi-extension/dist/compaction/results.js +14 -13
- package/pi-extension/dist/compaction/tool.js +6 -6
- package/pi-extension/dist/host/catalog.js +20 -35
- package/pi-extension/dist/host/config-validation.js +233 -0
- package/pi-extension/dist/host/config.js +78 -91
- package/pi-extension/dist/host/inbound.js +142 -0
- package/pi-extension/dist/host/projection-tags.js +1 -1
- package/pi-extension/dist/host/prompts.js +24 -13
- package/pi-extension/dist/host/read-only-session.js +6 -1
- package/pi-extension/dist/host/request-history.js +7 -3
- package/pi-extension/dist/host/rows.js +25 -0
- package/pi-extension/dist/host/runtime-state.js +17 -2
- package/pi-extension/dist/host/section-keeper.js +85 -0
- package/pi-extension/dist/host/settings/freeflow-command.js +846 -93
- package/pi-extension/dist/host/settings/settings-view.js +27 -8
- package/pi-extension/dist/host/status.js +19 -5
- package/pi-extension/dist/index.js +638 -72
- package/pi-extension/dist/messaging/config.js +27 -0
- package/pi-extension/dist/messaging/messaging.js +398 -0
- package/pi-extension/dist/messaging/registry.js +57 -0
- package/pi-extension/dist/messaging/render.js +90 -0
- package/pi-extension/dist/messaging/tools.js +109 -0
- package/pi-extension/dist/messaging/transport.js +101 -0
- package/pi-extension/dist/provider-support/cache/keepalive.js +16 -4
- package/pi-extension/dist/task-memory/config.js +49 -0
- package/pi-extension/dist/task-memory/registry.js +119 -0
- package/pi-extension/dist/task-memory/render.js +107 -0
- package/pi-extension/dist/task-memory/runtime.js +994 -0
- package/pi-extension/dist/task-memory/tool.js +233 -0
- package/pi-extension/dist/tool-execution/apply-patch/tool.js +1 -1
- package/pi-extension/dist/tool-execution/background.js +220 -28
- package/pi-extension/dist/tool-execution/config.js +14 -3
- package/pi-extension/dist/tool-execution/file-tracking.js +24 -4
- package/pi-extension/dist/tool-execution/guidance-notices.js +124 -0
- package/pi-extension/dist/tool-execution/skill-reads.js +143 -0
- package/pi-extension/dist/tool-execution/tools.js +2 -2
- package/runtime/prompts/cognitive-routing.md +4 -4
- package/runtime/prompts/core.md +24 -14
- package/runtime/prompts/interaction-contract.md +7 -4
- package/runtime/prompts/tool-execution.md +3 -16
- package/runtime/prompts/working-method.md +16 -99
- package/skills/deliver-work/SKILL.md +76 -0
- package/skills/deliver-work/references/branch-closeout.md +134 -0
- package/skills/deliver-work/references/commit.md +83 -0
- package/skills/deliver-work/references/launch.md +94 -0
- package/skills/deliver-work/references/release.md +85 -0
- package/skills/deliver-work/scripts/commit-state.mjs +139 -0
- package/skills/deliver-work/scripts/delivery-state.mjs +107 -0
- package/skills/deliver-work/scripts/lib/git-state.mjs +178 -0
- package/skills/deliver-work/scripts/push-route.mjs +122 -0
- package/skills/deliver-work/scripts/release-preflight.mjs +177 -0
- package/skills/discuss-work/SKILL.md +148 -0
- package/skills/{discuss → discuss-work}/references/discussion-continuity.md +10 -27
- package/skills/discuss-work/references/learning-action.md +36 -0
- package/skills/discuss-work/scripts/choices.mjs +101 -0
- package/skills/discuss-work/scripts/lib/choices.mjs +159 -0
- package/skills/evaluate-behavior/SKILL.md +107 -0
- package/skills/evaluate-behavior/references/authoring.md +381 -0
- package/skills/evaluate-behavior/references/coding-tasks.md +145 -0
- package/skills/evaluate-behavior/references/conversations-pipelines-judges.md +177 -0
- package/skills/evaluate-behavior/references/design-and-measurement.md +273 -0
- package/skills/evaluate-behavior/references/running-and-evidence.md +245 -0
- package/skills/evaluate-behavior/scripts/claude-guard.mjs +76 -0
- package/skills/evaluate-behavior/scripts/guard-rules.mjs +309 -0
- package/skills/evaluate-behavior/scripts/lib/agreement.mjs +90 -0
- package/skills/evaluate-behavior/scripts/lib/arms.mjs +55 -0
- package/skills/evaluate-behavior/scripts/lib/budget.mjs +87 -0
- package/skills/evaluate-behavior/scripts/lib/build-source.mjs +287 -0
- package/skills/evaluate-behavior/scripts/lib/clear.mjs +74 -0
- package/skills/evaluate-behavior/scripts/lib/container.mjs +395 -0
- package/skills/evaluate-behavior/scripts/lib/decision.mjs +418 -0
- package/skills/evaluate-behavior/scripts/lib/definitions.mjs +1072 -0
- package/skills/evaluate-behavior/scripts/lib/freeflow.mjs +103 -0
- package/skills/evaluate-behavior/scripts/lib/grade-command.mjs +591 -0
- package/skills/evaluate-behavior/scripts/lib/grade-comparison.mjs +90 -0
- package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/grade-interaction.mjs +19 -18
- package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/grade-support.mjs +32 -5
- package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/grade-workspace.mjs +28 -12
- package/skills/evaluate-behavior/scripts/lib/grade.mjs +101 -0
- package/skills/evaluate-behavior/scripts/lib/hooks.mjs +98 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/confinement.mjs +196 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/constraints.mjs +111 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/index.mjs +48 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/isolation.mjs +74 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/launch.mjs +123 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/model-call.mjs +73 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/recorder.mjs +178 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/session.mjs +494 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/skills.mjs +81 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/index.mjs +31 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/names.mjs +3 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/pi/confinement.mjs +173 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/pi/host.mjs +148 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/pi/index.mjs +70 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/pi/isolation.mjs +81 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/pi/model-call.mjs +79 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/pi/process.mjs +241 -0
- package/skills/{evaluate-skill/scripts/lib → evaluate-behavior/scripts/lib/hosts/pi}/rpc.mjs +144 -26
- package/skills/evaluate-behavior/scripts/lib/identity.mjs +82 -0
- package/skills/evaluate-behavior/scripts/lib/judge.mjs +688 -0
- package/skills/evaluate-behavior/scripts/lib/metrics.mjs +332 -0
- package/skills/evaluate-behavior/scripts/lib/model-call.mjs +17 -0
- package/skills/evaluate-behavior/scripts/lib/participants.mjs +616 -0
- package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/process.mjs +22 -0
- package/skills/evaluate-behavior/scripts/lib/queue.mjs +54 -0
- package/skills/evaluate-behavior/scripts/lib/reference.mjs +343 -0
- package/skills/evaluate-behavior/scripts/lib/reuse.mjs +277 -0
- package/skills/evaluate-behavior/scripts/lib/review.mjs +933 -0
- package/skills/evaluate-behavior/scripts/lib/runner.mjs +732 -0
- package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/sandbox.mjs +119 -14
- package/skills/evaluate-behavior/scripts/lib/scan-shell.mjs +457 -0
- package/skills/evaluate-behavior/scripts/lib/scan.mjs +479 -0
- package/skills/evaluate-behavior/scripts/lib/seal.mjs +91 -0
- package/skills/evaluate-behavior/scripts/lib/shell.mjs +560 -0
- package/skills/evaluate-behavior/scripts/lib/source-override.mjs +64 -0
- package/skills/evaluate-behavior/scripts/lib/subject-file.mjs +88 -0
- package/skills/{evaluate-skill/scripts/lib/pi.mjs → evaluate-behavior/scripts/lib/subject.mjs} +235 -265
- package/skills/evaluate-behavior/scripts/lib/task-copy.mjs +124 -0
- package/skills/evaluate-behavior/scripts/lib/trials.mjs +524 -0
- package/skills/evaluate-behavior/scripts/lib/validity.mjs +68 -0
- package/skills/evaluate-behavior/scripts/lib/view-html.mjs +454 -0
- package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/view.mjs +159 -18
- package/skills/{evaluate-skill → evaluate-behavior}/scripts/pi-command-tool.mjs +21 -6
- package/skills/evaluate-behavior/scripts/pi-container-route.mjs +23 -0
- package/skills/evaluate-behavior/scripts/pi-guard.mjs +77 -0
- package/skills/evaluate-behavior/scripts/pi-login-refresh.mjs +31 -0
- package/skills/evaluate-behavior/scripts/skill-eval.mjs +586 -0
- package/skills/execute-work/SKILL.md +96 -104
- package/skills/execute-work/references/code-practices.md +27 -51
- package/skills/execute-work/references/design.md +271 -0
- package/skills/execute-work/references/diagnose.md +117 -0
- package/skills/execute-work/references/migration.md +108 -0
- package/skills/execute-work/references/simplify.md +65 -0
- package/skills/execute-work/scripts/self-review.mjs +422 -0
- package/skills/execute-work/scripts/touch-map.mjs +290 -0
- package/skills/review-work/SKILL.md +89 -65
- package/skills/review-work/references/adjudication.md +94 -0
- package/skills/review-work/references/artifact.md +198 -0
- package/skills/review-work/references/evals-and-judges.md +66 -0
- package/skills/review-work/references/work.md +177 -0
- package/skills/review-work/scripts/check-brief.mjs +128 -0
- package/skills/review-work/scripts/review-packet.mjs +233 -0
- package/skills/setup-freeflow/SKILL.md +68 -17
- package/skills/track-work/SKILL.md +52 -20
- package/skills/track-work/references/handoff.md +190 -0
- package/skills/track-work/references/projects.md +51 -0
- package/skills/track-work/references/working-record-format.md +36 -18
- package/skills/track-work/scripts/lib/document.mjs +17 -13
- package/skills/track-work/scripts/lib/format.mjs +2 -0
- package/skills/track-work/scripts/lib/recover.mjs +254 -0
- package/skills/track-work/scripts/lib/registry.mjs +656 -0
- package/skills/track-work/scripts/lib/search.mjs +40 -0
- package/skills/track-work/scripts/lib/store.mjs +46 -15
- package/skills/track-work/scripts/lib/views.mjs +50 -1
- package/skills/track-work/scripts/working-record.mjs +232 -13
- package/skills/verify-work/SKILL.md +45 -37
- package/skills/verify-work/references/feature-map.md +120 -0
- package/skills/verify-work/references/runtime-evidence.md +203 -0
- package/skills/verify-work/references/test-design.md +25 -6
- package/skills/verify-work/scripts/test-changes.mjs +246 -0
- package/skills/write-docs/SKILL.md +113 -25
- package/skills/write-docs/references/documentation-shapes.md +68 -3
- package/skills/write-docs/references/spec-and-plan-shapes.md +308 -0
- package/skills/write-docs/scripts/artifact-check.mjs +148 -0
- package/skills/write-docs/scripts/docs-check.mjs +96 -6
- package/skills/write-docs/scripts/plan-lint.mjs +123 -0
- package/skills/write-skill/SKILL.md +92 -52
- package/skills/write-skill/references/activation-and-wording.md +143 -0
- package/skills/write-skill/references/placement-and-dependencies.md +154 -0
- package/skills/write-skill/scripts/lib/compare.mjs +701 -0
- package/skills/write-skill/scripts/lib/skill-author.mjs +197 -3
- package/skills/write-skill/scripts/skill-author.mjs +51 -8
- package/capabilities/cognitive-routing/references/both-mode.md +0 -36
- package/capabilities/cognitive-routing/references/executor-mode.md +0 -48
- package/capabilities/cognitive-routing/references/helper-mode.md +0 -47
- package/plugin.json +0 -33
- package/skills/action-selection/SKILL.md +0 -92
- package/skills/action-selection/references/trajectory-stalls.md +0 -73
- package/skills/bypass/SKILL.md +0 -153
- package/skills/commit-work/SKILL.md +0 -93
- package/skills/commit-work/references/git-state-edges.md +0 -94
- package/skills/commit-work/references/simple-push.md +0 -94
- package/skills/commit-work/references/staging-decisions.md +0 -106
- package/skills/decision-gate/SKILL.md +0 -87
- package/skills/design-for-depth/SKILL.md +0 -108
- package/skills/design-for-depth/references/design-pressure-signals.md +0 -84
- package/skills/design-for-depth/references/implementation-decisions.md +0 -76
- package/skills/design-for-depth/references/interface-design-loop.md +0 -105
- package/skills/design-for-depth/references/module-and-dependency-design.md +0 -117
- package/skills/design-for-depth/references/state-and-failure-boundaries.md +0 -125
- package/skills/diagnose-failure/SKILL.md +0 -140
- package/skills/diagnose-failure/references/diagnostic-loop-catalog.md +0 -50
- package/skills/diagnose-failure/references/flaky-and-performance-diagnosis.md +0 -51
- package/skills/discuss/SKILL.md +0 -140
- package/skills/evaluate-skill/SKILL.md +0 -188
- package/skills/evaluate-skill/references/evaluation-definition-schema.md +0 -415
- package/skills/evaluate-skill/references/evaluation-design.md +0 -112
- package/skills/evaluate-skill/references/execution-and-evidence.md +0 -111
- package/skills/evaluate-skill/references/review-and-revision.md +0 -94
- package/skills/evaluate-skill/scripts/lib/definitions.mjs +0 -448
- package/skills/evaluate-skill/scripts/lib/grade-comparison.mjs +0 -60
- package/skills/evaluate-skill/scripts/lib/grade.mjs +0 -64
- package/skills/evaluate-skill/scripts/lib/review.mjs +0 -196
- package/skills/evaluate-skill/scripts/lib/runner.mjs +0 -405
- package/skills/evaluate-skill/scripts/lib/trials.mjs +0 -103
- package/skills/evaluate-skill/scripts/pi-guard.mjs +0 -181
- package/skills/evaluate-skill/scripts/skill-eval.mjs +0 -182
- package/skills/execute-work/references/execute-work-edges.md +0 -78
- package/skills/finish-branch/SKILL.md +0 -117
- package/skills/finish-branch/references/integration-options.md +0 -80
- package/skills/handoff/SKILL.md +0 -82
- package/skills/handoff/references/handoff-templates.md +0 -150
- package/skills/launch-work/SKILL.md +0 -116
- package/skills/launch-work/references/launch-readiness.md +0 -85
- package/skills/migration-work/SKILL.md +0 -115
- package/skills/migration-work/references/migration-lifecycle.md +0 -82
- package/skills/release-work/SKILL.md +0 -118
- package/skills/release-work/references/release-evidence.md +0 -78
- package/skills/review-artifact/SKILL.md +0 -143
- package/skills/review-artifact/references/adjudicate-artifact-review.md +0 -101
- package/skills/review-artifact/references/independent-artifact-reviewer-contract.md +0 -159
- package/skills/review-work/references/adjudicate-work-review.md +0 -97
- package/skills/review-work/references/independent-work-reviewer-contract.md +0 -139
- package/skills/review-work/references/security-risk-lens.md +0 -67
- package/skills/setup-freeflow/references/activation-contract.md +0 -103
- package/skills/setup-freeflow/references/host-setup.md +0 -67
- package/skills/simplify-code/SKILL.md +0 -85
- package/skills/simplify-code/references/simplification-patterns.md +0 -70
- package/skills/verify-work/references/browser-runtime-evidence.md +0 -51
- package/skills/verify-work/references/integration-evidence.md +0 -49
- package/skills/verify-work/references/performance-evidence.md +0 -59
- package/skills/workflow/SKILL.md +0 -171
- package/skills/workflow/references/domain-skill-composition.md +0 -45
- package/skills/write-plan/SKILL.md +0 -92
- package/skills/write-plan/references/plan-shapes.md +0 -156
- package/skills/write-skill/references/activation-boundaries.md +0 -106
- package/skills/write-skill/references/agent-first-instructions.md +0 -133
- package/skills/write-skill/references/progressive-disclosure.md +0 -129
- package/skills/write-skill/references/skill-dependency-graphs.md +0 -192
- package/skills/write-spec/SKILL.md +0 -85
- package/skills/write-spec/references/artifact-standards.md +0 -86
- package/skills/write-spec/references/decision-records.md +0 -80
- package/skills/write-spec/references/spec-shapes.md +0 -143
- /package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/evidence.mjs +0 -0
- /package/skills/{evaluate-skill → evaluate-behavior}/scripts/pi-observer.mjs +0 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Prefills a work reviewer's pointer brief (references/work.md, "The Brief") from the repository and the task folder,
|
|
3
|
+
// then runs check-brief.mjs on it, so the brief points at the requirements, the right diff and the prior report
|
|
4
|
+
// without being assembled by hand. It also reports the review gate's triggers the diff shows and the review-round
|
|
5
|
+
// budget. Lines it cannot fill (the Boundary, unless given) stay empty, so check-brief refuses the brief until the
|
|
6
|
+
// initiator fills them.
|
|
7
|
+
// Usage: review-packet.mjs --review <1|2|3> --base <ref> [--head <ref>] [--task <task folder>] [--out <brief.md>]
|
|
8
|
+
// [--boundary <text>] [--agreement <path>]... [--evidence <path>]... [--may-run <text>]
|
|
9
|
+
// [--root <repository>] [--json]
|
|
10
|
+
// With --task, the brief is written to <task>/scratch/reviews/R<n>-brief.md, the report path is R<n>-report.md beside
|
|
11
|
+
// it, the agreement defaults to the task's record.md, and Review 2 or 3 takes its diff from the previous brief's
|
|
12
|
+
// reviewed state and points to R<n-1>-report.md. Docs come from Write Docs' docs-check.mjs --covering on the changed
|
|
13
|
+
// files. Exit code: check-brief's (0 passes, 1 has problems); 2 on a usage or Git error.
|
|
14
|
+
import { execFileSync, spawnSync } from "node:child_process";
|
|
15
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
16
|
+
import { dirname, join, relative, resolve } from "node:path";
|
|
17
|
+
import { fileURLToPath } from "node:url";
|
|
18
|
+
import { parseArgs } from "node:util";
|
|
19
|
+
|
|
20
|
+
const USAGE =
|
|
21
|
+
"Usage: review-packet.mjs --review <1|2|3> --base <ref> [--head <ref>] [--task <task folder>] [--out <brief.md>] [--boundary <text>] [--agreement <path>]... [--evidence <path>]... [--may-run <text>] [--root <repository>] [--json]";
|
|
22
|
+
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
23
|
+
const CHECK_BRIEF = join(HERE, "check-brief.mjs");
|
|
24
|
+
const DOCS_CHECK = resolve(HERE, "../../write-docs/scripts/docs-check.mjs");
|
|
25
|
+
const SKILL = resolve(HERE, "../SKILL.md");
|
|
26
|
+
|
|
27
|
+
function fail(message) {
|
|
28
|
+
console.error(message);
|
|
29
|
+
process.exit(2);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let values;
|
|
33
|
+
try {
|
|
34
|
+
({ values } = parseArgs({
|
|
35
|
+
options: {
|
|
36
|
+
review: { type: "string" },
|
|
37
|
+
base: { type: "string" },
|
|
38
|
+
head: { type: "string", default: "HEAD" },
|
|
39
|
+
task: { type: "string" },
|
|
40
|
+
out: { type: "string" },
|
|
41
|
+
boundary: { type: "string" },
|
|
42
|
+
agreement: { type: "string", multiple: true, default: [] },
|
|
43
|
+
evidence: { type: "string", multiple: true, default: [] },
|
|
44
|
+
"may-run": { type: "string" },
|
|
45
|
+
root: { type: "string" },
|
|
46
|
+
json: { type: "boolean", default: false },
|
|
47
|
+
},
|
|
48
|
+
}));
|
|
49
|
+
} catch (error) {
|
|
50
|
+
fail(`${error.message}\n${USAGE}`);
|
|
51
|
+
}
|
|
52
|
+
const round = Number(values.review);
|
|
53
|
+
if (![1, 2, 3].includes(round) || !values.base) fail(USAGE);
|
|
54
|
+
if (!values.task && !values.out) fail(`give --task or --out for where the brief goes\n${USAGE}`);
|
|
55
|
+
|
|
56
|
+
const git = (cwd, args) =>
|
|
57
|
+
execFileSync("git", args, { cwd, encoding: "utf8", maxBuffer: 64 * 1024 * 1024, stdio: ["ignore", "pipe", "pipe"] });
|
|
58
|
+
let root;
|
|
59
|
+
try {
|
|
60
|
+
root = resolve(git(resolve(values.root ?? "."), ["rev-parse", "--show-toplevel"]).trim());
|
|
61
|
+
} catch {
|
|
62
|
+
fail("not inside a Git repository");
|
|
63
|
+
}
|
|
64
|
+
const commitOf = (ref) => {
|
|
65
|
+
try {
|
|
66
|
+
return git(root, ["rev-parse", "--verify", "--quiet", `${ref}^{commit}`]).trim();
|
|
67
|
+
} catch {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const head = commitOf(values.head);
|
|
72
|
+
if (!head) fail(`no such commit: ${values.head}`);
|
|
73
|
+
if (!commitOf(values.base)) fail(`no such commit: ${values.base}`);
|
|
74
|
+
|
|
75
|
+
// Paths in the brief: relative to the repository when inside it, absolute otherwise.
|
|
76
|
+
const show = (path) => {
|
|
77
|
+
const relativePath = relative(root, resolve(path));
|
|
78
|
+
return relativePath.startsWith("..") ? resolve(path) : relativePath;
|
|
79
|
+
};
|
|
80
|
+
const tick = (paths) => paths.map((path) => `\`${show(path)}\``).join(", ");
|
|
81
|
+
|
|
82
|
+
const task = values.task ? resolve(values.task) : null;
|
|
83
|
+
const reviews = task ? join(task, "scratch", "reviews") : dirname(resolve(values.out));
|
|
84
|
+
const briefPath = values.out ? resolve(values.out) : join(reviews, `R${round}-brief.md`);
|
|
85
|
+
const reportPath = join(task ? reviews : dirname(briefPath), `R${round}-report.md`);
|
|
86
|
+
const notes = [];
|
|
87
|
+
|
|
88
|
+
// Review 2 or 3 reviews the range since the previous review's reviewed state.
|
|
89
|
+
let diffBase = values.base;
|
|
90
|
+
let previousReport = null;
|
|
91
|
+
if (round > 1) {
|
|
92
|
+
const previousBrief = join(reviews, `R${round - 1}-brief.md`);
|
|
93
|
+
const reviewed = existsSync(previousBrief)
|
|
94
|
+
? /^\s*(?:[-*]\s+)?(?:\*\*)?Reviewed state:(?:\*\*)?\s*`?([0-9a-fA-F]{7,40}|\S+?)`?(\s|$)/m.exec(
|
|
95
|
+
readFileSync(previousBrief, "utf8"),
|
|
96
|
+
)?.[1]
|
|
97
|
+
: null;
|
|
98
|
+
if (reviewed && commitOf(reviewed)) diffBase = reviewed;
|
|
99
|
+
else notes.push(`no previous brief with a Reviewed state at ${show(previousBrief)}: the diff starts at --base`);
|
|
100
|
+
const candidate = join(reviews, `R${round - 1}-report.md`);
|
|
101
|
+
if (existsSync(candidate)) previousReport = candidate;
|
|
102
|
+
else notes.push(`no previous report at ${show(candidate)}: add its path and adjudication to "Previous report"`);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const agreement = values.agreement.length
|
|
106
|
+
? values.agreement
|
|
107
|
+
: task && existsSync(join(task, "record.md"))
|
|
108
|
+
? [join(task, "record.md")]
|
|
109
|
+
: [];
|
|
110
|
+
if (!agreement.length) notes.push("no agreement found: pass --agreement (the record, or the accepted requirements)");
|
|
111
|
+
|
|
112
|
+
const changed = git(root, ["-c", "core.quotePath=false", "diff", "--name-only", diffBase, head])
|
|
113
|
+
.split("\n")
|
|
114
|
+
.filter(Boolean);
|
|
115
|
+
|
|
116
|
+
// Developer docs covering the changed files.
|
|
117
|
+
let docs = [];
|
|
118
|
+
if (changed.length && existsSync(DOCS_CHECK)) {
|
|
119
|
+
const run = spawnSync(
|
|
120
|
+
process.execPath,
|
|
121
|
+
[DOCS_CHECK, ...changed.flatMap((path) => ["--covering", path]), "--root", root, "--json"],
|
|
122
|
+
{ encoding: "utf8", maxBuffer: 64 * 1024 * 1024 },
|
|
123
|
+
);
|
|
124
|
+
if (run.status === 0)
|
|
125
|
+
docs = [...new Set(JSON.parse(run.stdout).paths.flatMap((entry) => entry.documents.map((doc) => doc.path)))];
|
|
126
|
+
else notes.push("docs-check could not run: fill Docs by hand");
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// The project's Review Rules, when it keeps them in a file.
|
|
130
|
+
const rules = git(root, ["ls-files"])
|
|
131
|
+
.split("\n")
|
|
132
|
+
.filter((path) => /(^|\/)(REVIEW\.md|review-rules\.md|REVIEW_RULES\.md)$/i.test(path));
|
|
133
|
+
|
|
134
|
+
// The project's declared checks, for "May run".
|
|
135
|
+
let mayRun = values["may-run"] ?? "";
|
|
136
|
+
if (!mayRun && existsSync(join(root, "package.json"))) {
|
|
137
|
+
try {
|
|
138
|
+
const scripts = Object.keys(JSON.parse(readFileSync(join(root, "package.json"), "utf8")).scripts ?? {});
|
|
139
|
+
const declared = ["test", "check", "lint", "typecheck"].filter((name) => scripts.includes(name));
|
|
140
|
+
if (declared.length)
|
|
141
|
+
mayRun = `the project's declared checks: ${declared.map((name) => `\`npm ${name === "test" ? "test" : `run ${name}`}\``).join(", ")}`;
|
|
142
|
+
} catch {
|
|
143
|
+
// An unreadable package.json leaves May run for the initiator.
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (!mayRun) notes.push('fill "May run": the declared checks, or "nothing"');
|
|
147
|
+
|
|
148
|
+
// Review gate triggers the diff shows; the agreement's own review triggers and Review Rules paths need a reader.
|
|
149
|
+
const TRIGGERS = [
|
|
150
|
+
[
|
|
151
|
+
"security, authentication, authorization or secrets",
|
|
152
|
+
/(^|[/_.-])(auth[nz]?|oauth|login|passwords?|secrets?|credentials?|tokens?|permissions?|crypto|sessions?)([/_.-]|$)|authenticat|authoriz|(^|\/)\.env/i,
|
|
153
|
+
],
|
|
154
|
+
["possible data loss or a migration of stored data", /(migrat|schema|\.sql$|database|(^|\/)db\/|storage|persist)/i],
|
|
155
|
+
[
|
|
156
|
+
"CI or release files",
|
|
157
|
+
/(^\.github\/workflows\/|^\.gitlab-ci|^\.circleci\/|(^|\/)release|CHANGELOG|^scripts\/release)/i,
|
|
158
|
+
],
|
|
159
|
+
[
|
|
160
|
+
"a public interface",
|
|
161
|
+
/(^package\.json$|(^|\/)bin\/|\.d\.ts$|(^|\/)SKILL\.md$|command-surface|(^|\/)index\.[cm]?[jt]s$|\.proto$|openapi|(^|\/)api\/)/i,
|
|
162
|
+
],
|
|
163
|
+
];
|
|
164
|
+
const triggers = TRIGGERS.flatMap(([trigger, pattern]) => {
|
|
165
|
+
const paths = changed.filter((path) => pattern.test(path));
|
|
166
|
+
return paths.length ? [{ trigger, paths: paths.slice(0, 10), more: Math.max(0, paths.length - 10) }] : [];
|
|
167
|
+
});
|
|
168
|
+
const budget =
|
|
169
|
+
round === 1
|
|
170
|
+
? "Review 1 of at most 3: the first selected independent review, broad by default."
|
|
171
|
+
: round === 2
|
|
172
|
+
? "Review 2 of at most 3: a focused follow-up on the range since Review 1; if it stays Blocking, adjudicate and diagnose before any Review 3."
|
|
173
|
+
: "Review 3 of 3: exceptional, separately authorized and final; if it stays Blocking, rethink the approach rather than correct again.";
|
|
174
|
+
|
|
175
|
+
const lines = [
|
|
176
|
+
`Review: ${round}`,
|
|
177
|
+
`Boundary: ${values.boundary ?? ""}`,
|
|
178
|
+
`Reviewed state: ${head.slice(0, 12)}`,
|
|
179
|
+
`Method: ${tick([SKILL, join(dirname(SKILL), "references", "work.md")])}`,
|
|
180
|
+
`Agreement: ${tick(agreement)}`,
|
|
181
|
+
`Docs: ${docs.length ? tick(docs) : "none"}`,
|
|
182
|
+
`Review rules: ${rules.length ? tick(rules) : "none"}`,
|
|
183
|
+
`Diff: ${commitOf(diffBase).slice(0, 12)}..${head.slice(0, 12)}`,
|
|
184
|
+
`Evidence: ${values.evidence.length ? tick(values.evidence) : "none"}`,
|
|
185
|
+
`May run: ${mayRun}`,
|
|
186
|
+
...(round > 1 ? [`Previous report: ${previousReport ? tick([previousReport]) : ""}`] : []),
|
|
187
|
+
`Report: ${tick([reportPath])}`,
|
|
188
|
+
];
|
|
189
|
+
mkdirSync(dirname(briefPath), { recursive: true });
|
|
190
|
+
writeFileSync(briefPath, `${lines.join("\n")}\n`);
|
|
191
|
+
mkdirSync(dirname(reportPath), { recursive: true });
|
|
192
|
+
|
|
193
|
+
const check = spawnSync(process.execPath, [CHECK_BRIEF, briefPath, "--root", root, "--json"], { encoding: "utf8" });
|
|
194
|
+
let checked;
|
|
195
|
+
try {
|
|
196
|
+
checked = JSON.parse(check.stdout);
|
|
197
|
+
} catch {
|
|
198
|
+
fail(`check-brief failed: ${(check.stderr || check.stdout).trim()}`);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const result = {
|
|
202
|
+
command: "review-packet",
|
|
203
|
+
root,
|
|
204
|
+
brief: briefPath,
|
|
205
|
+
review: round,
|
|
206
|
+
diff: `${diffBase}..${values.head}`,
|
|
207
|
+
changedFiles: changed.length,
|
|
208
|
+
gateTriggers: triggers,
|
|
209
|
+
gateNotDetected: ["anything the work agreement names for review", "paths the Review Rules mark sensitive"],
|
|
210
|
+
budget,
|
|
211
|
+
notes,
|
|
212
|
+
checkBrief: { ok: checked.ok, problems: checked.problems },
|
|
213
|
+
};
|
|
214
|
+
if (values.json) console.log(JSON.stringify(result, null, 2));
|
|
215
|
+
else {
|
|
216
|
+
console.log(`Brief: ${briefPath}`);
|
|
217
|
+
console.log(lines.map((line) => ` ${line}`).join("\n"));
|
|
218
|
+
console.log(`Changed files: ${changed.length}.`);
|
|
219
|
+
console.log(
|
|
220
|
+
triggers.length
|
|
221
|
+
? `Gate triggers in the diff:\n${triggers.map((each) => `- ${each.trigger}: ${each.paths.join(", ")}${each.more ? ` and ${each.more} more` : ""}`).join("\n")}`
|
|
222
|
+
: "Gate triggers in the diff: none detected by path.",
|
|
223
|
+
);
|
|
224
|
+
console.log(`Not detected here: ${result.gateNotDetected.join("; ")}.`);
|
|
225
|
+
console.log(`Round budget: ${budget}`);
|
|
226
|
+
for (const note of notes) console.log(`Note: ${note}`);
|
|
227
|
+
console.log(
|
|
228
|
+
checked.ok
|
|
229
|
+
? "check-brief: passes. Dispatch this brief."
|
|
230
|
+
: `check-brief: refused. Fill these, then rerun check-brief:\n${checked.problems.map((each) => `- ${each.line}: ${each.problem}`).join("\n")}`,
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
process.exit(checked.ok ? 0 : 1);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: setup-freeflow
|
|
3
|
-
description: Use when activating Freeflow in a repository, repairing its repository or personal configuration, or checking whether the current host is
|
|
3
|
+
description: "Use when installing, activating or turning off Freeflow in a repository, changing or repairing its repository or personal configuration (.freeflow/config.json, .freeflow/local.json), or checking whether the current host is loading Freeflow's guidance and skills."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Setup Freeflow
|
|
@@ -9,21 +9,28 @@ Create or repair the smallest valid layered setup. Keep repository activation, p
|
|
|
9
9
|
|
|
10
10
|
- `.freeflow/config.json` is the required shared repository activation config.
|
|
11
11
|
- `.freeflow/local.json` is an optional per-checkout personal override. It cannot activate Freeflow by itself.
|
|
12
|
-
- Runtime delivery depends on the current host's installed and trusted adapter.
|
|
12
|
+
- Runtime delivery depends on the current host's installed and trusted adapter. Configuration does not prove runtime delivery.
|
|
13
13
|
|
|
14
14
|
Answer setup questions and delivery checks read-only. An explicit action request authorizes the smallest selected setup change under the state rules below. When repository config is missing, first activation authorizes minimal shared config; it does not authorize personal overrides, optional capabilities, replacement of invalid config, or edits to repo-owned host instructions.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
## Routes
|
|
17
|
+
|
|
18
|
+
| Situation | Go to |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| Activating, or changing shared or personal setup | Establish Mutation Authority, then Inspect The Layers, then the section for that layer |
|
|
21
|
+
| Repository config invalid, or conflicting with accepted source truth or repository instructions | [Discuss Work](../discuss-work/SKILL.md), before replacing or reinterpreting it |
|
|
22
|
+
| Whether the host delivers Freeflow, or which host action refreshes it | Hosts, below |
|
|
23
|
+
| Cognitive Routing or Tool Execution values | Their explicit settings surface (on Pi, `/freeflow settings`), only when the user requests them |
|
|
17
24
|
|
|
18
25
|
## Establish Mutation Authority
|
|
19
26
|
|
|
20
27
|
Classify the current state before editing:
|
|
21
28
|
|
|
22
|
-
- **Unconfigured:** repository config is missing or invalid, so Freeflow is not effective. An explicit setup request may create minimal config when it is missing. Replacing or reinterpreting invalid config
|
|
23
|
-
- **Configured but ineffective:** valid repository activation exists, but
|
|
24
|
-
- **Effective:** Freeflow core guidance, the Interaction Contract, and base skills are effective. An explicit setup or repair request may be carried out within its authority; optional capability behavior remains independently gated.
|
|
29
|
+
- **Unconfigured:** repository config is missing or invalid, so repository activation is absent and Freeflow is not effective. An explicit setup request may create minimal config when it is missing. Replacing or reinterpreting invalid config requires specific authorization and resolving the source conflict.
|
|
30
|
+
- **Configured but ineffective:** valid repository activation exists, but effective `enabled` is `false` or an invalid local config blocks runtime. No Freeflow guidance is effective. An explicit request governs the selected enablement, configuration, or repair.
|
|
31
|
+
- **Effective:** Freeflow core guidance, the Interaction Contract, and base skills are effective; obey them. An explicit setup or repair request may be carried out within its authority; optional capability behavior remains independently gated.
|
|
25
32
|
|
|
26
|
-
User-operated host settings are direct user actions, not agent-performed config edits. Prefer them when available
|
|
33
|
+
User-operated host settings are direct user actions, not agent-performed config edits. Prefer them when available, do not claim their state changed until the host reports it, and verify the resulting source and effective state afterward.
|
|
27
34
|
|
|
28
35
|
## Inspect The Layers
|
|
29
36
|
|
|
@@ -36,6 +43,14 @@ Before editing:
|
|
|
36
43
|
|
|
37
44
|
A valid repository config establishes activation. A missing local config inherits repository settings. An invalid existing local config blocks effective Freeflow instead of falling back silently.
|
|
38
45
|
|
|
46
|
+
Resolve each configurable value in this order:
|
|
47
|
+
|
|
48
|
+
```text
|
|
49
|
+
host session override -> personal override -> repository value -> built-in default
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Host session overrides are host state, not config, and cannot bypass missing or invalid repository activation. Pi may temporarily override Freeflow enablement, and Cognitive Routing has its own host-managed session control. Effective Freeflow requires a valid repository config, a missing or valid local config, session-resolved `enabled: true`, and the prompt files the host delivers (Hosts, below).
|
|
53
|
+
|
|
39
54
|
If setup is already valid and no change was requested, preserve it and report the effective sources. Do not rewrite config merely to normalize formatting or materialize defaults.
|
|
40
55
|
|
|
41
56
|
## Configure Shared Activation
|
|
@@ -46,32 +61,62 @@ For a new setup, write the minimal activation boundary:
|
|
|
46
61
|
{}
|
|
47
62
|
```
|
|
48
63
|
|
|
49
|
-
Add `enabled: false` only when the user explicitly requests Freeflow to be disabled. Add optional capability configuration only when the user explicitly requests it.
|
|
64
|
+
Missing core keys use the built-in default `enabled: true`. Add `enabled: false` only when the user explicitly requests Freeflow to be disabled. Add optional capability configuration only when the user explicitly requests it. Do not add task state, phase, file inventories, plans, version metadata, activation paths, empty optional sections, host instruction copies, or generated workflow text.
|
|
50
65
|
|
|
51
|
-
|
|
66
|
+
These keys are unsupported in either config file and make it invalid until repaired: `defaultMode`, `interactionContract`, `skills`, `contextVirtualization`, and `conversationHistory`. The user deletes them wherever present; setup never migrates or removes them automatically.
|
|
52
67
|
|
|
53
|
-
Do not create or append Freeflow instructions in `AGENTS.md`, `CLAUDE.md`, `.claude/rules/`, or another host-owned instruction surface.
|
|
68
|
+
Do not create or append Freeflow instructions in `AGENTS.md`, `CLAUDE.md`, `.claude/rules/`, or another host-owned instruction surface, including to compensate for unavailable or unconfirmed delivery. Existing repo instructions remain live source truth within host precedence. They are not activation markers, but they can conflict with Freeflow behavior: name a conflict and ask through Discuss Work before changing setup or behavior when it would alter the next action, rather than overwriting them to make Freeflow appear active. Do not install repo-local hooks, CLI commands, lint rules, global standards, documentation inventories, or state files during setup.
|
|
54
69
|
|
|
55
70
|
## Add Personal Overrides Only When Requested
|
|
56
71
|
|
|
57
|
-
Use `.freeflow/local.json` for an explicitly selected per-checkout override of `enabled
|
|
72
|
+
Use `.freeflow/local.json` for an explicitly selected per-checkout override of `enabled`:
|
|
58
73
|
|
|
59
|
-
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"enabled": false
|
|
77
|
+
}
|
|
78
|
+
```
|
|
60
79
|
|
|
61
|
-
|
|
80
|
+
Omitted values inherit from repository config and built-in defaults; local precedence is per property, not whole-file replacement. Configure optional Cognitive Routing values only through its explicit settings surface.
|
|
62
81
|
|
|
63
|
-
Before writing local config in a Git checkout, verify it is untracked and ignored. Do not modify shared ignore policy merely to store a personal preference
|
|
82
|
+
Before writing local config in a Git checkout, verify it is untracked and ignored. Do not modify shared ignore policy merely to store a personal preference: prefer the host's safe settings path, `.git/info/exclude`, or an existing ignore rule. Refuse to overwrite a tracked local config.
|
|
64
83
|
|
|
65
84
|
If local config is invalid, report that it blocks effective runtime. Repair or remove it only with authorization; never discard it and fall back silently.
|
|
66
85
|
|
|
86
|
+
## Hosts
|
|
87
|
+
|
|
88
|
+
When Freeflow is effective, host adapters deliver `runtime/prompts/core.md`, `interaction-contract.md` and `working-method.md`, the base Freeflow skill surface, and compact current capability state; on Pi also `tool-execution.md` and `cognitive-routing.md` while those capabilities are effective, with their skills and tools. Adapters load context only; they do not enforce policy, block tools, grant permissions, or replace repo instructions. Context Virtualization and Conversation History are removed.
|
|
89
|
+
|
|
90
|
+
### Pi
|
|
91
|
+
|
|
92
|
+
The Pi extension reads both config layers before each agent turn. When Freeflow is enabled it always delivers the core prompt, Interaction Contract and Working Method together, keeping the existing system prompt. Runtime State is refreshed at session start, after context reconstruction or loss, and when displayed state changes; unchanged state remains in the provider context. Skill and capability bodies stay discoverable rather than delivered as hidden persistent messages.
|
|
93
|
+
|
|
94
|
+
Settings scopes:
|
|
95
|
+
|
|
96
|
+
```text
|
|
97
|
+
/freeflow settings personal overrides
|
|
98
|
+
/freeflow settings session temporary Freeflow and Cognitive Routing session controls
|
|
99
|
+
/freeflow settings repo shared repository settings
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Session settings can temporarily inherit, enable, or disable Freeflow and override Cognitive Routing profiles and delegation; one reset action clears them. They persist in the active Pi session branch, never write either config file, and cannot bypass missing or invalid repository activation. The personal settings path uses omission to inherit, refuses to overwrite invalid or tracked local config, and establishes local Git exclusion when needed. These user-operated controls update state before the next model turn and reload Pi resources when supported.
|
|
103
|
+
|
|
104
|
+
A config written during setup is visible to the adapter on the next agent turn. After first activation, tell the user to run `/reload` so Pi refreshes skills and resources fully; without it, core runtime context loads on the next turn but resource discovery waits. Confirm automatic delivery through current extension status or runtime evidence.
|
|
105
|
+
|
|
106
|
+
### Codex And Claude Code
|
|
107
|
+
|
|
108
|
+
The packaged runtime hook reads the same two layers. At supported `SessionStart` boundaries (startup, resume, clear, and compact) it loads `core.md`, `interaction-contract.md` and `working-method.md`, each unless `prompts` (`core`, `interactionContract`, `workingMethod`; each a boolean, on by default, personal overriding shared per prompt) turns it off, and emits a compact active Runtime State. It does not process submitted prompts, persist session controls, inject skill bodies, or inspect Pi-only capabilities.
|
|
109
|
+
|
|
110
|
+
After first-time setup, tell the user to trigger the least disruptive supported host-native lifecycle boundary: resume, clear, compact, or a new session or startup, as available. Name the exact control the current host supports; do not prescribe Pi's `/reload`.
|
|
111
|
+
|
|
67
112
|
## Establish Same-Turn Context
|
|
68
113
|
|
|
69
114
|
After successful verification, apply newly effective context directly for the remainder of the setup turn:
|
|
70
115
|
|
|
71
116
|
- read the [Interaction Contract](../../runtime/prompts/interaction-contract.md);
|
|
72
|
-
- read [
|
|
117
|
+
- read the [core guidance](../../runtime/prompts/core.md) and the [Working Method](../../runtime/prompts/working-method.md) when Freeflow is effective.
|
|
73
118
|
|
|
74
|
-
These direct reads establish same-turn guidance; they do not prove that a lifecycle adapter ran. After first activation,
|
|
119
|
+
These direct reads establish same-turn guidance; they do not prove that a lifecycle adapter ran, and no further adapter invocation has occurred yet. After first activation, name the exact host-native lifecycle action for automatic delivery and resource refresh (Hosts, above), and state what applies before that boundary.
|
|
75
120
|
|
|
76
121
|
## Verify And Report
|
|
77
122
|
|
|
@@ -80,10 +125,16 @@ Verify:
|
|
|
80
125
|
- repository config parses and is the required activation boundary;
|
|
81
126
|
- local config is missing or valid, personal, untracked, and ignored when applicable;
|
|
82
127
|
- effective `enabled`, core guidance, and optional capability values have the expected sources;
|
|
83
|
-
- no repo-owned host instructions or unrelated files changed.
|
|
128
|
+
- no repo-owned host instructions or unrelated files changed, and running setup again would change nothing.
|
|
84
129
|
|
|
85
130
|
After verification supports a setup result, silently self-review the final observed or changed state before accepting, reusing, or reporting it. Correct clear local issues within the existing setup authority and re-verify the affected boundary; stop on ambiguity, route change, or an out-of-envelope correction.
|
|
86
131
|
|
|
132
|
+
Classify automatic runtime delivery from evidence:
|
|
133
|
+
|
|
134
|
+
- **confirmed:** trustworthy evidence shows the current host adapter ran for the current lifecycle;
|
|
135
|
+
- **unavailable:** the adapter, plugin or hook is absent, disabled, denied, untrusted, or unsupported;
|
|
136
|
+
- **unconfirmed:** the adapter may be installed and trusted, but the host exposes no trustworthy evidence that it ran. Installed and trusted registration establishes availability for the next lifecycle action, not delivery.
|
|
137
|
+
|
|
87
138
|
Report separately:
|
|
88
139
|
|
|
89
140
|
1. shared repository activation;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: track-work
|
|
3
|
-
description: "Use when
|
|
3
|
+
description: "Use when a task needs memory beyond the conversation: starting, updating or recovering its Working Record; after a compaction, a summary, a clear or a move into a new session; when the context limit is near; before pausing, handing off or transferring work to a later session or another person; when a task ID, a project of tasks, child records or parallel sessions are involved; and when editing a record or running its working-record script. It decides what the record says, and every lifecycle change goes through its script."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Track Work
|
|
@@ -11,7 +11,7 @@ The record is not authority, a Spec, a Plan, or a transcript. It works for any k
|
|
|
11
11
|
|
|
12
12
|
The record has five sections:
|
|
13
13
|
|
|
14
|
-
- **Current Context:** present understanding, including `What defines this task`, which points to the task's defining artifacts such as its Spec and Plan.
|
|
14
|
+
- **Current Context:** present understanding, including the optional `Work agreement` (what the user agreed you may do, and until when) and `What defines this task`, which points to the task's defining artifacts such as its Spec and Plan.
|
|
15
15
|
- **Current Work:** the Current Slice (the unit of work in progress, with its `Material updates` log), `Recovery sources` to read when resuming, and one Next useful action.
|
|
16
16
|
- **Future Work:** the rough route ahead, as proposed Slices and Checkpoints.
|
|
17
17
|
- **History:** accepted Decisions, closed Checkpoints, and closed Slices.
|
|
@@ -19,13 +19,24 @@ The record has five sections:
|
|
|
19
19
|
|
|
20
20
|
The **Rules** below are binding; if one cannot be met, stop and say why. Everything else is **judgment**: follow its stated goal, and adapt when a different choice serves that goal better.
|
|
21
21
|
|
|
22
|
+
## Routes
|
|
23
|
+
|
|
24
|
+
| Situation | Go to |
|
|
25
|
+
| --- | --- |
|
|
26
|
+
| Context loss: compaction, a summary that replaces the conversation, clear, a transfer into another context | Recover After Context Loss, below |
|
|
27
|
+
| A context limit is near | Prepare For A Context Boundary, below |
|
|
28
|
+
| Handing work to a later session or someone else, or a pause | Prepare For A Context Boundary, then [handoff](references/handoff.md) |
|
|
29
|
+
| A registered task (a task ID such as `my-project/task-003`), a child record, a project, or the user asking to group tasks, split a task across parallel sessions, or move a record out of a repository | [projects](references/projects.md) |
|
|
30
|
+
| Editing record structure or preparing input for a command | [working record format](references/working-record-format.md) |
|
|
31
|
+
| On Pi with Task Memory on: attaching, creating, focusing or switching records, or a refused record write | The `task_memory` tool; the task-memory skill says how |
|
|
32
|
+
|
|
22
33
|
## Rules
|
|
23
34
|
|
|
24
35
|
- The record is memory, not authority. It never authorizes work, and current user direction, live state, and accepted artifacts override it.
|
|
25
36
|
- Record a Slice before causing effects outside the record: edits, commands, generated files, sent messages, or changes to external systems.
|
|
26
37
|
- Use [working-record.mjs](scripts/working-record.mjs) for every lifecycle change: IDs, states, and moves between sections. Edit only meaning directly.
|
|
27
38
|
- Only the user changes task state.
|
|
28
|
-
- After context loss, recover in this order before any task action: the
|
|
39
|
+
- After context loss, recover in this order before any task action: the record through `view recover` (not by opening `record.md`, which loads all of History), then every artifact listed under `What defines this task`, then `Recovery sources`, then the History entries the next action depends on through `view entry`. If any of them cannot be read completely, report that and stop affected work.
|
|
29
40
|
- Recover only a record that the context you still have ties to the current work, such as the user's direction, or a summary or handoff that names it. A recent change does not show that a record belongs to the current work. When a record's task and the current work disagree, report it instead of recovering the record.
|
|
30
41
|
- Never record a requested, reported, or expected result as observed. Keep unverified work, failures, and contradictions visible.
|
|
31
42
|
- Never claim that state will survive context loss unless it is written in the record or in a source the record points to.
|
|
@@ -40,6 +51,7 @@ Ask: **if context were lost now, what would the next context need that it could
|
|
|
40
51
|
| --- | --- |
|
|
41
52
|
| Understanding changes: a fact is settled, a hypothesis forms, a question opens | Current Context |
|
|
42
53
|
| The user accepts a choice | a Decision |
|
|
54
|
+
| The user agrees to a route or part of one, or changes it | the Work agreement |
|
|
43
55
|
| Work with partial state is about to begin | a Slice |
|
|
44
56
|
| You learn something needed to resume: a file, attachment, message, or section | Recovery sources |
|
|
45
57
|
| A Spec, Plan, or other defining artifact is created or accepted for the task | What defines this task |
|
|
@@ -63,17 +75,30 @@ The record serves both halves of the work; update it at meaningful boundaries, n
|
|
|
63
75
|
- Start a record, with the understanding gathered so far, once the task is likely to outlast the current context or span sessions.
|
|
64
76
|
- When the user makes a choice, record a Decision. Put options under consideration in Tentative and unanswered questions in Open.
|
|
65
77
|
- Use Open to choose what to ask next, and check Settled and Decisions before asking the user something again.
|
|
78
|
+
- When you propose a route and the user has not answered, put it under Open as a bullet starting `Proposed:` with its date. An unanswered proposal is not agreed.
|
|
66
79
|
- When the user supplies material that governs the work, point to it from Recovery sources, or from `What defines this task` if it defines the task.
|
|
67
80
|
- When what and how are settled, propose the route in Future Work.
|
|
68
81
|
|
|
69
82
|
**Executing:** the record is bookkeeping.
|
|
70
83
|
|
|
71
|
-
- Record the Slice before its first effect.
|
|
84
|
+
- Record the Slice before its first effect. Its Authority source names the Work agreement line, or the user's reply, it rests on.
|
|
72
85
|
- Add Material updates at boundaries: evidence, identities such as commit SHAs or document versions, scope extensions, and contradictions.
|
|
73
86
|
- Add Recovery sources as the work reveals what a resume would need.
|
|
74
87
|
- Close Checkpoints as their boundaries happen, then close the Slice with a distilled result.
|
|
75
88
|
- Keep temporary files for the task, such as throwaway scripts, saved command output, and downloads, in the task directory's `scratch/`. They stay with the task and out of version control; nothing in them is memory unless the record points to it.
|
|
76
89
|
|
|
90
|
+
## Keep The Work Agreement
|
|
91
|
+
|
|
92
|
+
Goal: after context loss, the next context knows what the user agreed it may do, and until when, in the user's words.
|
|
93
|
+
|
|
94
|
+
Write the Work agreement section when something is agreed, at `init` if it is known then; never as a placeholder, and never ask the user for it just because a record is being created. Write only what is known: what done looks like, what you do without asking, what needs the user's yes first, where you come back, and how long it holds. Quote the user's reply beside what it answered. A one-line agreement is often enough.
|
|
95
|
+
|
|
96
|
+
When the agreement grows or changes, replace the lines it changes, as a direct edit: the user's message that changed it covers the edit, so do not ask first or wait for a command. When the user narrows it for now ("just diagnose first", "don't edit yet"), add that line at once, in their words: it governs over the rest of the section until the user lifts it, and a later context sees only what is written. When a `Proposed:` item is answered, move it into the Work agreement, record it as a Decision if it decided something about the work, or drop it. A change to the agreement is not a Decision; a choice about the work is.
|
|
97
|
+
|
|
98
|
+
For a long or unattended run, or once the agreement has changed several times, also keep `sources/work-agreement-log.md`: one dated, numbered entry per exchange that set or changed the agreement, the proposal in one line and the user's reply verbatim, append-only. It holds only those exchanges, not discussion. List it under Recovery sources with the trigger "read when changing the Work agreement or when its wording is in question".
|
|
99
|
+
|
|
100
|
+
[Discuss Work](../discuss-work/SKILL.md)'s decision list lives in `sources/decisions.md` in the task folder, listed under Recovery sources with the trigger "read when deciding, self-reviewing, or handing over"; update it directly as items change. Each item the user answered also becomes a Decision quoting their words; the rest are what you assumed, never what the user accepted.
|
|
101
|
+
|
|
77
102
|
## Use Slices For Work With Partial State
|
|
78
103
|
|
|
79
104
|
A Slice is a unit of work that would leave something to reconcile if interrupted: half-applied edits, a draft in progress, findings from 12 of 20 sources, a running process.
|
|
@@ -100,6 +125,8 @@ Future Work is your route at this moment, not a commitment. When you know roughl
|
|
|
100
125
|
|
|
101
126
|
Before starting a proposal, check its dependencies against what actually happened and against the current agreement. Being next in Future Work is not a reason to take on its obligations.
|
|
102
127
|
|
|
128
|
+
Before starting or reopening a Slice, check the History index for closed work on the same result and read it with `view entry`. A failed or abandoned approach lives there.
|
|
129
|
+
|
|
103
130
|
A **Checkpoint** is a boundary on the route that is not itself a unit of work: a commit, a publication, a review, a decision, a continuity point. It belongs to the Slice it follows. Do not make a Checkpoint into a Slice.
|
|
104
131
|
|
|
105
132
|
```text
|
|
@@ -111,34 +138,38 @@ Future Work:
|
|
|
111
138
|
Not: a separate "Commit the parser" Slice.
|
|
112
139
|
```
|
|
113
140
|
|
|
114
|
-
| Type | Code | Other work |
|
|
115
|
-
| --- | --- | --- |
|
|
116
|
-
| `preserve` | local commit | save a draft version or snapshot |
|
|
117
|
-
| `publish` | push, pull request | publish, send to a client |
|
|
118
|
-
| `review` | independent code review | editor or reviewer sign-off |
|
|
119
|
-
| `decision` | owner chooses a design | owner chooses between options |
|
|
120
|
-
| `continuity` | pause or handoff point | pause or handoff point |
|
|
141
|
+
| Type | Code | Other work | Owner when due |
|
|
142
|
+
| --- | --- | --- | --- |
|
|
143
|
+
| `preserve` | local commit | save a draft version or snapshot | Deliver Work (commit) |
|
|
144
|
+
| `publish` | push, pull request | publish, send to a client | Deliver Work (push, pull request or release) |
|
|
145
|
+
| `review` | independent code review | editor or reviewer sign-off | Review Work |
|
|
146
|
+
| `decision` | owner chooses a design | owner chooses between options | Discuss Work |
|
|
147
|
+
| `continuity` | pause or handoff point | pause or handoff point | Track Work ([handoff](references/handoff.md)) |
|
|
148
|
+
|
|
149
|
+
When a pending Checkpoint is due, stop dependent work, use its owner, and continue from the result. Do not force a Checkpoint whose condition, evidence or protected boundary no longer holds; return the discrepancy for cancellation, replacement, deferral or revision.
|
|
121
150
|
|
|
122
|
-
A Checkpoint is `proposed` while it is only anticipated and `pending` once the user authorizes or selects it. Activate it as soon as authority exists. A pending or deferred Checkpoint must be closed before its Slice closes; `completed` means the boundary happened, even when its judgment was adverse.
|
|
151
|
+
Propose a Checkpoint only where it protects a dependency, decision, rollback, transfer, integration, or delivery; self-review is not one. A Checkpoint is `proposed` while it is only anticipated and `pending` once the user authorizes or selects it. Activate it as soon as authority exists. A pending or deferred Checkpoint must be closed before its Slice closes; `completed` means the boundary happened, even when its judgment was adverse.
|
|
123
152
|
|
|
124
153
|
On long tasks, a `preserve` Checkpoint every few Slices keeps a recoverable point without a Slice of its own.
|
|
125
154
|
|
|
126
155
|
## Recover After Context Loss
|
|
127
156
|
|
|
128
|
-
Context loss
|
|
157
|
+
Context loss means the conversation about the current work is no longer in context: after compaction, a summary that replaces it, clear, a transfer to another context, or a session or branch that continues the work without it. Recover before task work (Rules), in order:
|
|
129
158
|
|
|
130
|
-
1. `view
|
|
159
|
+
1. `view recover`: the `resume` view (the record's present state and a one-line index of closed History), then each defining artifact and Recovery source with its trigger, whether it resolves and its size, then where live Git state disagrees with the record. If output is truncated, keep reading until complete. Do not open `record.md` itself for this: it loads the whole History, which the index lets you read only where needed. A summary is not recovery.
|
|
131
160
|
2. Every artifact listed under `What defines this task`, such as the task's Spec and Plan.
|
|
132
161
|
3. Every entry under `Recovery sources`, except one whose stated trigger ("read when …") does not apply yet; read that one when it does.
|
|
162
|
+
4. The History entries the next action depends on, through `view entry <ID>`: closed work on the same result or area, a blocked or abandoned attempt at what you are about to do, a superseded Decision behind a current one, and any entry the record or a source names by ID. Do not read entries just because they exist.
|
|
133
163
|
|
|
134
|
-
Then reconcile before acting. Establish the task and Slice state, the agreed outcome and return condition, active Decisions, pending Checkpoints, completed and partial effects, whether the next action's prerequisites hold, and what authorizes it.
|
|
164
|
+
Then reconcile before acting. Establish the task and Slice state, the Work agreement (or, without one, the agreed outcome and return condition) and whether the user's latest direction has changed it, active Decisions, pending Checkpoints, completed and partial effects, whether the next action's prerequisites hold, and what authorizes it.
|
|
135
165
|
|
|
136
166
|
- Current user direction supersedes older instructions in the record, including a record written on another conversation branch.
|
|
137
167
|
- Compare the record with the live state the next action depends on. If they disagree, resolve it from sources; do not follow whichever version lets work continue.
|
|
138
168
|
- If the record conflicts with a defining Spec or Plan, the record does not win. Return the conflict to that artifact's owner before dependent work.
|
|
139
|
-
- Reuse evidence that still applies instead of repeating the investigation. Reopen further sources only when their exact content or freshness changes the next action.
|
|
169
|
+
- Check an important completion, verification, review, or commit claim, and the identity of what it examined, before repeating it; a run that happened may not apply to the current state. Reuse evidence that still applies instead of repeating the investigation. Reopen further sources only when their exact content or freshness changes the next action.
|
|
170
|
+
- A next action a handoff names authorizes nothing by itself. Without a record, as when resuming from a handoff alone, reconstruct from it and the exact sources it names, and report a missing boundary instead of inventing it.
|
|
140
171
|
|
|
141
|
-
With context
|
|
172
|
+
With that conversation still in context, use `view resume` or read the relevant section; a new message, a pause or a resumed session is not context loss.
|
|
142
173
|
|
|
143
174
|
## Prepare For A Context Boundary
|
|
144
175
|
|
|
@@ -148,6 +179,7 @@ When a context limit is near or a pause or transfer is coming, make the record s
|
|
|
148
179
|
- Update `Recovery sources` with what the next context must read, and why each matters. Drop entries the current work no longer needs; give a source needed only in some situation a trigger ("read when …").
|
|
149
180
|
- Material that exists only in the conversation, such as a pasted image, file, or long message, will not survive. Save a copy under the task's `sources/` directory and point to it, or point to host-retrievable history when the host provides it.
|
|
150
181
|
- Leave one Next useful action that a fresh context can act on.
|
|
182
|
+
- For a pause or a transfer to another session or person, write the handoff with [handoff](references/handoff.md) once the record is sufficient.
|
|
151
183
|
|
|
152
184
|
Do not rush a Slice to completion, claim an unfinished check passed, or guess the outcome of a running operation.
|
|
153
185
|
|
|
@@ -155,9 +187,9 @@ A context boundary is not a Slice transition or a Checkpoint. Pause the Slice on
|
|
|
155
187
|
|
|
156
188
|
## Maintain The Record
|
|
157
189
|
|
|
158
|
-
|
|
190
|
+
[Working Record Format](references/working-record-format.md) owns the exact shape, fields, states, and command contract; read it before editing structure or preparing input for a command.
|
|
159
191
|
|
|
160
|
-
Edit meaning directly: Current Context bullets, optional fields, Material updates, Recovery sources, proposal order or removal, the Next useful action, and Notes. After a structural edit, run `validate`. It checks structure
|
|
192
|
+
Edit meaning directly: Current Context bullets, optional fields, Material updates, Recovery sources, proposal order or removal, the Next useful action, and Notes. After a structural edit, run `validate`. It checks structure, and warns about Material updates pointers (files, commits) that do not resolve (`--strict` fails on those an Evidence or Result line names); it cannot tell whether an edit changed history or skipped a lifecycle step, so never make those edits by hand.
|
|
161
193
|
|
|
162
194
|
Run `working-record.mjs <group> <operation> --help` before preparing a command's input; the help and the format reference are the contract, so read `scripts/lib/` only when diagnosing a defect. If a command exits with code 2, the write may have happened: read `view full` before retrying or editing. Never duplicate an entity to recover from an uncertain result.
|
|
163
195
|
|
|
@@ -177,6 +209,6 @@ Closing selects nothing. Set the Next useful action from the actual result.
|
|
|
177
209
|
|
|
178
210
|
## Return
|
|
179
211
|
|
|
180
|
-
Return to the activity that asked for the update: [Discuss](../discuss/SKILL.md) for discussion, [Execute Work](../execute-work/SKILL.md) for Slice work
|
|
212
|
+
Return to the activity that asked for the update: [Discuss Work](../discuss-work/SKILL.md) for discussion, [Execute Work](../execute-work/SKILL.md) for Slice work. [Write Docs](../write-docs/SKILL.md) owns the task's Specs and Plans.
|
|
181
213
|
|
|
182
214
|
Stop when the record lets a fresh context continue correctly. Stop and report, rather than invent, when authority, structure, or the meaning of a transition is missing. A record update never completes the work it describes.
|