prizmkit 1.1.154 → 1.1.156
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/bundled/VERSION.json +3 -3
- package/bundled/adapters/codex/skill-adapter.js +1 -1
- package/bundled/adapters/pi/skill-adapter.js +2 -1
- package/bundled/dev-pipeline/.env.example +2 -6
- package/bundled/dev-pipeline/README.md +21 -27
- package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +341 -15
- package/bundled/dev-pipeline/prizmkit_runtime/cli.py +0 -3
- package/bundled/dev-pipeline/prizmkit_runtime/daemon.py +1 -15
- package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +48 -14
- package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +50 -2
- package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +0 -9
- package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +3 -3
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +120 -22
- package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +482 -0
- package/bundled/dev-pipeline/prizmkit_runtime/test_result.py +64 -11
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +145 -367
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +91 -62
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +105 -69
- package/bundled/dev-pipeline/scripts/prompt_framework.py +36 -41
- package/bundled/dev-pipeline/scripts/update-bug-status.py +1 -4
- package/bundled/dev-pipeline/scripts/update-checkpoint.py +61 -13
- package/bundled/dev-pipeline/scripts/update-feature-status.py +1 -4
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +1 -4
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +22 -27
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +71 -104
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +59 -111
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +37 -72
- package/bundled/dev-pipeline/templates/sections/artifact-manifest.md +39 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-critical-paths.md +3 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +8 -25
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +3 -3
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-implement.md +2 -2
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +3 -3
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +2 -2
- package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +4 -4
- package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +0 -1
- package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +7 -4
- package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +14 -27
- package/bundled/dev-pipeline/templates/sections/feature-completion-summary.md +20 -0
- package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +8 -71
- package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +7 -7
- package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +3 -3
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +4 -4
- package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +5 -17
- package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +3 -1
- package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +10 -23
- package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +2 -2
- package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +2 -2
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +3 -3
- package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +2 -2
- package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +7 -7
- package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +0 -1
- package/bundled/dev-pipeline/templates/sections/retrospective.md +12 -0
- package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +35 -0
- package/bundled/dev-pipeline/templates/session-status-schema.json +45 -62
- package/bundled/dev-pipeline/tests/test_checkpoint_state.py +469 -18
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +262 -175
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +62 -23
- package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +76 -28
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +168 -18
- package/bundled/dev-pipeline/tests/test_recovery_workflow.py +111 -0
- package/bundled/dev-pipeline/tests/test_reset_preserve.py +0 -2
- package/bundled/dev-pipeline/tests/test_runtime_commit.py +608 -0
- package/bundled/dev-pipeline/tests/test_unified_cli.py +167 -25
- package/bundled/skills/_metadata.json +9 -9
- package/bundled/skills/app-planner/SKILL.md +3 -3
- package/bundled/skills/app-planner/references/generated-plan-review.md +2 -1
- package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +56 -64
- package/bundled/skills/app-planner/references/rules/backend/fixed-rules.md +85 -240
- package/bundled/skills/app-planner/references/rules/backend/question-bank.md +25 -25
- package/bundled/skills/app-planner/references/rules/backend/question-manifest.json +16 -7
- package/bundled/skills/app-planner/references/rules/backend/template.md +74 -92
- package/bundled/skills/app-planner/references/rules/database/derivation-rules.md +93 -93
- package/bundled/skills/app-planner/references/rules/database/fixed-rules.md +66 -173
- package/bundled/skills/app-planner/references/rules/database/question-bank.md +31 -26
- package/bundled/skills/app-planner/references/rules/database/question-manifest.json +13 -4
- package/bundled/skills/app-planner/references/rules/database/template.md +76 -98
- package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +68 -95
- package/bundled/skills/app-planner/references/rules/frontend/fixed-rules.md +93 -166
- package/bundled/skills/app-planner/references/rules/frontend/question-bank.md +46 -36
- package/bundled/skills/app-planner/references/rules/frontend/question-manifest.json +11 -2
- package/bundled/skills/app-planner/references/rules/frontend/template.md +79 -257
- package/bundled/skills/app-planner/references/rules/mobile/derivation-rules.md +91 -99
- package/bundled/skills/app-planner/references/rules/mobile/fixed-rules.md +73 -246
- package/bundled/skills/app-planner/references/rules/mobile/question-bank.md +17 -17
- package/bundled/skills/app-planner/references/rules/mobile/question-manifest.json +17 -2
- package/bundled/skills/app-planner/references/rules/mobile/template.md +73 -85
- package/bundled/skills/app-planner/references/rules-configuration.md +133 -65
- package/bundled/skills/app-planner/scripts/validate-rules-configuration.py +291 -0
- package/bundled/skills/prizmkit/SKILL.md +17 -18
- package/bundled/skills/prizmkit/references/workflow-state-protocol.md +22 -18
- package/bundled/skills/prizmkit-code-review/SKILL.md +22 -58
- package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +6 -6
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +2 -2
- package/bundled/skills/prizmkit-committer/SKILL.md +82 -132
- package/bundled/skills/prizmkit-deploy/SKILL.md +27 -11
- package/bundled/skills/prizmkit-deploy/assets/deploy-document-template.md +89 -0
- package/bundled/skills/prizmkit-deploy/references/ci-cd-workflows.md +44 -14
- package/bundled/skills/prizmkit-deploy/references/cloud-platform-deploy.md +19 -3
- package/bundled/skills/prizmkit-deploy/references/database-setup.md +22 -12
- package/bundled/skills/prizmkit-deploy/references/deploy-config-schema.md +3 -1
- package/bundled/skills/prizmkit-deploy/references/deploy-history-schema.md +22 -6
- package/bundled/skills/prizmkit-deploy/references/deploy-metadata-schema.json +49 -0
- package/bundled/skills/prizmkit-deploy/references/live-validation-notes.md +1 -1
- package/bundled/skills/prizmkit-deploy/references/pending-input-schema.json +164 -0
- package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +9 -8
- package/bundled/skills/prizmkit-deploy/references/ssh-execution-flow.md +6 -6
- package/bundled/skills/prizmkit-implement/SKILL.md +30 -66
- package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +4 -4
- package/bundled/skills/prizmkit-init/SKILL.md +4 -0
- package/bundled/skills/prizmkit-plan/SKILL.md +21 -64
- package/bundled/skills/prizmkit-plan/references/artifact-identity.md +38 -0
- package/bundled/skills/prizmkit-plan/references/independent-plan-review.md +4 -4
- package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +5 -5
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +75 -11
- package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +191 -56
- package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +18 -18
- package/bundled/skills/prizmkit-prizm-docs/references/op-rebuild.md +14 -8
- package/bundled/skills/prizmkit-prizm-docs/references/op-status.md +12 -5
- package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +23 -12
- package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +13 -9
- package/bundled/skills/prizmkit-retrospective/SKILL.md +94 -97
- package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +79 -37
- package/bundled/skills/prizmkit-retrospective/references/retrospective-result-schema.json +138 -0
- package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +111 -54
- package/bundled/skills/prizmkit-test/SKILL.md +64 -51
- package/bundled/skills/prizmkit-test/references/boundary-contract-and-test-double-guidance.md +206 -0
- package/bundled/skills/prizmkit-test/references/independent-test-review.md +17 -9
- package/bundled/skills/prizmkit-test/references/test-coverage-model.md +45 -21
- package/bundled/skills/prizmkit-test/references/test-report-template.md +20 -13
- package/bundled/skills/prizmkit-workflow/SKILL.md +35 -37
- package/bundled/skills/prizmkit-workflow/references/artifact-identity.md +34 -0
- package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +22 -18
- package/bundled/skills/recovery-workflow/SKILL.md +2 -1
- package/bundled/skills/recovery-workflow/references/detection.md +4 -3
- package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +15 -5
- package/bundled/templates/hooks/validate-prizm-docs.py +124 -12
- package/package.json +1 -1
- package/src/scaffold.js +33 -22
- package/bundled/dev-pipeline/templates/sections/bugfix-artifacts.md +0 -16
- package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +0 -31
- package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +0 -7
- package/bundled/dev-pipeline/templates/sections/critical-paths-lite.md +0 -7
- package/bundled/dev-pipeline/templates/sections/directory-convention-agent.md +0 -9
- package/bundled/dev-pipeline/templates/sections/directory-convention-lite.md +0 -6
- package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +0 -15
- package/bundled/dev-pipeline/templates/sections/phase-commit.md +0 -61
- package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +0 -24
- package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-lite-suffix.md +0 -12
- package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +0 -44
- package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +0 -25
- package/bundled/dev-pipeline/templates/sections/phase-plan-agent.md +0 -20
- package/bundled/dev-pipeline/templates/sections/phase-plan-lite.md +0 -20
- package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +0 -20
- package/bundled/dev-pipeline/templates/sections/refactor-artifacts.md +0 -17
- package/bundled/dev-pipeline/templates/sections/refactor-session-status.md +0 -28
- package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +0 -52
- package/bundled/dev-pipeline/templates/sections/test-failure-recovery-lite.md +0 -52
- package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +0 -174
- package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +0 -174
- package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +0 -174
- package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +0 -174
- package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +0 -174
- package/bundled/skills/prizmkit-test/references/external-contract-mock-guidance.md +0 -119
|
@@ -8,16 +8,27 @@ Use this operation for manual edits, merges, rebases, branch switches, generated
|
|
|
8
8
|
|
|
9
9
|
STEPS:
|
|
10
10
|
1. Identify drift source. Prefer explicit user context; otherwise inspect git changes with `git diff --cached --name-status`, then `git diff --name-status`. If no git changes exist, run a bounded rescan comparing code structure against existing docs.
|
|
11
|
-
2. Map changed files to modules
|
|
12
|
-
3. Classify each change
|
|
13
|
-
4.
|
|
14
|
-
5.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
2. Map changed files to modules through MODULE_INDEX or MODULE_GROUPS in `root.prizm`, then resolve mirrored SUBDIRS or flat-module DETAILS ownership from the relevant L1.
|
|
12
|
+
3. Classify each source change as A, D, M, or R, but do not mechanically turn changes into documentation. Treat every possible file, interface, dependency, flow, trap, decision, rule, and summary as a candidate and apply the future-incorrect-modification Value Gate.
|
|
13
|
+
4. Before writing any existing L2, L1, or L0 target, read that target and its resolving parent/child pointers. Build a protected set of still-valid public/wire contracts, cross-module constraints, non-obvious dependencies, traps, decisions with necessary rationale, likely-to-recur rejected alternatives, side effects, and security/data-integrity/concurrency/transaction/compatibility rules.
|
|
14
|
+
5. Apply the Cleanup Gate by semantic meaning:
|
|
15
|
+
- update an equivalent entry in place rather than appending alternate wording
|
|
16
|
+
- merge synonymous entries into one shortest complete meaning
|
|
17
|
+
- remove stale, duplicate, source-derivable, low-value, and parent-copied material
|
|
18
|
+
- add only a genuinely new durable fact with no semantic equivalent
|
|
19
|
+
Append-only repair is prohibited.
|
|
20
|
+
6. Reconcile bottom-up. L2 owns Value-Gate-qualified INTERFACES/DATA_FLOW/DEPENDENCIES/RULES/TRAPS/DECISIONS. L1 owns concise FILES/KEY_FILES/SUBDIRS/DETAILS/DEPENDENCIES summaries. L0 changes only for project-map structure. When L2 has complete behavior, L0/L1 retain only a concise summary and resolving pointer, never copied interfaces, data flow, traps, decisions, or full RULES.
|
|
21
|
+
7. Preserve `PROJECT_BRIEF:` in `root.prizm`; it is managed by `/prizmkit-init`. Do not write prohibited history, date, workflow, branch, absolute-path, or runtime-artifact metadata.
|
|
22
|
+
8. Skip comments/whitespace/formatting-only changes, `.prizm`-only changes, and test-only changes that reveal no durable behavior boundary or fact passing the Value Gate.
|
|
23
|
+
9. If a new top-level directory qualifies as a module, create its direct-child L1 and add a concise pointer to MODULE_INDEX or MODULE_GROUPS. Use MODULE_GROUPS whenever MODULE_INDEX cannot fit within 4096B; never raise the limit for project size.
|
|
24
|
+
10. Create L2 only for durable behavioral knowledge:
|
|
25
|
+
- a real source submodule always uses its mirrored `.prizmkit/prizm-docs/<module>/<submodule>.prizm` path
|
|
26
|
+
- a flat module may use `.prizmkit/prizm-docs/<module>/<concern-slug>.prizm` only when multiple stable concerns cannot safely fit one 5120B L2 after cleanup
|
|
27
|
+
- semantic details require the complete CONCERN terminal shape, explicit non-empty/non-overlapping FILES ownership, and one resolving L1 DETAILS entry
|
|
28
|
+
- ambiguous concern identity, empty normalization, mirrored-path/slug collision, or overlapping ownership blocks creation and reports the manual decision; never use task IDs or numeric suffixes
|
|
29
|
+
11. Measure all affected targets by exact raw UTF-8 bytes with L0/L1 4096B and L2 5120B limits. Natural content below 80% remains unchanged; warning-range content is valid and reported. Clean, move, or safely split rewritten targets at 90% or above toward 3277-3686B for L0/L1 or 4096-4607B for L2. If a hard-limit error or repeated pressure cannot be resolved without deleting protected knowledge, block the write.
|
|
30
|
+
12. Validate Value/Cleanup compliance, parent-summary boundaries, semantic ownership/identity, pointers, hierarchy, capacity, memory hygiene, and format. Warning-only capacity results pass; hard-limit or format errors fail.
|
|
31
|
+
13. Report updated, created, removed, merged, protected, and skipped facts/docs with reasons plus capacity diagnostics ordered by descending utilization.
|
|
32
|
+
14. Stage updated `.prizm` files with `git add .prizmkit/prizm-docs/` only after reviewing the repair summary.
|
|
22
33
|
|
|
23
|
-
OUTPUT: List updated, created, removed, and skipped docs with reasons
|
|
34
|
+
OUTPUT: List updated, created, removed, merged, protected, and skipped docs/facts with reasons; sorted capacity diagnostics; ambiguity blockers; and an explicit statement that this was out-of-band repair/resync, not a normal development retrospective.
|
|
@@ -5,13 +5,17 @@ Check format compliance and consistency of all .prizm docs.
|
|
|
5
5
|
PRECONDITION: .prizmkit/prizm-docs/ exists.
|
|
6
6
|
|
|
7
7
|
STEPS:
|
|
8
|
-
1. FORMAT CHECK: Verify all
|
|
9
|
-
2.
|
|
10
|
-
3.
|
|
11
|
-
4.
|
|
12
|
-
5.
|
|
13
|
-
6.
|
|
14
|
-
7.
|
|
15
|
-
8.
|
|
8
|
+
1. FORMAT CHECK: Verify all `.prizm` files use KEY: value format. Flag prose paragraphs, code blocks, markdown headers, emoji, ASCII art, horizontal rules, invalid TRAPS severity, and prohibited history/date/workflow/branch/absolute/artifact metadata. `[REVIEW]` before severity remains a valid temporary staleness marker.
|
|
9
|
+
2. VALUE CHECK: Flag source-derivable signatures/structure, task or change history, test inventories, temporary conclusions, stale statements, duplicate meanings, long procedures, low-value file lists, line-count/complexity inventories, and parent copies of complete child behavior. Do not flag a still-valid public/wire contract, cross-module constraint, non-obvious dependency, trap, durable decision/rejected rationale, side effect, or security/data-integrity/concurrency/transaction/compatibility rule merely because it consumes capacity.
|
|
10
|
+
3. CAPACITY CHECK: Measure exact raw UTF-8 bytes. Classify only the exact root as L0/4096B, direct children as L1/4096B, and nested mirrored or semantic documents as L2/5120B. Bands are normal below 80%, warning from 80% to below 90%, strong-warning from 90% through 100%, and error above 100%.
|
|
11
|
+
4. CAPACITY REPORT: Sort all non-normal entries by exact descending utilization using integer ratio comparison, then repository-relative path for ties. Every entry includes path, level, current bytes, hard limit, band, target range (3277-3686B for L0/L1; 4096-4607B for L2), and level-appropriate trim, deduplicate, move-to-child, or semantic-split actions consistent with the canonical F-063 classifier.
|
|
12
|
+
5. CAPACITY RESULT: Warning and strong-warning entries are advisory and do not fail Validate when no other violation exists. Any byte above a hard limit is an error and fails; format, pointer, hierarchy, ownership, or completeness errors also fail and are never downgraded because capacity is only a warning.
|
|
13
|
+
6. POINTER/PARENT CHECK: Verify every arrow resolves. L0/L1 contain concise summaries and pointers rather than copied L2 INTERFACES/DATA_FLOW/TRAPS/DECISIONS/full RULES. SUBDIRS targets mirrored source-submodule L2. DETAILS uses exactly `- <concern-slug>: <one-line stable behavior summary> -> .prizmkit/prizm-docs/<module>/<concern-slug>.prizm` and targets one matching semantic L2.
|
|
14
|
+
7. SEMANTIC IDENTITY/OWNERSHIP CHECK: For each semantic L2, verify required fields MODULE, CONCERN, FILES, RESPONSIBILITY, INTERFACES, DATA_FLOW, KEY_FILES, DEPENDENCIES, RULES, TRAPS, and DECISIONS; verify `CONCERN: <stable concern identity> | SLUG: <concern-slug>`; rerun Unicode NFKC/lowercase/kebab normalization; require non-empty explicit repository-relative FILES ownership with no sibling overlap; and require exact parent/path/slug agreement. A mirrored source-submodule path has precedence. Ambiguous identity, collision, or overlap is a validation error requiring a manual decision, not a numbered or task-named repair.
|
|
15
|
+
8. COMPLETENESS CHECK: Verify root has PRIZM_VERSION, PROJECT, LANG, and exactly one of MODULE_INDEX/MODULE_GROUPS. Verify L1 has MODULE, FILES, RESPONSIBILITY, DEPENDENCIES and no behavioral sections. Verify mirrored L2 has MODULE, FILES, RESPONSIBILITY, INTERFACES, KEY_FILES, DEPENDENCIES, and TRAPS with no CONCERN field; DATA_FLOW, RULES, DECISIONS, and domain sections remain optional when no fact passes the Value Gate. In semantic L2 only, explicit `<SECTION>: none` satisfies a required behavioral section when no fact passes the Value Gate.
|
|
16
|
+
9. STALENESS CHECK: Compare each document's git modification time with its mapped source directory or semantic FILES ownership. Flag source-newer documents. Without git history, use filesystem timestamps and report reduced accuracy.
|
|
17
|
+
10. RULES HIERARCHY CHECK: Verify L1/L2 RULES do not contradict authoritative root RULES.
|
|
18
|
+
11. TRAPS STALENESS CHECK: When an L2 TRAPS section has more than 8 entries, flag entries lacking `STALE_IF:` or `REF:` as `NEEDS_METADATA`; do not auto-remove them.
|
|
19
|
+
12. SCALE CHECK: If MODULE_INDEX cannot fit within L0, require MODULE_GROUPS. Never allow a project-size override, limits above 4096B/4096B/5120B, L3/fourth-level documents, a memory state machine, or a fact scoring system.
|
|
16
20
|
|
|
17
|
-
OUTPUT: Validation report with PASS/FAIL per check,
|
|
21
|
+
OUTPUT: Validation report with PASS/FAIL per check, sorted non-normal capacity entries, issue paths with actionable fixes, and an exit result. Warning-only capacity diagnostics exit successfully; any hard-limit or other validation error exits nonzero.
|
|
@@ -1,155 +1,152 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "prizmkit-retrospective"
|
|
3
|
-
description: "
|
|
3
|
+
description: "Synchronize durable Prizm documentation for one caller-supplied project change, or record that no documentation update is warranted. Writes retrospective-result.json and returns RETRO_COMPLETE or RETRO_BLOCKED. (project)"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# PrizmKit Retrospective
|
|
7
7
|
|
|
8
|
-
`/prizmkit-retrospective`
|
|
8
|
+
`/prizmkit-retrospective` synchronizes durable project documentation for one explicitly supplied project change. It performs targeted structural synchronization and durable knowledge injection, or records `NO_DOC_CHANGE` when no update passes the Value Gate.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
For first-time documentation setup, validation, rebuild, migration, or out-of-band repair after docs drift, use `/prizmkit-prizm-docs` independently. Retrospective consumes the established Prizm documentation policy but never invokes that Skill.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
2. **Knowledge Injection** — add durable TRAPS, RULES, and DECISIONS discovered during the task when such knowledge exists.
|
|
12
|
+
## Input
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
| Parameter | Required | Description |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| `artifact_dir` | Yes | Exact caller-supplied directory in which to write `retrospective-result.json`. |
|
|
17
|
+
| `change_paths` | Yes | Exact caller-supplied non-`.prizmkit/` `change_paths` whose current project changes are the only authoritative documentation input. An explicit empty list is allowed only for a caller-requested no-change determination. |
|
|
18
|
+
| `change_summary` | No | Supporting context only; it cannot establish a fact that the supplied project paths do not establish. |
|
|
16
19
|
|
|
17
|
-
|
|
20
|
+
Do not discover a different artifact directory, expand the path set, or infer prerequisite work.
|
|
18
21
|
|
|
19
|
-
##
|
|
22
|
+
## Atomic Boundary
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
prizmkit-plan
|
|
23
|
-
→ prizmkit-implement
|
|
24
|
-
→ prizmkit-code-review
|
|
25
|
-
→ prizmkit-test
|
|
26
|
-
→ prizmkit-retrospective
|
|
27
|
-
→ prizmkit-committer
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Atomic Stage Boundary
|
|
24
|
+
`prizmkit-retrospective` owns only targeted structural documentation synchronization, durable knowledge injection, and `{artifact_dir}/retrospective-result.json` for the supplied paths. It does not invoke another Skill, does not read or mutate caller or checkpoint state, and does not choose stage order or routing.
|
|
31
25
|
|
|
32
|
-
|
|
26
|
+
It does not stage, commit, reset, checkout, or stash; it does not change Git/ignore policy; and it does not directly edit generated platform outputs. All paths under `.prizmkit/` are framework-internal and remain outside automated task commits. Capacity maintenance does not add a capacity state machine, fact scoring system, routing field, caller-state field, or fourth documentation level. The stage returns `RETRO_COMPLETE` or `RETRO_BLOCKED` and stops.
|
|
33
27
|
|
|
34
28
|
## When to Use
|
|
35
29
|
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
30
|
+
- A caller supplies exact project change paths that may affect durable documentation.
|
|
31
|
+
- A previously interrupted synchronization is resumed with the same exact inputs.
|
|
32
|
+
- The user explicitly requests a retrospective for one named project change.
|
|
39
33
|
|
|
40
34
|
## When NOT to Use
|
|
41
35
|
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
|
|
36
|
+
- Required paths are missing, unsafe, contradictory, outside the checkout, under `.prizmkit/`, or cannot be inspected.
|
|
37
|
+
- The caller asks this Skill to discover what work should be documented.
|
|
38
|
+
- First-time initialization or repository-wide out-of-band drift repair is needed.
|
|
39
|
+
|
|
40
|
+
## Exact Input Scope and Candidate Authority
|
|
41
|
+
|
|
42
|
+
Treat only the exact caller-supplied non-`.prizmkit/` `change_paths` as authoritative project-change input.
|
|
43
|
+
|
|
44
|
+
1. Normalize `artifact_dir` and every path exactly as supplied without broadening the set.
|
|
45
|
+
2. Reject paths outside the checkout, paths under `.prizmkit/`, and paths that do not belong to the supplied project change.
|
|
46
|
+
3. Inspect the current change only through exact pathspecs for the validated paths. Use narrowly required source context only when one eligible change raises a concrete ambiguity about its interface, caller, dependent, data flow, or behavior.
|
|
47
|
+
4. Generated artifacts, lifecycle records, caller metadata, `change_summary`, repository-wide discovery, and existing Prizm text must not independently establish a candidate fact or expand the input scope. Existing Prizm documents are target/current-state evidence only.
|
|
48
|
+
5. Map exact changes to only the affected targets and their necessary direct parent summaries or pointers. Never perform an unconditional repository-wide documentation rewrite.
|
|
49
|
+
6. If exact inputs cannot safely establish candidate or target scope, prepare `RETRO_BLOCKED` with the exact blocker.
|
|
50
|
+
|
|
51
|
+
Only targeted `.prizmkit/prizm-docs/` changes and `{artifact_dir}/retrospective-result.json` are outputs.
|
|
46
52
|
|
|
47
|
-
##
|
|
53
|
+
## Value and Cleanup Gates
|
|
48
54
|
|
|
49
|
-
|
|
50
|
-
2. Confirm the latest review result is `PASS`.
|
|
51
|
-
3. Confirm the latest testing result is `TEST_PASS`.
|
|
52
|
-
4. Read the final source diff with `.prizmkit/` excluded, then use `spec.md`, `plan.md`, the final `review-report.md`, `test-report.md`, and `test-result.json` only as supporting context for the non-`.prizmkit/` changes.
|
|
53
|
-
5. If the workflow state is missing or stale, reconstruct it from those authoritative artifacts and report the reconstruction.
|
|
55
|
+
Before retaining any candidate from an eligible source change, ask:
|
|
54
56
|
|
|
55
|
-
|
|
57
|
+
> Could a future AI that lacks this fact make an incorrect modification?
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
Retain a fact only when the answer is yes and the fact is current, durable, non-obvious, actionable, source-established, and placed at its lowest owning documentation level. Preserve rejected alternatives that future sessions are likely to propose again only when their durable reasons remain source-established.
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
Reject source-derivable structure or signatures, transient conclusions, historical/task/change material, duplicate meanings, stale or conflicting statements, test inventories, long procedures, parent-copied behavior, and low-value file lists or wording.
|
|
60
62
|
|
|
61
|
-
|
|
63
|
+
For every existing target:
|
|
62
64
|
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
- format, pointer, size, and memory-hygiene constraints for any docs the retrospective updates.
|
|
65
|
+
1. Read each existing target before preparing its replacement, including the resolving parent/child pointers necessary for that target.
|
|
66
|
+
2. Establish the protected set of still-valid contracts, constraints, traps, rules, data flow, dependencies, decisions, side effects, and safety/integrity knowledge.
|
|
67
|
+
3. Match existing and candidate facts by semantic meaning; update the canonical entry in place, merge synonymous facts, and remove obsolete, stale, derivable, duplicate, conflicting, or parent-copied material.
|
|
68
|
+
4. Add only genuinely new facts that pass the Value Gate and have no equivalent canonical entry. Append-only synchronization is prohibited.
|
|
68
69
|
|
|
69
|
-
|
|
70
|
+
Read `${SKILL_DIR}/references/knowledge-injection-steps.md` for candidate extraction and injection details.
|
|
70
71
|
|
|
71
|
-
|
|
72
|
+
## Capacity Preflight and Structural Sync
|
|
72
73
|
|
|
73
|
-
|
|
74
|
+
Read `${SKILL_DIR}/references/structural-sync-steps.md` and run its preflight for every target before replacement:
|
|
74
75
|
|
|
75
|
-
|
|
76
|
+
1. Measure the existing target's exact raw UTF-8 bytes.
|
|
77
|
+
2. Build the complete candidate result, including cleanup, before replacement and measure its exact raw UTF-8 bytes.
|
|
78
|
+
3. Apply hard limits of 4096B for the root project map, 4096B for a direct module index, and 5120B for a nested detail document. Classify normal below 80%, warning from 80% to below 90%, strong-warning from 90% through the hard limit, and error above the hard limit.
|
|
79
|
+
4. If current or candidate content reaches at least 80%, perform the minimum safe cleanup or semantic split before final replacement. Aim for 3277–3686B for a root/module index or 4096–4607B for a detail document, preserving approximately 10% headroom; never pad naturally concise output.
|
|
80
|
+
5. Never delete protected knowledge merely to satisfy a byte check. If protected knowledge cannot fit, use an unambiguous stable semantic boundary or block safely.
|
|
76
81
|
|
|
77
|
-
|
|
82
|
+
Plan and write bottom-up: create or update the most specific detail first, then synchronize its direct module index and the root project map only as concise summaries and resolving pointers. Complete `INTERFACES`, `DATA_FLOW`, `TRAPS`, `DECISIONS`, and full `RULES` remain in the owning detail rather than being copied into parents.
|
|
78
83
|
|
|
79
|
-
|
|
84
|
+
A real source submodule uses mirrored detail identity. An eligible flat module may use a deterministic semantic concern detail and direct-module `DETAILS` pointer only when the structural reference's identity, ownership, collision, and complete-terminal-shape checks pass.
|
|
80
85
|
|
|
81
|
-
|
|
82
|
-
- architectural rules or decisions;
|
|
83
|
-
- interface or contract changes;
|
|
84
|
-
- dependencies affecting module behavior;
|
|
85
|
-
- observable behavior changes;
|
|
86
|
-
- test-discovered boundaries or regression rules.
|
|
86
|
+
## Safe Write, Verification, and Idempotency
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
1. Before the first write, preserve exact pre-write bytes for every existing target in the bounded affected set and record which candidates are new.
|
|
89
|
+
2. Do not replace a target whose candidate already violates format, identity, pointer, protected-knowledge, or capacity checks.
|
|
90
|
+
3. Write the validated affected set bottom-up. After each write, re-read the actual file rather than trusting the proposed content.
|
|
91
|
+
4. Re-read every written `.prizm` file as raw bytes, recompute its raw UTF-8 byte length, apply its exact hard limit and warning band, validate its format, and resolve every affected pointer in both directions. Validate all affected parent and child documents, not only the last file written.
|
|
92
|
+
5. Review the final targeted documentation diff. Never report `RETRO_COMPLETE` after a failed check.
|
|
93
|
+
6. If any post-write check fails, restore every replaced target to its exact pre-write bytes and remove any invalid newly created target so no invalid oversized final document remains. Do not use Git reset, checkout, or stash for restoration.
|
|
94
|
+
7. Compare each validated candidate with current target bytes before replacement. If byte-identical, do not rewrite or reorder the document. With identical source changes and inputs and no intervening project change, a second run produces no `.prizm` content diff and returns `NO_DOC_CHANGE` with an already-synchronized reason.
|
|
89
95
|
|
|
90
|
-
When
|
|
96
|
+
When `.prizmkit/prizm-docs/` does not exist, record `NO_DOC_CHANGE` with reason `PRIZM_DOCS_NOT_INITIALIZED` and recommend initialization as a separate action.
|
|
91
97
|
|
|
92
|
-
##
|
|
98
|
+
## Capacity Blocker Contract
|
|
93
99
|
|
|
94
|
-
|
|
95
|
-
2. Review the final diff and ensure only intended documentation changes are present.
|
|
96
|
-
3. Do not change the target project's Git or ignore policy. If the host or project workflow stages docs, report what was staged; otherwise leave staging to `/prizmkit-committer`.
|
|
97
|
-
4. Never claim documentation synchronization passed if validation failed.
|
|
100
|
+
If protected knowledge cannot be compressed safely and no unambiguous stable split exists, do not leave the oversized candidate as final content. Restore any earlier writes from this attempt and write `RETRO_BLOCKED` with `result: null`.
|
|
98
101
|
|
|
99
|
-
|
|
102
|
+
The existing seven fields carry all evidence; add no new field. Put the exact target path, measured current or candidate bytes, applicable limit/band, protected knowledge that prevented trimming, and concrete recommended split boundary in `reason`. Put only checks actually attempted, including candidate capacity or pointer checks, in `validation`. Preserve the exact supplied `change_paths`; `documentation_paths` follows the schema and lists only documentation paths actually changed during the attempt. Never invent validation or claim success after restoration/validation failure.
|
|
100
103
|
|
|
101
|
-
|
|
104
|
+
## Result Artifact
|
|
105
|
+
|
|
106
|
+
Read `${SKILL_DIR}/references/retrospective-result-schema.json` and atomically write `{artifact_dir}/retrospective-result.json` with exactly these seven keys:
|
|
102
107
|
|
|
103
108
|
```json
|
|
104
109
|
{
|
|
105
|
-
"
|
|
106
|
-
"
|
|
110
|
+
"schema_version": 1,
|
|
111
|
+
"outcome": "RETRO_COMPLETE",
|
|
107
112
|
"result": "DOCS_UPDATED",
|
|
108
|
-
"reason": "Durable module
|
|
109
|
-
"
|
|
110
|
-
"
|
|
113
|
+
"reason": "Durable module contract changed and affected documentation passed validation",
|
|
114
|
+
"change_paths": ["src/example.py"],
|
|
115
|
+
"documentation_paths": [".prizmkit/prizm-docs/example/module.prizm"],
|
|
116
|
+
"validation": ["python3 core/templates/hooks/validate-prizm-docs.py --all"]
|
|
111
117
|
}
|
|
112
118
|
```
|
|
113
119
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
## Workflow State and Handoff
|
|
117
|
-
|
|
118
|
-
Before reading or updating workflow state, read `${SKILL_DIR}/references/workflow-state-protocol.md`.
|
|
120
|
+
Every retrospective artifact has exactly these seven keys: `schema_version`, `outcome`, `result`, `reason`, `change_paths`, `documentation_paths`, and `validation`.
|
|
119
121
|
|
|
120
|
-
|
|
122
|
+
A capacity or validation blocker uses the same shape without adding state:
|
|
121
123
|
|
|
122
124
|
```json
|
|
123
125
|
{
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"
|
|
126
|
+
"schema_version": 1,
|
|
127
|
+
"outcome": "RETRO_BLOCKED",
|
|
128
|
+
"result": null,
|
|
129
|
+
"reason": "Target .prizmkit/prizm-docs/example/module.prizm candidate=5200B limit=5120B; protected public contract prevents trimming; ownership check could not prove a stable split; recommended boundary: separate transport from persistence behavior",
|
|
130
|
+
"change_paths": ["src/example.py"],
|
|
131
|
+
"documentation_paths": [],
|
|
132
|
+
"validation": ["candidate raw UTF-8 capacity check: 5200B > 5120B", "semantic ownership check: ambiguous"]
|
|
130
133
|
}
|
|
131
134
|
```
|
|
132
135
|
|
|
133
|
-
|
|
136
|
+
- `RETRO_COMPLETE` pairs only with `DOCS_UPDATED` or `NO_DOC_CHANGE`.
|
|
137
|
+
- `DOCS_UPDATED` requires non-empty documentation and validation lists.
|
|
138
|
+
- `NO_DOC_CHANGE` uses a concrete reason and truthful empty or unchanged path evidence.
|
|
139
|
+
- `RETRO_BLOCKED` uses `result: null`, a non-empty exact reason, the exact input paths, only truthful documentation paths, and only checks actually attempted.
|
|
134
140
|
|
|
135
|
-
|
|
141
|
+
Do not add checkpoint, routing, capacity-state, caller-state, evidence-manifest, hash, or attestation fields.
|
|
136
142
|
|
|
137
|
-
## Output
|
|
143
|
+
## Output
|
|
138
144
|
|
|
139
|
-
|
|
145
|
+
Return only:
|
|
140
146
|
|
|
141
|
-
- `
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
- validation evidence
|
|
145
|
-
- workflow state path and status;
|
|
146
|
-
- the same `artifact_dir` for the next stage.
|
|
147
|
-
|
|
148
|
-
After `RETRO_COMPLETE`:
|
|
149
|
-
|
|
150
|
-
```text
|
|
151
|
-
RETRO_COMPLETE
|
|
152
|
-
→ /prizmkit-committer
|
|
153
|
-
```
|
|
147
|
+
- `artifact_dir` and `retrospective-result.json` path;
|
|
148
|
+
- `RETRO_COMPLETE` with `DOCS_UPDATED` or `NO_DOC_CHANGE`, or `RETRO_BLOCKED` with the exact blocker;
|
|
149
|
+
- documentation paths updated or intentionally unchanged;
|
|
150
|
+
- durable knowledge decisions and validation evidence.
|
|
154
151
|
|
|
155
|
-
|
|
152
|
+
Return only the listed retrospective outputs. Do not invoke another Skill.
|
|
@@ -1,51 +1,93 @@
|
|
|
1
|
-
# Knowledge Injection —
|
|
1
|
+
# Knowledge Injection — Exact-Scope Value and Cleanup Steps
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 1. Establish candidate fact authority
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- Current Main-Agent context for the requirement — reuse it rather than rereading artifacts by default
|
|
7
|
-
- Targeted unchanged source, interfaces, callers, dependents, or tests only when an eligible diff raises a concrete ambiguity
|
|
8
|
-
- The affected Prizm docs only as update targets and existing-knowledge checks, never as changed project input
|
|
5
|
+
Gather candidate knowledge only from actual project changes in the exact validated non-`.prizmkit/` input paths:
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
- `git diff HEAD -- <exact validated change_paths>` using literal pathspecs is the source of truth for eligible changes; never broaden the diff to `.` or use repository-wide status/discovery to add paths.
|
|
8
|
+
- Current source content at those exact paths may clarify the diff.
|
|
9
|
+
- Narrowly required unchanged source context (an interface, direct caller, direct dependent, or test) may be read only when an eligible diff raises a concrete ambiguity that cannot be resolved from the changed path itself.
|
|
10
|
+
- Existing affected Prizm docs may be read only as update targets, pointer maps, protected-current-knowledge evidence, and duplicate/staleness checks.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Generated artifacts, caller metadata, and existing Prizm text must not independently establish a candidate fact, expand `change_paths`, or turn an unrelated document into a target. `change_summary` is supporting context only. Reuse current Main-Agent source understanding when available, but do not treat lifecycle artifacts, completion notes, task IDs, or prior narrative as source evidence.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
- Minimal format: `- [SEVERITY] <description> | FIX: <approach>`
|
|
16
|
-
- Full format: `- [SEVERITY] <description> | FIX: <approach> | REF: <hash> | STALE_IF: <glob>`
|
|
17
|
-
- Source: actual bugs hit, surprising behavior discovered in code, non-obvious coupling
|
|
14
|
+
## 2. Apply the future-incorrect-modification Value Gate
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
- `[CRITICAL]`: data loss, security, financial error, system crash
|
|
21
|
-
- `[HIGH]`: functional failure, silent error, interface incompatibility
|
|
22
|
-
- `[LOW]`: misleading naming, non-intuitive API, minor performance issue
|
|
16
|
+
For every candidate, ask exactly:
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
- Severity prefix is MANDATORY (e.g., `[CRITICAL]`, `[HIGH]`, `[LOW]`)
|
|
26
|
-
- OPTIONAL: append `| REF: <7-char-hash>` when you know the relevant commit (for traceability)
|
|
27
|
-
- OPTIONAL: append `| STALE_IF: <glob>` when the TRAP is tightly coupled to specific files (for auto-expiry detection)
|
|
18
|
+
> Could a future AI that lacks this fact make an incorrect modification?
|
|
28
19
|
|
|
29
|
-
|
|
30
|
-
- If you encounter a TRAP prefixed with `[REVIEW]` (e.g., `[REVIEW][HIGH] ...`), verify whether the trap is still valid by checking the current code. If still valid: remove the `[REVIEW]` prefix, keeping the severity. If no longer relevant: delete the TRAP entry.
|
|
20
|
+
Retain it only when the answer is yes and current eligible source proves that it is durable, non-obvious, actionable for future modification, and owned by the target level.
|
|
31
21
|
|
|
32
|
-
|
|
33
|
-
- Format: `- MUST/NEVER/PREFER: <rule>`
|
|
34
|
-
- Source: patterns that proved necessary during implementation
|
|
22
|
+
High-value candidate classes include:
|
|
35
23
|
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
24
|
+
- non-obvious public interfaces and wire contracts;
|
|
25
|
+
- data flow, side effects, transactions, integrity boundaries, or surprising coupling;
|
|
26
|
+
- cross-module constraints and non-obvious dependencies;
|
|
27
|
+
- security, data-integrity, concurrency, transaction, and compatibility rules;
|
|
28
|
+
- actual traps, race conditions, failure modes, or unsafe-looking alternatives;
|
|
29
|
+
- architectural rules or durable decisions with rationale;
|
|
30
|
+
- observable behavior boundaries whose omission could cause a regression;
|
|
31
|
+
- rejected alternatives that future sessions are likely to propose again.
|
|
41
32
|
|
|
42
|
-
|
|
33
|
+
For a likely-to-recur rejected alternative, retain the alternative and its reason only when current eligible source establishes both. Do not retain a rejected option merely as design history.
|
|
43
34
|
|
|
44
|
-
|
|
35
|
+
Reject candidates that are source-derivable structure or signatures, transient implementation conclusions, historical task/change narrative, duplicate meanings, stale/conflicting statements, test inventories, coverage lists, routine file inventories, long procedures, low-value wording, or behavior already complete in a more specific child.
|
|
45
36
|
|
|
46
|
-
|
|
47
|
-
- Module-level TRAPS/RULES/DECISIONS → the affected **L2** `.prizm` file. If the target L2 does not exist, create it first using the L2 GENERATION TEMPLATE before injecting knowledge. (TRAPS/DECISIONS/RULES belong in L2, not L1.)
|
|
48
|
-
- Project-level RULES/PATTERNS → `root.prizm` (respect the current format — MODULE_INDEX or MODULE_GROUPS — do not convert between them during injection)
|
|
49
|
-
- Cross-module concerns spanning 2+ modules → `root.prizm` CROSS_CUTTING section
|
|
37
|
+
## 3. Extract only observed durable knowledge
|
|
50
38
|
|
|
51
|
-
|
|
39
|
+
### TRAPS
|
|
40
|
+
|
|
41
|
+
Use `- [SEVERITY] <description> | FIX: <approach>` and include only source-established non-obvious failure risks.
|
|
42
|
+
|
|
43
|
+
- `[CRITICAL]`: data loss, security failure, financial error, or crash.
|
|
44
|
+
- `[HIGH]`: functional failure, silent error, data-integrity risk, or interface incompatibility.
|
|
45
|
+
- `[LOW]`: misleading naming, non-intuitive API, or minor quality/performance risk that still passes the Value Gate.
|
|
46
|
+
|
|
47
|
+
Optional `REF` or `STALE_IF` metadata is allowed only when it is durable and source-relevant. For an affected `[REVIEW]` trap, remove the marker only when exact eligible source proves it still valid; delete it only when that source proves it obsolete. Lack of narrow evidence is not permission to delete it.
|
|
48
|
+
|
|
49
|
+
### RULES
|
|
50
|
+
|
|
51
|
+
Use `- MUST/NEVER/PREFER: <rule>`. Keep only constraints that a future modification must obey and that eligible source establishes.
|
|
52
|
+
|
|
53
|
+
### DECISIONS and rejected alternatives
|
|
54
|
+
|
|
55
|
+
Use `- <decision> — <durable rationale>` or `- REJECTED: <likely recurring alternative> — <why it remains rejected>`. Do not record obvious implementation choices or historical deliberation.
|
|
56
|
+
|
|
57
|
+
### Interfaces and behavior
|
|
58
|
+
|
|
59
|
+
Retain only non-obvious public/wire contracts, data flow, side effects, dependencies, and observable boundaries whose absence could cause an incorrect modification. Omit signatures and structure that direct source reading makes obvious.
|
|
60
|
+
|
|
61
|
+
## 4. Reconcile the current target before insertion
|
|
62
|
+
|
|
63
|
+
For every bounded affected target:
|
|
64
|
+
|
|
65
|
+
1. Read its current content and the necessary resolving direct parent/child pointers.
|
|
66
|
+
2. Build the protected set defined by the structural sync procedure before removing anything.
|
|
67
|
+
3. Match by semantic meaning, not exact wording.
|
|
68
|
+
4. Update the canonical entry in place when source changes an equivalent or conflicting fact; merge synonyms into one concise meaning.
|
|
69
|
+
5. Remove only source-proven obsolete facts plus stale, derivable, duplicate, low-value, or parent-copied material outside the protected set.
|
|
70
|
+
6. Add a candidate only when it passes the Value Gate and no equivalent canonical entry remains.
|
|
71
|
+
7. Preserve stable section and entry order; do not reorder unchanged entries or append alternate wording merely to make a diff.
|
|
72
|
+
|
|
73
|
+
Append-only injection is prohibited. Cleanup remains limited to the exact affected targets and their necessary direct parent summaries/pointers; do not opportunistically clean siblings.
|
|
74
|
+
|
|
75
|
+
## 5. Place knowledge at the lowest owning level
|
|
76
|
+
|
|
77
|
+
- Module behavioral details, `INTERFACES`, `DATA_FLOW`, `TRAPS`, complete `RULES`, `DECISIONS`, and rejected alternatives belong in the most specific mirrored or deterministic semantic detail.
|
|
78
|
+
- A real source-submodule boundary uses mirrored detail identity first.
|
|
79
|
+
- A flat module uses a semantic concern detail only when the structural procedure proves stable deterministic identity, explicit non-overlapping source-file ownership, capacity need, complete terminal shape, and a resolving direct-module `DETAILS` pointer.
|
|
80
|
+
- A direct module index keeps concise structure, navigation, critical summaries, and pointers; it does not copy complete child behavior.
|
|
81
|
+
- The root project map keeps only concise navigation and genuinely project-wide/cross-module summaries. An exact eligible change must establish the project-wide fact; existing root text cannot create one.
|
|
82
|
+
|
|
83
|
+
When one eligible change truly spans multiple affected modules, place complete knowledge in the lowest owning details and retain only the shortest useful cross-module summary/pointers at root. Do not infer cross-module scope from unrelated existing documentation.
|
|
84
|
+
|
|
85
|
+
## 6. Hand candidate results to capacity preflight
|
|
86
|
+
|
|
87
|
+
Do not write directly from extraction. Hand the complete cleaned candidate, protected set, exact target identity, and affected direct pointers to `structural-sync-steps.md` for raw UTF-8 size measurement, minimum safe cleanup or semantic split, bottom-up replacement, re-read validation, and safe restoration.
|
|
88
|
+
|
|
89
|
+
If no candidate survives the Value Gate and structural reconciliation produces no byte change, return a truthful `NO_DOC_CHANGE`. A repeated run over identical source and inputs must preserve byte-identical documentation and must not create duplicate, reorder-only, or synonym-only churn.
|
|
90
|
+
|
|
91
|
+
## 7. Enforce memory hygiene
|
|
92
|
+
|
|
93
|
+
Before final candidate validation, remove CHANGELOG sections/files, UPDATED/date metadata, feature/bug/refactor/task/session/run/pipeline/workflow IDs, branch names, absolute worktree paths, and `.prizmkit/specs` or `.prizmkit/dev-pipeline` artifact paths. Never trade protected durable product/domain knowledge for traceability noise.
|