prizmkit 1.1.99 → 1.1.101
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/bin/create-prizmkit.js +4 -4
- package/bundled/VERSION.json +3 -3
- package/bundled/dev-pipeline/.env.example +3 -3
- package/bundled/dev-pipeline/README.md +110 -90
- package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +1 -1
- package/bundled/dev-pipeline/cli.py +27 -0
- package/bundled/dev-pipeline/prizmkit_runtime/__init__.py +13 -0
- package/bundled/dev-pipeline/prizmkit_runtime/__main__.py +9 -0
- package/bundled/dev-pipeline/prizmkit_runtime/cli.py +193 -0
- package/bundled/dev-pipeline/prizmkit_runtime/commands.py +313 -0
- package/bundled/dev-pipeline/prizmkit_runtime/compat.py +32 -0
- package/bundled/dev-pipeline/prizmkit_runtime/config.py +410 -0
- package/bundled/dev-pipeline/prizmkit_runtime/daemon.py +478 -0
- package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +734 -0
- package/bundled/dev-pipeline/prizmkit_runtime/heartbeat.py +256 -0
- package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +109 -0
- package/bundled/dev-pipeline/prizmkit_runtime/paths.py +110 -0
- package/bundled/dev-pipeline/prizmkit_runtime/processes.py +373 -0
- package/bundled/dev-pipeline/prizmkit_runtime/reset.py +389 -0
- package/bundled/dev-pipeline/prizmkit_runtime/runner_bookkeeping.py +51 -0
- package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +179 -0
- package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +345 -0
- package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +118 -0
- package/bundled/dev-pipeline/prizmkit_runtime/runner_recovery.py +187 -0
- package/bundled/dev-pipeline/prizmkit_runtime/runner_status.py +147 -0
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +422 -0
- package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +552 -0
- package/bundled/dev-pipeline/prizmkit_runtime/status.py +71 -0
- package/bundled/dev-pipeline/scripts/check-session-status.py +74 -1
- package/bundled/dev-pipeline/scripts/continuation.py +374 -0
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +64 -52
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +35 -25
- package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +2 -2
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +15 -20
- package/bundled/dev-pipeline/scripts/parse-stream-progress.py +185 -16
- package/bundled/dev-pipeline/scripts/update-bug-status.py +214 -6
- package/bundled/dev-pipeline/scripts/update-feature-status.py +237 -6
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +214 -6
- package/bundled/dev-pipeline/templates/agent-prompts/dev-implement.md +8 -2
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +4 -0
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +14 -5
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +16 -6
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +16 -6
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +1 -1
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +3 -3
- package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +2 -0
- package/bundled/dev-pipeline/templates/sections/log-size-awareness.md +13 -69
- package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +15 -7
- package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +42 -29
- package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +41 -39
- package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +4 -0
- package/bundled/dev-pipeline/templates/sections/test-failure-recovery-lite.md +4 -0
- package/bundled/dev-pipeline/templates/session-status-schema.json +1 -1
- package/bundled/dev-pipeline/tests/conftest.py +1 -0
- package/bundled/dev-pipeline/tests/test_auto_skip.py +932 -0
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +207 -0
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +100 -0
- package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +43 -0
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +1138 -0
- package/bundled/dev-pipeline/tests/test_unified_cli.py +1045 -0
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +29 -34
- package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +6 -5
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +29 -35
- package/bundled/skills/feature-pipeline-launcher/references/configuration.md +7 -6
- package/bundled/skills/feature-workflow/SKILL.md +3 -6
- package/bundled/skills/recovery-workflow/SKILL.md +23 -32
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +29 -35
- package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +7 -6
- package/bundled/skills/refactor-workflow/SKILL.md +3 -6
- package/bundled/templates/hooks/commit-intent.json +2 -2
- package/bundled/templates/hooks/diff-prizm-docs.py +226 -0
- package/bundled/templates/hooks/prizm-pre-commit.py +45 -0
- package/bundled/templates/hooks/validate-prizm-docs.py +240 -0
- package/package.json +1 -1
- package/src/config.js +33 -12
- package/src/index.js +3 -6
- package/src/manifest.js +3 -2
- package/src/metadata.js +7 -18
- package/src/prompts.js +0 -12
- package/src/runtimes.js +18 -11
- package/src/scaffold.js +133 -116
- package/src/upgrade.js +1 -1
- package/bundled/dev-pipeline/launch-bugfix-daemon.sh +0 -500
- package/bundled/dev-pipeline/launch-feature-daemon.sh +0 -657
- package/bundled/dev-pipeline/launch-refactor-daemon.sh +0 -502
- package/bundled/dev-pipeline/lib/branch.sh +0 -326
- package/bundled/dev-pipeline/lib/common.sh +0 -1257
- package/bundled/dev-pipeline/lib/heartbeat.sh +0 -469
- package/bundled/dev-pipeline/reset-bug.sh +0 -395
- package/bundled/dev-pipeline/reset-feature.sh +0 -406
- package/bundled/dev-pipeline/reset-refactor.sh +0 -393
- package/bundled/dev-pipeline/run-bugfix.sh +0 -1315
- package/bundled/dev-pipeline/run-feature.sh +0 -1602
- package/bundled/dev-pipeline/run-recovery.sh +0 -648
- package/bundled/dev-pipeline/run-refactor.sh +0 -1348
- package/bundled/dev-pipeline/scripts/monitor-log.sh +0 -104
- package/bundled/dev-pipeline/tests/test-path-resolution.sh +0 -100
- package/bundled/dev-pipeline-windows/.env.example +0 -36
- package/bundled/dev-pipeline-windows/README.md +0 -30
- package/bundled/dev-pipeline-windows/SCHEMA_ANALYSIS.md +0 -533
- package/bundled/dev-pipeline-windows/assets/feature-list-example.json +0 -146
- package/bundled/dev-pipeline-windows/assets/prizm-dev-team-integration.md +0 -137
- package/bundled/dev-pipeline-windows/launch-bugfix-daemon.ps1 +0 -9
- package/bundled/dev-pipeline-windows/launch-feature-daemon.ps1 +0 -9
- package/bundled/dev-pipeline-windows/launch-refactor-daemon.ps1 +0 -9
- package/bundled/dev-pipeline-windows/lib/branch.ps1 +0 -235
- package/bundled/dev-pipeline-windows/lib/common.ps1 +0 -829
- package/bundled/dev-pipeline-windows/lib/daemon.ps1 +0 -140
- package/bundled/dev-pipeline-windows/lib/pipeline.ps1 +0 -967
- package/bundled/dev-pipeline-windows/lib/reset.ps1 +0 -87
- package/bundled/dev-pipeline-windows/reset-bug.ps1 +0 -9
- package/bundled/dev-pipeline-windows/reset-feature.ps1 +0 -9
- package/bundled/dev-pipeline-windows/reset-refactor.ps1 +0 -9
- package/bundled/dev-pipeline-windows/run-bugfix.ps1 +0 -9
- package/bundled/dev-pipeline-windows/run-feature.ps1 +0 -9
- package/bundled/dev-pipeline-windows/run-recovery.ps1 +0 -179
- package/bundled/dev-pipeline-windows/run-refactor.ps1 +0 -9
- package/bundled/dev-pipeline-windows/scripts/check-session-status.py +0 -228
- package/bundled/dev-pipeline-windows/scripts/detect-stuck.py +0 -530
- package/bundled/dev-pipeline-windows/scripts/generate-bootstrap-prompt.py +0 -2282
- package/bundled/dev-pipeline-windows/scripts/generate-bugfix-prompt.py +0 -767
- package/bundled/dev-pipeline-windows/scripts/generate-recovery-prompt.py +0 -805
- package/bundled/dev-pipeline-windows/scripts/generate-refactor-prompt.py +0 -845
- package/bundled/dev-pipeline-windows/scripts/init-bugfix-pipeline.py +0 -316
- package/bundled/dev-pipeline-windows/scripts/init-dev-team.py +0 -134
- package/bundled/dev-pipeline-windows/scripts/init-pipeline.py +0 -382
- package/bundled/dev-pipeline-windows/scripts/init-refactor-pipeline.py +0 -399
- package/bundled/dev-pipeline-windows/scripts/monitor-log.ps1 +0 -102
- package/bundled/dev-pipeline-windows/scripts/parse-stream-progress.py +0 -1232
- package/bundled/dev-pipeline-windows/scripts/patch-completion-notes.py +0 -191
- package/bundled/dev-pipeline-windows/scripts/prizmkit-test-gate.py +0 -446
- package/bundled/dev-pipeline-windows/scripts/update-bug-status.py +0 -913
- package/bundled/dev-pipeline-windows/scripts/update-checkpoint.py +0 -173
- package/bundled/dev-pipeline-windows/scripts/update-feature-status.py +0 -1558
- package/bundled/dev-pipeline-windows/scripts/update-refactor-status.py +0 -1119
- package/bundled/dev-pipeline-windows/scripts/utils.py +0 -542
- package/bundled/dev-pipeline-windows/templates/agent-prompts/critic-plan-challenge.md +0 -7
- package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-fix.md +0 -7
- package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-implement.md +0 -65
- package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-resume.md +0 -5
- package/bundled/dev-pipeline-windows/templates/agent-prompts/reviewer-review.md +0 -7
- package/bundled/dev-pipeline-windows/templates/bootstrap-prompt.md +0 -73
- package/bundled/dev-pipeline-windows/templates/bootstrap-tier1.md +0 -589
- package/bundled/dev-pipeline-windows/templates/bootstrap-tier2.md +0 -710
- package/bundled/dev-pipeline-windows/templates/bootstrap-tier3.md +0 -791
- package/bundled/dev-pipeline-windows/templates/bug-fix-list-schema.json +0 -263
- package/bundled/dev-pipeline-windows/templates/bugfix-bootstrap-prompt.md +0 -326
- package/bundled/dev-pipeline-windows/templates/feature-list-schema.json +0 -237
- package/bundled/dev-pipeline-windows/templates/refactor-bootstrap-prompt.md +0 -340
- package/bundled/dev-pipeline-windows/templates/refactor-list-schema.json +0 -270
- package/bundled/dev-pipeline-windows/templates/sections/ac-verification-checklist.md +0 -7
- package/bundled/dev-pipeline-windows/templates/sections/checkpoint-system.md +0 -91
- package/bundled/dev-pipeline-windows/templates/sections/context-budget-rules.md +0 -34
- package/bundled/dev-pipeline-windows/templates/sections/critical-paths-agent.md +0 -10
- package/bundled/dev-pipeline-windows/templates/sections/critical-paths-full.md +0 -12
- package/bundled/dev-pipeline-windows/templates/sections/critical-paths-lite.md +0 -7
- package/bundled/dev-pipeline-windows/templates/sections/directory-convention-agent.md +0 -8
- package/bundled/dev-pipeline-windows/templates/sections/directory-convention-full.md +0 -9
- package/bundled/dev-pipeline-windows/templates/sections/directory-convention-lite.md +0 -6
- package/bundled/dev-pipeline-windows/templates/sections/failure-capture.md +0 -21
- package/bundled/dev-pipeline-windows/templates/sections/feature-context.md +0 -21
- package/bundled/dev-pipeline-windows/templates/sections/log-size-awareness.md +0 -78
- package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification-auto.md +0 -283
- package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification-opencli.md +0 -112
- package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification.md +0 -168
- package/bundled/dev-pipeline-windows/templates/sections/phase-commit-full.md +0 -82
- package/bundled/dev-pipeline-windows/templates/sections/phase-commit.md +0 -75
- package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-agent-suffix.md +0 -23
- package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-base.md +0 -14
- package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-lite-suffix.md +0 -19
- package/bundled/dev-pipeline-windows/templates/sections/phase-critic-plan-full.md +0 -63
- package/bundled/dev-pipeline-windows/templates/sections/phase-critic-plan.md +0 -42
- package/bundled/dev-pipeline-windows/templates/sections/phase-implement-agent.md +0 -44
- package/bundled/dev-pipeline-windows/templates/sections/phase-implement-full.md +0 -59
- package/bundled/dev-pipeline-windows/templates/sections/phase-implement-lite.md +0 -39
- package/bundled/dev-pipeline-windows/templates/sections/phase-plan-agent.md +0 -27
- package/bundled/dev-pipeline-windows/templates/sections/phase-plan-lite.md +0 -27
- package/bundled/dev-pipeline-windows/templates/sections/phase-prizmkit-test.md +0 -39
- package/bundled/dev-pipeline-windows/templates/sections/phase-review-agent.md +0 -35
- package/bundled/dev-pipeline-windows/templates/sections/phase-review-full.md +0 -35
- package/bundled/dev-pipeline-windows/templates/sections/phase-specify-plan-full.md +0 -73
- package/bundled/dev-pipeline-windows/templates/sections/phase0-init.md +0 -13
- package/bundled/dev-pipeline-windows/templates/sections/phase0-test-baseline.md +0 -21
- package/bundled/dev-pipeline-windows/templates/sections/session-context.md +0 -5
- package/bundled/dev-pipeline-windows/templates/sections/subagent-timeout-recovery.md +0 -6
- package/bundled/dev-pipeline-windows/templates/sections/task-contract.md +0 -34
- package/bundled/dev-pipeline-windows/templates/sections/test-failure-recovery-agent.md +0 -48
- package/bundled/dev-pipeline-windows/templates/sections/test-failure-recovery-lite.md +0 -48
- package/bundled/dev-pipeline-windows/templates/session-status-schema.json +0 -83
- package/bundled/skills-windows/app-planner/SKILL.md +0 -296
- package/bundled/skills-windows/app-planner/assets/app-design-guide.md +0 -101
- package/bundled/skills-windows/app-planner/references/architecture-decisions.md +0 -52
- package/bundled/skills-windows/app-planner/references/brainstorm-guide.md +0 -101
- package/bundled/skills-windows/app-planner/references/frontend-design-guide.md +0 -71
- package/bundled/skills-windows/app-planner/references/infrastructure-convention-discovery.md +0 -108
- package/bundled/skills-windows/app-planner/references/project-brief-guide.md +0 -82
- package/bundled/skills-windows/app-planner/references/project-conventions-discovery.md +0 -59
- package/bundled/skills-windows/app-planner/references/project-state-detection.md +0 -90
- package/bundled/skills-windows/app-planner/references/red-team-checklist.md +0 -40
- package/bundled/skills-windows/app-planner/references/rules/backend/derivation-rules.md +0 -619
- package/bundled/skills-windows/app-planner/references/rules/backend/fixed-rules.md +0 -285
- package/bundled/skills-windows/app-planner/references/rules/backend/question-bank.md +0 -249
- package/bundled/skills-windows/app-planner/references/rules/backend/question-manifest.json +0 -46
- package/bundled/skills-windows/app-planner/references/rules/backend/template.md +0 -173
- package/bundled/skills-windows/app-planner/references/rules/database/derivation-rules.md +0 -382
- package/bundled/skills-windows/app-planner/references/rules/database/fixed-rules.md +0 -211
- package/bundled/skills-windows/app-planner/references/rules/database/question-bank.md +0 -184
- package/bundled/skills-windows/app-planner/references/rules/database/question-manifest.json +0 -39
- package/bundled/skills-windows/app-planner/references/rules/database/template.md +0 -158
- package/bundled/skills-windows/app-planner/references/rules/frontend/derivation-rules.md +0 -820
- package/bundled/skills-windows/app-planner/references/rules/frontend/fixed-rules.md +0 -188
- package/bundled/skills-windows/app-planner/references/rules/frontend/question-bank.md +0 -319
- package/bundled/skills-windows/app-planner/references/rules/frontend/question-manifest.json +0 -51
- package/bundled/skills-windows/app-planner/references/rules/frontend/template.md +0 -339
- package/bundled/skills-windows/app-planner/references/rules/mobile/derivation-rules.md +0 -649
- package/bundled/skills-windows/app-planner/references/rules/mobile/fixed-rules.md +0 -290
- package/bundled/skills-windows/app-planner/references/rules/mobile/question-bank.md +0 -232
- package/bundled/skills-windows/app-planner/references/rules/mobile/question-manifest.json +0 -47
- package/bundled/skills-windows/app-planner/references/rules/mobile/template.md +0 -175
- package/bundled/skills-windows/app-planner/references/rules-configuration.md +0 -46
- package/bundled/skills-windows/bug-fix-workflow/SKILL.md +0 -379
- package/bundled/skills-windows/bug-fix-workflow/references/bug-diagnosis.md +0 -41
- package/bundled/skills-windows/bug-planner/SKILL.md +0 -402
- package/bundled/skills-windows/bug-planner/assets/bug-confirmation-template.md +0 -43
- package/bundled/skills-windows/bug-planner/references/critic-and-verification.md +0 -44
- package/bundled/skills-windows/bug-planner/references/error-recovery.md +0 -73
- package/bundled/skills-windows/bug-planner/references/input-formats.md +0 -53
- package/bundled/skills-windows/bug-planner/references/schema-validation.md +0 -25
- package/bundled/skills-windows/bug-planner/references/severity-rules.md +0 -16
- package/bundled/skills-windows/bug-planner/scripts/validate-bug-list.py +0 -322
- package/bundled/skills-windows/bugfix-pipeline-launcher/SKILL.md +0 -304
- package/bundled/skills-windows/bugfix-pipeline-launcher/references/configuration.md +0 -84
- package/bundled/skills-windows/feature-pipeline-launcher/SKILL.md +0 -381
- package/bundled/skills-windows/feature-pipeline-launcher/references/configuration.md +0 -67
- package/bundled/skills-windows/feature-pipeline-launcher/scripts/preflight-check.py +0 -462
- package/bundled/skills-windows/feature-planner/SKILL.md +0 -397
- package/bundled/skills-windows/feature-planner/assets/evaluation-guide.md +0 -64
- package/bundled/skills-windows/feature-planner/assets/planning-guide.md +0 -214
- package/bundled/skills-windows/feature-planner/references/browser-interaction.md +0 -59
- package/bundled/skills-windows/feature-planner/references/completeness-review.md +0 -57
- package/bundled/skills-windows/feature-planner/references/decomposition-patterns.md +0 -75
- package/bundled/skills-windows/feature-planner/references/error-recovery.md +0 -90
- package/bundled/skills-windows/feature-planner/references/incremental-feature-planning.md +0 -112
- package/bundled/skills-windows/feature-planner/references/new-project-planning.md +0 -85
- package/bundled/skills-windows/feature-planner/scripts/validate-and-generate.py +0 -1020
- package/bundled/skills-windows/feature-workflow/SKILL.md +0 -374
- package/bundled/skills-windows/feature-workflow/references/brainstorm-guide.md +0 -137
- package/bundled/skills-windows/prizm-kit/SKILL.md +0 -93
- package/bundled/skills-windows/prizmkit-code-review/SKILL.md +0 -161
- package/bundled/skills-windows/prizmkit-code-review/references/dev-agent-prompt.md +0 -30
- package/bundled/skills-windows/prizmkit-code-review/references/review-report-template.md +0 -31
- package/bundled/skills-windows/prizmkit-code-review/references/reviewer-agent-prompt.md +0 -66
- package/bundled/skills-windows/prizmkit-code-review/scripts/check_loop.py +0 -186
- package/bundled/skills-windows/prizmkit-committer/SKILL.md +0 -89
- package/bundled/skills-windows/prizmkit-deploy/SKILL.md +0 -444
- package/bundled/skills-windows/prizmkit-deploy/references/ci-cd-workflows.md +0 -115
- package/bundled/skills-windows/prizmkit-deploy/references/cloud-platform-deploy.md +0 -93
- package/bundled/skills-windows/prizmkit-deploy/references/data-safety-examples.md +0 -120
- package/bundled/skills-windows/prizmkit-deploy/references/database-setup.md +0 -46
- package/bundled/skills-windows/prizmkit-deploy/references/deploy-config-schema.md +0 -148
- package/bundled/skills-windows/prizmkit-deploy/references/deploy-history-schema.md +0 -62
- package/bundled/skills-windows/prizmkit-deploy/references/deployment-modes.md +0 -50
- package/bundled/skills-windows/prizmkit-deploy/references/direct-upload.md +0 -26
- package/bundled/skills-windows/prizmkit-deploy/references/dns-setup.md +0 -42
- package/bundled/skills-windows/prizmkit-deploy/references/docker-deploy.md +0 -31
- package/bundled/skills-windows/prizmkit-deploy/references/firewall-setup.md +0 -37
- package/bundled/skills-windows/prizmkit-deploy/references/live-validation-notes.md +0 -21
- package/bundled/skills-windows/prizmkit-deploy/references/nginx-blue-green.md +0 -59
- package/bundled/skills-windows/prizmkit-deploy/references/ssh-bootstrap-flow.md +0 -49
- package/bundled/skills-windows/prizmkit-deploy/references/ssh-execution-flow.md +0 -41
- package/bundled/skills-windows/prizmkit-deploy/references/ssh-takeover.md +0 -20
- package/bundled/skills-windows/prizmkit-deploy/references/ssl-setup.md +0 -56
- package/bundled/skills-windows/prizmkit-implement/SKILL.md +0 -71
- package/bundled/skills-windows/prizmkit-init/SKILL.md +0 -356
- package/bundled/skills-windows/prizmkit-init/assets/project-brief-template.md +0 -82
- package/bundled/skills-windows/prizmkit-init/references/config-schema.md +0 -70
- package/bundled/skills-windows/prizmkit-init/references/rules/layer-detection.md +0 -41
- package/bundled/skills-windows/prizmkit-init/references/tech-stack-catalog.md +0 -13
- package/bundled/skills-windows/prizmkit-init/references/update-supplement.md +0 -9
- package/bundled/skills-windows/prizmkit-plan/SKILL.md +0 -102
- package/bundled/skills-windows/prizmkit-plan/assets/plan-template.md +0 -115
- package/bundled/skills-windows/prizmkit-plan/assets/spec-template.md +0 -73
- package/bundled/skills-windows/prizmkit-plan/references/clarify-guide.md +0 -67
- package/bundled/skills-windows/prizmkit-plan/references/examples.md +0 -85
- package/bundled/skills-windows/prizmkit-plan/references/verification-checklist.md +0 -60
- package/bundled/skills-windows/prizmkit-prizm-docs/SKILL.md +0 -129
- package/bundled/skills-windows/prizmkit-prizm-docs/assets/prizm-docs-format.md +0 -613
- package/bundled/skills-windows/prizmkit-prizm-docs/references/op-init.md +0 -45
- package/bundled/skills-windows/prizmkit-prizm-docs/references/op-rebuild.md +0 -15
- package/bundled/skills-windows/prizmkit-prizm-docs/references/op-status.md +0 -14
- package/bundled/skills-windows/prizmkit-prizm-docs/references/op-update.md +0 -19
- package/bundled/skills-windows/prizmkit-prizm-docs/references/op-validate.md +0 -17
- package/bundled/skills-windows/prizmkit-retrospective/SKILL.md +0 -87
- package/bundled/skills-windows/prizmkit-retrospective/references/knowledge-injection-steps.md +0 -50
- package/bundled/skills-windows/prizmkit-retrospective/references/structural-sync-steps.md +0 -43
- package/bundled/skills-windows/prizmkit-test/SKILL.md +0 -227
- package/bundled/skills-windows/prizmkit-test/references/boundary-coverage-protocol.md +0 -220
- package/bundled/skills-windows/prizmkit-test/references/examples.md +0 -143
- package/bundled/skills-windows/prizmkit-test/references/service-boundary-test-catalog.md +0 -225
- package/bundled/skills-windows/prizmkit-test/references/test-generation-steps.md +0 -109
- package/bundled/skills-windows/prizmkit-test/references/test-report-template.md +0 -111
- package/bundled/skills-windows/prizmkit-test/scripts/validate_boundary_report.py +0 -347
- package/bundled/skills-windows/recovery-workflow/SKILL.md +0 -355
- package/bundled/skills-windows/recovery-workflow/evals/evals.json +0 -46
- package/bundled/skills-windows/recovery-workflow/references/detection.md +0 -58
- package/bundled/skills-windows/recovery-workflow/scripts/detect-recovery-state.py +0 -544
- package/bundled/skills-windows/refactor-pipeline-launcher/SKILL.md +0 -346
- package/bundled/skills-windows/refactor-pipeline-launcher/references/configuration.md +0 -72
- package/bundled/skills-windows/refactor-planner/SKILL.md +0 -398
- package/bundled/skills-windows/refactor-planner/assets/planning-guide.md +0 -292
- package/bundled/skills-windows/refactor-planner/references/behavior-preservation.md +0 -301
- package/bundled/skills-windows/refactor-planner/references/fast-path.md +0 -59
- package/bundled/skills-windows/refactor-planner/references/planning-phases.md +0 -135
- package/bundled/skills-windows/refactor-planner/references/refactor-scoping-guide.md +0 -221
- package/bundled/skills-windows/refactor-planner/scripts/validate-and-generate-refactor.py +0 -858
- package/bundled/skills-windows/refactor-workflow/SKILL.md +0 -343
- package/bundled/skills-windows/refactor-workflow/references/brainstorm-guide.md +0 -116
- package/bundled/templates/hooks/diff-prizm-docs.sh +0 -158
- package/bundled/templates/hooks/prizm-pre-commit.sh +0 -108
- package/bundled/templates/hooks/validate-prizm-docs.sh +0 -139
|
@@ -60,30 +60,66 @@ PHASE_KEYWORDS = {
|
|
|
60
60
|
},
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
CONTEXT_OVERFLOW_CODE = "context_overflow"
|
|
64
|
+
|
|
65
|
+
# Exact machine/wrapper signals. These are only treated as self-sufficient when
|
|
66
|
+
# they appear in structured error-code fields or as explicit wrapper markers.
|
|
67
|
+
CONTEXT_CODE_PATTERNS = [
|
|
68
|
+
re.compile(pattern, re.IGNORECASE)
|
|
69
|
+
for pattern in (
|
|
70
|
+
r"\bcontext_overflow\b",
|
|
71
|
+
r"\bcontext_too_large\b",
|
|
72
|
+
r"\bcontext_length_exceeded\b",
|
|
73
|
+
r"\bmodel_context_window_exceeded\b",
|
|
74
|
+
)
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
WRAPPER_CONTEXT_ERROR_PATTERNS = [
|
|
78
|
+
re.compile(pattern, re.IGNORECASE)
|
|
79
|
+
for pattern in (
|
|
80
|
+
r"\bPRIZMKIT_FATAL_ERROR\s*=\s*context_overflow\b",
|
|
81
|
+
)
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
# Natural-language provider messages are weak signals: they require an adjacent
|
|
85
|
+
# runtime/API error context unless a structured field already proves the result
|
|
86
|
+
# is an error.
|
|
87
|
+
WEAK_CONTEXT_ERROR_PATTERNS = [
|
|
64
88
|
re.compile(pattern, re.IGNORECASE)
|
|
65
89
|
for pattern in (
|
|
66
|
-
r"context_too_large",
|
|
67
|
-
r"model_context_window_exceeded",
|
|
68
90
|
r"Your input exceeds the context window",
|
|
69
|
-
r"input exceeds the context window",
|
|
91
|
+
r"input exceeds (?:the )?(?:model )?context window",
|
|
70
92
|
r"context window of this model",
|
|
71
|
-
r"context window exceeded",
|
|
72
|
-
r"
|
|
73
|
-
r"context
|
|
93
|
+
r"context window (?:was )?exceeded",
|
|
94
|
+
r"exceeded (?:the )?context window",
|
|
95
|
+
r"maximum context length exceeded",
|
|
96
|
+
r"prompt is too long",
|
|
97
|
+
r"too many tokens",
|
|
98
|
+
r"input token count exceeds",
|
|
99
|
+
r"input tokens? exceeds?",
|
|
100
|
+
r"token count exceeds",
|
|
74
101
|
)
|
|
75
102
|
]
|
|
76
103
|
|
|
104
|
+
REQUEST_TOO_LARGE_PATTERN = re.compile(r"\brequest (?:is )?too large\b", re.IGNORECASE)
|
|
105
|
+
REQUEST_TOO_LARGE_SEMANTIC_PATTERN = re.compile(
|
|
106
|
+
r"\b(context|token|tokens|prompt|input|model)\b",
|
|
107
|
+
re.IGNORECASE,
|
|
108
|
+
)
|
|
109
|
+
|
|
77
110
|
ERROR_CONTEXT_PATTERNS = [
|
|
78
111
|
re.compile(pattern, re.IGNORECASE)
|
|
79
112
|
for pattern in (
|
|
80
113
|
r"\bapi error\b",
|
|
81
114
|
r"invalid_request_error",
|
|
115
|
+
r"\bbad request\b",
|
|
82
116
|
r"\bstatus\s*[:=]?\s*(400|413)\b",
|
|
83
117
|
r"\bapi_error_status\b",
|
|
84
118
|
r"\bapi_error_code\b",
|
|
85
119
|
r"\blast_result_is_error\b\s*[\"':=]*\s*true\b",
|
|
86
120
|
r"\bis_error\b\s*[\"':=]*\s*true\b",
|
|
121
|
+
r"\berror\s*[:=]",
|
|
122
|
+
r"\bfatal\s*[:=]",
|
|
87
123
|
)
|
|
88
124
|
]
|
|
89
125
|
|
|
@@ -95,21 +131,41 @@ def _has_error_context(text):
|
|
|
95
131
|
return any(pattern.search(text) for pattern in ERROR_CONTEXT_PATTERNS)
|
|
96
132
|
|
|
97
133
|
|
|
98
|
-
def
|
|
134
|
+
def _has_context_overflow_signal(text, structured_code=False):
|
|
135
|
+
"""Return true when text contains a context-window/token overflow signal."""
|
|
136
|
+
if not text:
|
|
137
|
+
return False
|
|
138
|
+
if any(pattern.search(text) for pattern in WRAPPER_CONTEXT_ERROR_PATTERNS):
|
|
139
|
+
return True
|
|
140
|
+
if structured_code and any(pattern.search(text) for pattern in CONTEXT_CODE_PATTERNS):
|
|
141
|
+
return True
|
|
142
|
+
if any(pattern.search(text) for pattern in CONTEXT_CODE_PATTERNS):
|
|
143
|
+
return True
|
|
144
|
+
if any(pattern.search(text) for pattern in WEAK_CONTEXT_ERROR_PATTERNS):
|
|
145
|
+
return True
|
|
146
|
+
if REQUEST_TOO_LARGE_PATTERN.search(text) and REQUEST_TOO_LARGE_SEMANTIC_PATTERN.search(text):
|
|
147
|
+
return True
|
|
148
|
+
return False
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def detect_api_error_code(text, require_error_context=False, structured_code=False):
|
|
99
152
|
"""Return a normalized fatal/runtime error code from terminal text.
|
|
100
153
|
|
|
101
|
-
Structured
|
|
102
|
-
directly.
|
|
103
|
-
|
|
104
|
-
|
|
154
|
+
Structured error-code fields and explicit wrapper markers can be matched
|
|
155
|
+
directly. Natural-language provider messages require runtime/API context to
|
|
156
|
+
avoid false positives from prompts, tests, or documentation that merely
|
|
157
|
+
mention context windows or token limits.
|
|
105
158
|
"""
|
|
106
159
|
if not text:
|
|
107
160
|
return ""
|
|
161
|
+
if any(pattern.search(text) for pattern in WRAPPER_CONTEXT_ERROR_PATTERNS):
|
|
162
|
+
return CONTEXT_OVERFLOW_CODE
|
|
163
|
+
if structured_code and any(pattern.search(text) for pattern in CONTEXT_CODE_PATTERNS):
|
|
164
|
+
return CONTEXT_OVERFLOW_CODE
|
|
108
165
|
if require_error_context and not _has_error_context(text):
|
|
109
166
|
return ""
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return "context_too_large"
|
|
167
|
+
if _has_context_overflow_signal(text, structured_code=structured_code):
|
|
168
|
+
return CONTEXT_OVERFLOW_CODE
|
|
113
169
|
return ""
|
|
114
170
|
|
|
115
171
|
|
|
@@ -119,6 +175,7 @@ class ProgressTracker:
|
|
|
119
175
|
def __init__(self, session_log=None):
|
|
120
176
|
self.session_log_path = Path(session_log).expanduser() if session_log else None
|
|
121
177
|
self.message_count = 0
|
|
178
|
+
self.event_type_counts = Counter()
|
|
122
179
|
self.current_tool = None
|
|
123
180
|
self.current_tool_input_summary = ""
|
|
124
181
|
self.current_phase = None
|
|
@@ -140,6 +197,10 @@ class ProgressTracker:
|
|
|
140
197
|
self._subagent_spawn_count = 0
|
|
141
198
|
self.codex_child_thread_ids = set()
|
|
142
199
|
self.cb_session_id = ""
|
|
200
|
+
self.result_subtype = ""
|
|
201
|
+
self.stop_reason = ""
|
|
202
|
+
self.has_usage = False
|
|
203
|
+
self.permission_denials = []
|
|
143
204
|
self.cb_cwd = ""
|
|
144
205
|
self.claude_session_id = ""
|
|
145
206
|
self.claude_cwd = ""
|
|
@@ -171,6 +232,10 @@ class ProgressTracker:
|
|
|
171
232
|
with sessionId/cwd metadata, function_call for tool invocations).
|
|
172
233
|
"""
|
|
173
234
|
event_type = event.get("type", "")
|
|
235
|
+
if event_type:
|
|
236
|
+
self.event_type_counts[str(event_type)] += 1
|
|
237
|
+
self._detect_structured_terminal_fields(event)
|
|
238
|
+
self._record_usage_and_permission_metadata(event)
|
|
174
239
|
|
|
175
240
|
# ── Codex exec --json JSONL format ──────────────────────────
|
|
176
241
|
if event_type in (
|
|
@@ -472,6 +537,8 @@ class ProgressTracker:
|
|
|
472
537
|
self._update_claude_subagent_status_counts()
|
|
473
538
|
|
|
474
539
|
elif event_type == "result":
|
|
540
|
+
self.result_subtype = str(event.get("subtype") or event.get("result_subtype") or "")
|
|
541
|
+
self.stop_reason = str(event.get("stop_reason") or "")
|
|
475
542
|
self.event_format = self.event_format or "stream-json"
|
|
476
543
|
self.is_active = False
|
|
477
544
|
result_text = event.get("result") or event.get("message") or ""
|
|
@@ -491,6 +558,7 @@ class ProgressTracker:
|
|
|
491
558
|
is_error=bool(event.get("is_error")),
|
|
492
559
|
api_error_status=event.get("api_error_status"),
|
|
493
560
|
api_error_code=str(api_error_code or ""),
|
|
561
|
+
stop_reason=str(event.get("stop_reason") or ""),
|
|
494
562
|
)
|
|
495
563
|
|
|
496
564
|
# ── Claude API raw stream format ────────────────────────────
|
|
@@ -579,6 +647,99 @@ class ProgressTracker:
|
|
|
579
647
|
# This is a sub-agent event; tool name is still tracked normally
|
|
580
648
|
pass
|
|
581
649
|
|
|
650
|
+
|
|
651
|
+
def _record_usage_and_permission_metadata(self, event):
|
|
652
|
+
"""Record additive metadata required by Python runtime parity tests."""
|
|
653
|
+
if not isinstance(event, dict):
|
|
654
|
+
return
|
|
655
|
+
if event.get("usage") not in (None, "", {}):
|
|
656
|
+
self.has_usage = True
|
|
657
|
+
denial_text = json.dumps(event, ensure_ascii=False).lower()
|
|
658
|
+
if any(
|
|
659
|
+
marker in denial_text
|
|
660
|
+
for marker in (
|
|
661
|
+
"permission denied",
|
|
662
|
+
"permission_denied",
|
|
663
|
+
"permission denial",
|
|
664
|
+
"denied by user",
|
|
665
|
+
"user denied",
|
|
666
|
+
"not permitted",
|
|
667
|
+
)
|
|
668
|
+
):
|
|
669
|
+
self.permission_denials.append(json.dumps(event, ensure_ascii=False)[:500])
|
|
670
|
+
self.permission_denials = self.permission_denials[-10:]
|
|
671
|
+
|
|
672
|
+
def _detect_structured_terminal_fields(self, event):
|
|
673
|
+
"""Detect provider-neutral terminal/context errors before format routing."""
|
|
674
|
+
if not isinstance(event, dict):
|
|
675
|
+
return
|
|
676
|
+
|
|
677
|
+
code_parts = []
|
|
678
|
+
text_parts = []
|
|
679
|
+
terminal_parts = []
|
|
680
|
+
|
|
681
|
+
for key in ("fatal_error_code", "api_error_code", "error_code", "stop_reason"):
|
|
682
|
+
value = event.get(key)
|
|
683
|
+
if isinstance(value, (str, int, float)) and str(value).strip():
|
|
684
|
+
code_parts.append(str(value))
|
|
685
|
+
|
|
686
|
+
for key in ("terminal_result_text", "message", "result"):
|
|
687
|
+
value = event.get(key)
|
|
688
|
+
if isinstance(value, (str, int, float)) and str(value).strip():
|
|
689
|
+
text_parts.append(str(value))
|
|
690
|
+
terminal_parts.append(str(value))
|
|
691
|
+
|
|
692
|
+
error_obj = event.get("error")
|
|
693
|
+
if isinstance(error_obj, dict):
|
|
694
|
+
for key in ("type", "code", "message"):
|
|
695
|
+
value = error_obj.get(key)
|
|
696
|
+
if isinstance(value, (str, int, float)) and str(value).strip():
|
|
697
|
+
text_parts.append(str(value))
|
|
698
|
+
terminal_parts.append(str(value))
|
|
699
|
+
elif isinstance(error_obj, (str, int, float)) and str(error_obj).strip():
|
|
700
|
+
text_parts.append(str(error_obj))
|
|
701
|
+
terminal_parts.append(str(error_obj))
|
|
702
|
+
|
|
703
|
+
combined_code_text = " ".join(code_parts)
|
|
704
|
+
combined_text = " ".join(code_parts + text_parts)
|
|
705
|
+
if not combined_text:
|
|
706
|
+
return
|
|
707
|
+
|
|
708
|
+
error_like = (
|
|
709
|
+
bool(code_parts)
|
|
710
|
+
or event.get("api_error_status") not in (None, "")
|
|
711
|
+
or bool(event.get("last_result_is_error"))
|
|
712
|
+
or bool(event.get("is_error"))
|
|
713
|
+
or _has_error_context(combined_text)
|
|
714
|
+
)
|
|
715
|
+
normalized_code = detect_api_error_code(
|
|
716
|
+
combined_code_text,
|
|
717
|
+
require_error_context=False,
|
|
718
|
+
structured_code=True,
|
|
719
|
+
) or detect_api_error_code(
|
|
720
|
+
combined_text,
|
|
721
|
+
require_error_context=not error_like,
|
|
722
|
+
structured_code=bool(code_parts),
|
|
723
|
+
)
|
|
724
|
+
if not normalized_code:
|
|
725
|
+
return
|
|
726
|
+
|
|
727
|
+
self.last_result_is_error = True
|
|
728
|
+
api_error_status = event.get("api_error_status") or event.get("status")
|
|
729
|
+
if api_error_status not in (None, ""):
|
|
730
|
+
try:
|
|
731
|
+
self.api_error_status = int(api_error_status)
|
|
732
|
+
except (TypeError, ValueError):
|
|
733
|
+
self.api_error_status = api_error_status
|
|
734
|
+
self.api_error_code = normalized_code
|
|
735
|
+
self.fatal_error_code = normalized_code
|
|
736
|
+
terminal_text = " ".join(terminal_parts) or combined_text
|
|
737
|
+
self.terminal_result_text = terminal_text[:1000]
|
|
738
|
+
if terminal_text.strip():
|
|
739
|
+
self.last_text_snippet = terminal_text.strip()[:120]
|
|
740
|
+
if not self.errors or self.errors[-1] != normalized_code:
|
|
741
|
+
self.errors.append(normalized_code)
|
|
742
|
+
|
|
582
743
|
def _record_cb_agent_tool_call(self, tool_name, raw_args):
|
|
583
744
|
"""Record a CodeBuddy Agent/Task* tool invocation for sub-agent tracking.
|
|
584
745
|
|
|
@@ -616,7 +777,7 @@ class ProgressTracker:
|
|
|
616
777
|
elif tool_name == "TaskCreate":
|
|
617
778
|
self._subagent_spawn_count += 1
|
|
618
779
|
|
|
619
|
-
def _record_terminal_result(self, text="", is_error=False, api_error_status=None, api_error_code=""):
|
|
780
|
+
def _record_terminal_result(self, text="", is_error=False, api_error_status=None, api_error_code="", stop_reason=""):
|
|
620
781
|
"""Record a Claude Code terminal result event."""
|
|
621
782
|
terminal_text = str(text or "")
|
|
622
783
|
self.last_result_is_error = bool(is_error)
|
|
@@ -1071,6 +1232,13 @@ class ProgressTracker:
|
|
|
1071
1232
|
return {
|
|
1072
1233
|
"updated_at": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
|
|
1073
1234
|
"event_format": self.event_format,
|
|
1235
|
+
"event_type_counts": dict(self.event_type_counts),
|
|
1236
|
+
"claude_session_id": self.claude_session_id,
|
|
1237
|
+
"result_subtype": self.result_subtype,
|
|
1238
|
+
"stop_reason": self.stop_reason,
|
|
1239
|
+
"has_usage": self.has_usage,
|
|
1240
|
+
"permission_denial_count": len(self.permission_denials),
|
|
1241
|
+
"permission_denials": self.permission_denials[-10:],
|
|
1074
1242
|
"message_count": self.message_count,
|
|
1075
1243
|
"current_tool": self.current_tool,
|
|
1076
1244
|
"current_tool_input_summary": self.current_tool_input_summary,
|
|
@@ -1127,6 +1295,7 @@ def tail_and_parse(session_log, progress_file, poll_interval=0.5):
|
|
|
1127
1295
|
def state_key(state):
|
|
1128
1296
|
return (
|
|
1129
1297
|
state["message_count"],
|
|
1298
|
+
tuple(sorted(state.get("event_type_counts", {}).items())),
|
|
1130
1299
|
state["current_tool"],
|
|
1131
1300
|
state["current_phase"],
|
|
1132
1301
|
state["total_tool_calls"],
|
|
@@ -42,6 +42,8 @@ SESSION_STATUS_VALUES = [
|
|
|
42
42
|
"crashed",
|
|
43
43
|
"timed_out",
|
|
44
44
|
"infra_error",
|
|
45
|
+
"context_overflow",
|
|
46
|
+
"stalled_context_continuation",
|
|
45
47
|
"commit_missing",
|
|
46
48
|
"docs_missing",
|
|
47
49
|
"merge_conflict",
|
|
@@ -78,6 +80,12 @@ def parse_args():
|
|
|
78
80
|
parser.add_argument("--max-retries", type=int, default=3, help="Maximum code retry count (default: 3)")
|
|
79
81
|
parser.add_argument("--max-infra-retries", type=int, default=3, help="Maximum infrastructure retry count (default: 3)")
|
|
80
82
|
parser.add_argument("--project-root", default=None, help="Project root directory. Required for 'clean' action.")
|
|
83
|
+
parser.add_argument("--active-dev-branch", default=None, help="Development branch preserved for continuation after context overflow.")
|
|
84
|
+
parser.add_argument("--base-branch", default=None, help="Original/base branch for continuation branch reuse.")
|
|
85
|
+
parser.add_argument("--last-fatal-error-code", default=None, help="Fatal runtime error code associated with continuation.")
|
|
86
|
+
parser.add_argument("--continuation-summary-path", default=None, help="Optional continuation summary artifact path.")
|
|
87
|
+
parser.add_argument("--no-progress-count", type=int, default=None, help="Consecutive context-overflow sessions without objective progress.")
|
|
88
|
+
parser.add_argument("--progress-fingerprint", default=None, help="JSON progress fingerprint captured after the session.")
|
|
81
89
|
return parser.parse_args()
|
|
82
90
|
|
|
83
91
|
|
|
@@ -164,6 +172,128 @@ def update_bug_in_list(bug_list_path, bug_id, new_status):
|
|
|
164
172
|
return write_json_file(bug_list_path, data)
|
|
165
173
|
|
|
166
174
|
|
|
175
|
+
CONTINUATION_PENDING_FIELDS = [
|
|
176
|
+
"active_dev_branch",
|
|
177
|
+
"base_branch",
|
|
178
|
+
"continuation_pending",
|
|
179
|
+
"continuation_reason",
|
|
180
|
+
"last_context_overflow_session_id",
|
|
181
|
+
"previous_session_id",
|
|
182
|
+
"last_fatal_error_code",
|
|
183
|
+
"continuation_summary_path",
|
|
184
|
+
"no_progress_count",
|
|
185
|
+
"last_progress_fingerprint",
|
|
186
|
+
"needs_attention",
|
|
187
|
+
"stalled_context_continuation",
|
|
188
|
+
"stalled_reason",
|
|
189
|
+
]
|
|
190
|
+
|
|
191
|
+
CONTINUATION_COUNTER_FIELDS = [
|
|
192
|
+
"context_overflow_count",
|
|
193
|
+
"continuation_count",
|
|
194
|
+
]
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def has_pending_continuation_metadata(status_data):
|
|
198
|
+
"""Return True when runtime state still has pending continuation metadata."""
|
|
199
|
+
return any(key in status_data for key in CONTINUATION_PENDING_FIELDS)
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def clear_pending_continuation_metadata(status_data):
|
|
203
|
+
"""Clear branch/pending continuation fields while preserving observability counters."""
|
|
204
|
+
for key in CONTINUATION_PENDING_FIELDS:
|
|
205
|
+
status_data.pop(key, None)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def reset_continuation_metadata(status_data):
|
|
209
|
+
"""Clear all continuation runtime metadata, including manual-reset counters."""
|
|
210
|
+
clear_pending_continuation_metadata(status_data)
|
|
211
|
+
for key in CONTINUATION_COUNTER_FIELDS:
|
|
212
|
+
status_data.pop(key, None)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
STALL_REASON = "context_overflow_without_git_checkpoint_or_artifact_progress"
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
def _load_progress_fingerprint(raw):
|
|
219
|
+
if not raw:
|
|
220
|
+
return None
|
|
221
|
+
try:
|
|
222
|
+
return json.loads(raw)
|
|
223
|
+
except (TypeError, ValueError):
|
|
224
|
+
return {"unparsed": str(raw)}
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
def _set_continuation_common(status_data, args, session_id):
|
|
228
|
+
if args.active_dev_branch:
|
|
229
|
+
status_data["active_dev_branch"] = args.active_dev_branch
|
|
230
|
+
if args.base_branch:
|
|
231
|
+
status_data["base_branch"] = args.base_branch
|
|
232
|
+
status_data["last_context_overflow_session_id"] = session_id
|
|
233
|
+
status_data["previous_session_id"] = session_id
|
|
234
|
+
status_data["last_fatal_error_code"] = args.last_fatal_error_code or "context_overflow"
|
|
235
|
+
if args.continuation_summary_path:
|
|
236
|
+
status_data["continuation_summary_path"] = args.continuation_summary_path
|
|
237
|
+
else:
|
|
238
|
+
status_data.pop("continuation_summary_path", None)
|
|
239
|
+
if args.no_progress_count is not None:
|
|
240
|
+
status_data["no_progress_count"] = max(0, args.no_progress_count)
|
|
241
|
+
fingerprint = _load_progress_fingerprint(args.progress_fingerprint)
|
|
242
|
+
if fingerprint is not None:
|
|
243
|
+
status_data["last_progress_fingerprint"] = fingerprint
|
|
244
|
+
status_data["last_infra_error_session_id"] = None
|
|
245
|
+
status_data["resume_from_phase"] = None
|
|
246
|
+
if session_id:
|
|
247
|
+
status_data["last_session_id"] = session_id
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
def set_context_overflow_continuation_metadata(status_data, args, session_id):
|
|
251
|
+
"""Record continuation metadata for a context-overflow outcome in status.json."""
|
|
252
|
+
status_data["context_overflow_count"] = status_data.get("context_overflow_count", 0) + 1
|
|
253
|
+
status_data["continuation_count"] = status_data.get("continuation_count", 0) + 1
|
|
254
|
+
status_data["continuation_pending"] = True
|
|
255
|
+
status_data["continuation_reason"] = "context_overflow"
|
|
256
|
+
status_data.pop("needs_attention", None)
|
|
257
|
+
status_data.pop("stalled_context_continuation", None)
|
|
258
|
+
status_data.pop("stalled_reason", None)
|
|
259
|
+
_set_continuation_common(status_data, args, session_id)
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
def set_stalled_context_continuation_metadata(status_data, args, session_id):
|
|
263
|
+
"""Record no-progress context-overflow stall without consuming retry budgets."""
|
|
264
|
+
status_data["context_overflow_count"] = status_data.get("context_overflow_count", 0) + 1
|
|
265
|
+
status_data["continuation_count"] = status_data.get("continuation_count", 0) + 1
|
|
266
|
+
_set_continuation_common(status_data, args, session_id)
|
|
267
|
+
status_data["continuation_pending"] = False
|
|
268
|
+
status_data["continuation_reason"] = STALL_REASON
|
|
269
|
+
status_data["needs_attention"] = True
|
|
270
|
+
status_data["stalled_context_continuation"] = True
|
|
271
|
+
status_data["stalled_reason"] = STALL_REASON
|
|
272
|
+
if args.no_progress_count is None or args.no_progress_count < 2:
|
|
273
|
+
status_data["no_progress_count"] = 2
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
def continuation_metadata_summary(status_data):
|
|
277
|
+
"""Return additive continuation fields for CLI JSON outputs."""
|
|
278
|
+
return {
|
|
279
|
+
"active_dev_branch": status_data.get("active_dev_branch"),
|
|
280
|
+
"base_branch": status_data.get("base_branch"),
|
|
281
|
+
"continuation_pending": status_data.get("continuation_pending", False),
|
|
282
|
+
"continuation_reason": status_data.get("continuation_reason"),
|
|
283
|
+
"last_context_overflow_session_id": status_data.get("last_context_overflow_session_id"),
|
|
284
|
+
"last_fatal_error_code": status_data.get("last_fatal_error_code"),
|
|
285
|
+
"previous_session_id": status_data.get("previous_session_id"),
|
|
286
|
+
"context_overflow_count": status_data.get("context_overflow_count", 0),
|
|
287
|
+
"continuation_count": status_data.get("continuation_count", 0),
|
|
288
|
+
"no_progress_count": status_data.get("no_progress_count", 0),
|
|
289
|
+
"last_progress_fingerprint": status_data.get("last_progress_fingerprint"),
|
|
290
|
+
"needs_attention": status_data.get("needs_attention", False),
|
|
291
|
+
"stalled_context_continuation": status_data.get("stalled_context_continuation", False),
|
|
292
|
+
"stalled_reason": status_data.get("stalled_reason"),
|
|
293
|
+
"continuation_summary_path": status_data.get("continuation_summary_path"),
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
|
|
167
297
|
# ---------------------------------------------------------------------------
|
|
168
298
|
# Action: get_next
|
|
169
299
|
# ---------------------------------------------------------------------------
|
|
@@ -244,6 +374,7 @@ def action_get_next(bug_list_data, state_dir):
|
|
|
244
374
|
"infra_error_count": chosen_status_data.get("infra_error_count", 0),
|
|
245
375
|
"resume_from_phase": chosen_status_data.get("resume_from_phase", None),
|
|
246
376
|
}
|
|
377
|
+
result.update(continuation_metadata_summary(chosen_status_data))
|
|
247
378
|
print(json.dumps(result, indent=2, ensure_ascii=False))
|
|
248
379
|
|
|
249
380
|
|
|
@@ -267,12 +398,15 @@ def action_update(args, bug_list_path, state_dir):
|
|
|
267
398
|
|
|
268
399
|
bs = load_bug_status(state_dir, bug_id)
|
|
269
400
|
|
|
401
|
+
current_list_status = get_bug_status_from_list(bug_list_path, bug_id)
|
|
402
|
+
|
|
270
403
|
# Track what status we write to bug-fix-list.json
|
|
271
|
-
new_status =
|
|
404
|
+
new_status = current_list_status
|
|
272
405
|
|
|
273
406
|
if session_status == "success":
|
|
274
407
|
bs["infra_error_count"] = 0
|
|
275
408
|
bs["last_infra_error_session_id"] = None
|
|
409
|
+
clear_pending_continuation_metadata(bs)
|
|
276
410
|
new_status = "completed"
|
|
277
411
|
bs["resume_from_phase"] = None
|
|
278
412
|
err = update_bug_in_list(bug_list_path, bug_id, "completed")
|
|
@@ -304,7 +438,7 @@ def action_update(args, bug_list_path, state_dir):
|
|
|
304
438
|
bs["infra_error_count"] = infra_error_count
|
|
305
439
|
bs["last_infra_error_session_id"] = session_id
|
|
306
440
|
bs["max_infra_retries"] = max_infra_retries
|
|
307
|
-
bs["degraded_reason"] =
|
|
441
|
+
bs["degraded_reason"] = session_status
|
|
308
442
|
if session_id:
|
|
309
443
|
bs["last_session_id"] = session_id
|
|
310
444
|
bs["resume_from_phase"] = None
|
|
@@ -316,6 +450,23 @@ def action_update(args, bug_list_path, state_dir):
|
|
|
316
450
|
else:
|
|
317
451
|
new_status = "pending"
|
|
318
452
|
|
|
453
|
+
err = update_bug_in_list(bug_list_path, bug_id, new_status)
|
|
454
|
+
if err:
|
|
455
|
+
error_out("Failed to update .prizmkit/plans/bug-fix-list.json: {}".format(err))
|
|
456
|
+
return
|
|
457
|
+
elif session_status == "context_overflow":
|
|
458
|
+
# Context overflow is continuation state, not code or infra retry state.
|
|
459
|
+
set_context_overflow_continuation_metadata(bs, args, session_id)
|
|
460
|
+
new_status = "in_progress"
|
|
461
|
+
if current_list_status != "in_progress":
|
|
462
|
+
err = update_bug_in_list(bug_list_path, bug_id, "in_progress")
|
|
463
|
+
if err:
|
|
464
|
+
error_out("Failed to update .prizmkit/plans/bug-fix-list.json: {}".format(err))
|
|
465
|
+
return
|
|
466
|
+
elif session_status == "stalled_context_continuation":
|
|
467
|
+
# No-progress context-overflow stall pauses automation without consuming retry budgets.
|
|
468
|
+
set_stalled_context_continuation_metadata(bs, args, session_id)
|
|
469
|
+
new_status = "needs_info"
|
|
319
470
|
err = update_bug_in_list(bug_list_path, bug_id, new_status)
|
|
320
471
|
if err:
|
|
321
472
|
error_out("Failed to update .prizmkit/plans/bug-fix-list.json: {}".format(err))
|
|
@@ -375,6 +526,14 @@ def action_update(args, bug_list_path, state_dir):
|
|
|
375
526
|
summary["restart_policy"] = "infra_retry"
|
|
376
527
|
summary["infra_error_count"] = bs.get("infra_error_count", 0)
|
|
377
528
|
summary["artifacts_preserved"] = True
|
|
529
|
+
elif session_status == "context_overflow":
|
|
530
|
+
summary["restart_policy"] = "context_overflow_continuation"
|
|
531
|
+
summary.update(continuation_metadata_summary(bs))
|
|
532
|
+
summary["artifacts_preserved"] = True
|
|
533
|
+
elif session_status == "stalled_context_continuation":
|
|
534
|
+
summary["restart_policy"] = "needs_attention"
|
|
535
|
+
summary.update(continuation_metadata_summary(bs))
|
|
536
|
+
summary["artifacts_preserved"] = True
|
|
378
537
|
elif session_status != "success":
|
|
379
538
|
summary["restart_policy"] = "full_restart"
|
|
380
539
|
summary["cleanup_performed"] = cleaned
|
|
@@ -445,6 +604,45 @@ def cleanup_bug_artifacts(state_dir, bug_id, project_root=None):
|
|
|
445
604
|
return cleaned
|
|
446
605
|
|
|
447
606
|
|
|
607
|
+
def _resolve_project_file(project_root, path):
|
|
608
|
+
if not path:
|
|
609
|
+
return None
|
|
610
|
+
if os.path.isabs(path):
|
|
611
|
+
target = os.path.abspath(path)
|
|
612
|
+
else:
|
|
613
|
+
target = os.path.abspath(os.path.join(project_root, path))
|
|
614
|
+
root = os.path.abspath(project_root)
|
|
615
|
+
try:
|
|
616
|
+
rel = os.path.relpath(target, root)
|
|
617
|
+
except ValueError:
|
|
618
|
+
return None
|
|
619
|
+
if rel == os.pardir or rel.startswith(os.pardir + os.sep):
|
|
620
|
+
return None
|
|
621
|
+
return target
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
def cleanup_continuation_artifacts(project_root, status_data, candidate_paths=None):
|
|
625
|
+
"""Delete durable continuation handoff files for a manual clean reset."""
|
|
626
|
+
candidates = []
|
|
627
|
+
if isinstance(status_data, dict):
|
|
628
|
+
candidates.append(status_data.get("continuation_summary_path"))
|
|
629
|
+
candidates.extend(candidate_paths or [])
|
|
630
|
+
|
|
631
|
+
cleaned = []
|
|
632
|
+
seen = set()
|
|
633
|
+
for candidate in candidates:
|
|
634
|
+
target = _resolve_project_file(project_root, candidate)
|
|
635
|
+
if not target or target in seen:
|
|
636
|
+
continue
|
|
637
|
+
seen.add(target)
|
|
638
|
+
if os.path.basename(target) != "continuation-summary.md":
|
|
639
|
+
continue
|
|
640
|
+
if os.path.isfile(target):
|
|
641
|
+
os.remove(target)
|
|
642
|
+
cleaned.append("Deleted continuation artifact {}".format(target))
|
|
643
|
+
return cleaned
|
|
644
|
+
|
|
645
|
+
|
|
448
646
|
def load_session_status(state_dir, bug_id, session_id):
|
|
449
647
|
session_status_path = os.path.join(state_dir, bug_id, "sessions",
|
|
450
648
|
session_id, "session-status.json"
|
|
@@ -608,6 +806,7 @@ def action_reset(args, bug_list_path, state_dir):
|
|
|
608
806
|
bs["sessions"] = []
|
|
609
807
|
bs["last_session_id"] = None
|
|
610
808
|
bs["resume_from_phase"] = None
|
|
809
|
+
reset_continuation_metadata(bs)
|
|
611
810
|
bs["updated_at"] = now_iso()
|
|
612
811
|
|
|
613
812
|
err = save_bug_status(state_dir, bug_id, bs)
|
|
@@ -679,12 +878,19 @@ def action_clean(args, bug_list_path, state_dir):
|
|
|
679
878
|
old_status = get_bug_status_from_list(bug_list_path, bug_id)
|
|
680
879
|
old_retry = bs.get("retry_count", 0)
|
|
681
880
|
|
|
881
|
+
continuation_candidates = [
|
|
882
|
+
os.path.join(".prizmkit", "bugfix", bug_id, "continuation-summary.md"),
|
|
883
|
+
os.path.join(".prizmkit", "specs", bug_id, "continuation-summary.md"),
|
|
884
|
+
]
|
|
885
|
+
cleaned.extend(cleanup_continuation_artifacts(project_root, bs, continuation_candidates))
|
|
886
|
+
|
|
682
887
|
bs["retry_count"] = 0
|
|
683
888
|
bs["infra_error_count"] = 0
|
|
684
889
|
bs["last_infra_error_session_id"] = None
|
|
685
890
|
bs["sessions"] = []
|
|
686
891
|
bs["last_session_id"] = None
|
|
687
892
|
bs["resume_from_phase"] = None
|
|
893
|
+
reset_continuation_metadata(bs)
|
|
688
894
|
bs["updated_at"] = now_iso()
|
|
689
895
|
|
|
690
896
|
err = save_bug_status(state_dir, bug_id, bs)
|
|
@@ -760,10 +966,11 @@ def action_start(args, bug_list_path, state_dir):
|
|
|
760
966
|
error_out("Failed to save bug status: {}".format(err))
|
|
761
967
|
return
|
|
762
968
|
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
969
|
+
if old_status != "in_progress":
|
|
970
|
+
err = update_bug_in_list(bug_list_path, bug_id, "in_progress")
|
|
971
|
+
if err:
|
|
972
|
+
error_out("Failed to update .prizmkit/plans/bug-fix-list.json: {}".format(err))
|
|
973
|
+
return
|
|
767
974
|
|
|
768
975
|
result = {
|
|
769
976
|
"action": "start",
|
|
@@ -853,6 +1060,7 @@ def action_unskip(args, bug_list_path, state_dir):
|
|
|
853
1060
|
bs["sessions"] = []
|
|
854
1061
|
bs["last_session_id"] = None
|
|
855
1062
|
bs["resume_from_phase"] = None
|
|
1063
|
+
reset_continuation_metadata(bs)
|
|
856
1064
|
bs["updated_at"] = now_iso()
|
|
857
1065
|
save_bug_status(state_dir, bid, bs)
|
|
858
1066
|
|