@urielsh/prodify 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prodify/AGENTS.md +56 -0
- package/.prodify/README.md +10 -0
- package/.prodify/artifacts/01-understand.md +28 -0
- package/.prodify/artifacts/02-diagnose.md +26 -0
- package/.prodify/artifacts/03-architecture.md +30 -0
- package/.prodify/artifacts/04-plan.md +35 -0
- package/.prodify/artifacts/05-refactor.md +24 -0
- package/.prodify/artifacts/06-validate.md +17 -0
- package/.prodify/artifacts/README.md +6 -0
- package/.prodify/artifacts/architecture_spec.md +29 -0
- package/.prodify/artifacts/artifact-validation-design.md +276 -0
- package/.prodify/artifacts/cli-command-design.md +299 -0
- package/.prodify/artifacts/completed-steps-tracking.md +201 -0
- package/.prodify/artifacts/diagnostic_report.md +45 -0
- package/.prodify/artifacts/hardening-patch-summary.md +57 -0
- package/.prodify/artifacts/hardening-verification-report.md +48 -0
- package/.prodify/artifacts/implementation_summary.md +19 -0
- package/.prodify/artifacts/improvement-evaluation-spec.md +148 -0
- package/.prodify/artifacts/next-step-resolver-design.md +570 -0
- package/.prodify/artifacts/orientation_map.md +32 -0
- package/.prodify/artifacts/persona-removal-audit.md +106 -0
- package/.prodify/artifacts/planning-alignment-report.md +189 -0
- package/.prodify/artifacts/refactor-plan-template-hardening.md +83 -0
- package/.prodify/artifacts/refactor-validate-loop-design.md +231 -0
- package/.prodify/artifacts/refactor_plan.md +21 -0
- package/.prodify/artifacts/refactor_plan.strict-example.md +31 -0
- package/.prodify/artifacts/run-state-design.md +292 -0
- package/.prodify/artifacts/run-summary-spec.md +149 -0
- package/.prodify/artifacts/run_state.json +14 -0
- package/.prodify/artifacts/sample-repo-test-plan.md +129 -0
- package/.prodify/artifacts/status-output-spec.md +349 -0
- package/.prodify/artifacts/step-selection-design.md +251 -0
- package/.prodify/artifacts/task-dispatcher-design.md +266 -0
- package/.prodify/artifacts/task-header-audit.md +42 -0
- package/.prodify/artifacts/task-log-enhancement-spec.md +264 -0
- package/.prodify/artifacts/task-protocol-hardening-plan.md +68 -0
- package/.prodify/artifacts/task-self-validation-spec.md +171 -0
- package/.prodify/artifacts/task_log.json +160 -0
- package/.prodify/artifacts/template-usage-audit.md +20 -0
- package/.prodify/artifacts/validation_report.md +22 -0
- package/.prodify/contracts/README.md +3 -0
- package/.prodify/contracts/architecture.contract.json +42 -0
- package/.prodify/contracts/diagnose.contract.json +42 -0
- package/.prodify/contracts/plan.contract.json +42 -0
- package/.prodify/contracts/refactor.contract.json +45 -0
- package/.prodify/contracts/understand.contract.json +42 -0
- package/.prodify/contracts/validate.contract.json +52 -0
- package/.prodify/contracts-src/README.md +4 -0
- package/.prodify/contracts-src/architecture.contract.md +29 -0
- package/.prodify/contracts-src/diagnose.contract.md +29 -0
- package/.prodify/contracts-src/plan.contract.md +29 -0
- package/.prodify/contracts-src/refactor.contract.md +32 -0
- package/.prodify/contracts-src/understand.contract.md +29 -0
- package/.prodify/contracts-src/validate.contract.md +35 -0
- package/.prodify/metrics/README.md +4 -0
- package/.prodify/planning.md +13 -0
- package/.prodify/project.md +15 -0
- package/.prodify/rules/01-global-operating-rules.md +21 -0
- package/.prodify/rules/02-analysis-discipline.md +17 -0
- package/.prodify/rules/03-diagnosis-severity-rules.md +42 -0
- package/.prodify/rules/04-architecture-rules.md +27 -0
- package/.prodify/rules/05-planning-rules.md +23 -0
- package/.prodify/rules/06-refactor-rules.md +20 -0
- package/.prodify/rules/07-validation-rules.md +25 -0
- package/.prodify/rules/08-output-format-rules.md +20 -0
- package/.prodify/rules/09-template-usage-rules.md +11 -0
- package/.prodify/rules/10-artifact-flow-and-orchestration-rules.md +40 -0
- package/.prodify/rules/README.md +3 -0
- package/.prodify/rules/example-rule.md +4 -0
- package/.prodify/runtime-commands.md +57 -0
- package/.prodify/skills/README.md +8 -0
- package/.prodify/skills/domain/react-frontend.skill.json +34 -0
- package/.prodify/skills/domain/typescript-backend.skill.json +34 -0
- package/.prodify/skills/quality-policy/maintainability-review.skill.json +25 -0
- package/.prodify/skills/quality-policy/security-hardening.skill.json +32 -0
- package/.prodify/skills/quality-policy/test-hardening.skill.json +23 -0
- package/.prodify/skills/registry.json +16 -0
- package/.prodify/skills/stage-method/architecture-method.skill.json +22 -0
- package/.prodify/skills/stage-method/codebase-scanning.skill.json +22 -0
- package/.prodify/skills/stage-method/diagnosis-method.skill.json +22 -0
- package/.prodify/skills/stage-method/planning-method.skill.json +22 -0
- package/.prodify/skills/stage-method/refactoring-method.skill.json +22 -0
- package/.prodify/skills/stage-method/validation-method.skill.json +22 -0
- package/.prodify/state.json +30 -0
- package/.prodify/tasks/01-understand.md +83 -0
- package/.prodify/tasks/02-diagnose.md +67 -0
- package/.prodify/tasks/03-architecture.md +70 -0
- package/.prodify/tasks/04-plan.md +71 -0
- package/.prodify/tasks/05-refactor.md +61 -0
- package/.prodify/tasks/06-validate.md +69 -0
- package/.prodify/tasks/README.md +3 -0
- package/.prodify/tasks/example-task.md +13 -0
- package/.prodify/templates/01-understand.template.md +18 -0
- package/.prodify/templates/02-diagnose.template.md +18 -0
- package/.prodify/templates/03-architecture.template.md +18 -0
- package/.prodify/templates/04-plan.template.md +22 -0
- package/.prodify/templates/05-refactor.template.md +19 -0
- package/.prodify/templates/06-validate.template.md +16 -0
- package/.prodify/templates/README.md +3 -0
- package/.prodify/templates/architecture_spec.template.md +29 -0
- package/.prodify/templates/diagnostic_report.template.md +45 -0
- package/.prodify/templates/example.template.md +5 -0
- package/.prodify/templates/implementation_summary.template.md +19 -0
- package/.prodify/templates/orientation_map.template.md +32 -0
- package/.prodify/templates/refactor_plan.template.md +24 -0
- package/.prodify/templates/validation_report.template.md +22 -0
- package/.prodify/version.json +5 -0
- package/AGENTS.md +305 -0
- package/LICENSE +201 -0
- package/README.md +118 -0
- package/assets/presets/default/canonical/AGENTS.md +54 -0
- package/assets/presets/default/canonical/artifacts/README.md +6 -0
- package/assets/presets/default/canonical/contracts-src/README.md +4 -0
- package/assets/presets/default/canonical/contracts-src/architecture.contract.md +56 -0
- package/assets/presets/default/canonical/contracts-src/diagnose.contract.md +49 -0
- package/assets/presets/default/canonical/contracts-src/plan.contract.md +42 -0
- package/assets/presets/default/canonical/contracts-src/refactor.contract.md +54 -0
- package/assets/presets/default/canonical/contracts-src/understand.contract.md +56 -0
- package/assets/presets/default/canonical/contracts-src/validate.contract.md +64 -0
- package/assets/presets/default/canonical/metrics/README.md +4 -0
- package/assets/presets/default/canonical/planning.md +13 -0
- package/assets/presets/default/canonical/project.md +15 -0
- package/assets/presets/default/canonical/rules/README.md +3 -0
- package/assets/presets/default/canonical/rules/example-rule.md +4 -0
- package/assets/presets/default/canonical/runtime-commands.md +57 -0
- package/assets/presets/default/canonical/skills/README.md +8 -0
- package/assets/presets/default/canonical/skills/domain/react-frontend.skill.json +34 -0
- package/assets/presets/default/canonical/skills/domain/typescript-backend.skill.json +34 -0
- package/assets/presets/default/canonical/skills/quality-policy/maintainability-review.skill.json +25 -0
- package/assets/presets/default/canonical/skills/quality-policy/security-hardening.skill.json +32 -0
- package/assets/presets/default/canonical/skills/quality-policy/test-hardening.skill.json +23 -0
- package/assets/presets/default/canonical/skills/registry.json +16 -0
- package/assets/presets/default/canonical/skills/stage-method/architecture-method.skill.json +22 -0
- package/assets/presets/default/canonical/skills/stage-method/codebase-scanning.skill.json +22 -0
- package/assets/presets/default/canonical/skills/stage-method/diagnosis-method.skill.json +22 -0
- package/assets/presets/default/canonical/skills/stage-method/planning-method.skill.json +22 -0
- package/assets/presets/default/canonical/skills/stage-method/refactoring-method.skill.json +22 -0
- package/assets/presets/default/canonical/skills/stage-method/validation-method.skill.json +22 -0
- package/assets/presets/default/canonical/state.json +30 -0
- package/assets/presets/default/canonical/tasks/README.md +3 -0
- package/assets/presets/default/canonical/tasks/example-task.md +13 -0
- package/assets/presets/default/canonical/templates/README.md +3 -0
- package/assets/presets/default/canonical/templates/example.template.md +5 -0
- package/assets/presets/default/preset.json +5 -0
- package/dist/cli.js +53 -0
- package/dist/commands/doctor.js +16 -0
- package/dist/commands/init.js +30 -0
- package/dist/commands/install.js +27 -0
- package/dist/commands/setup-agent.js +23 -0
- package/dist/commands/status.js +28 -0
- package/dist/commands/sync.js +29 -0
- package/dist/commands/update.js +18 -0
- package/dist/contracts/compiled-schema.js +37 -0
- package/dist/contracts/compiler.js +83 -0
- package/dist/contracts/freshness.js +52 -0
- package/dist/contracts/index.js +5 -0
- package/dist/contracts/parser.js +201 -0
- package/dist/contracts/schema.js +138 -0
- package/dist/contracts/source-schema.js +111 -0
- package/dist/core/agent-runtime.js +36 -0
- package/dist/core/agent-setup.js +111 -0
- package/dist/core/doctor.js +155 -0
- package/dist/core/errors.js +19 -0
- package/dist/core/flow-state.js +262 -0
- package/dist/core/fs.js +50 -0
- package/dist/core/install.js +44 -0
- package/dist/core/managed-files.js +106 -0
- package/dist/core/paths.js +56 -0
- package/dist/core/preset-validation.js +43 -0
- package/dist/core/prompt-builder.js +63 -0
- package/dist/core/repo-context.js +77 -0
- package/dist/core/repo-root.js +55 -0
- package/dist/core/skill-resolution.js +123 -0
- package/dist/core/state.js +220 -0
- package/dist/core/status.js +293 -0
- package/dist/core/sync.js +63 -0
- package/dist/core/targets.js +48 -0
- package/dist/core/upgrade.js +57 -0
- package/dist/core/validation.js +138 -0
- package/dist/core/version-checks.js +35 -0
- package/dist/generators/claude.js +14 -0
- package/dist/generators/codex.js +14 -0
- package/dist/generators/copilot.js +29 -0
- package/dist/generators/header.js +13 -0
- package/dist/generators/opencode.js +14 -0
- package/dist/generators/shared.js +37 -0
- package/dist/index.js +9 -0
- package/dist/legacy/targets.js +55 -0
- package/dist/presets/default.js +3 -0
- package/dist/presets/loader.js +34 -0
- package/dist/presets/version.js +18 -0
- package/dist/scoring/model.js +262 -0
- package/dist/skills/loader.js +40 -0
- package/dist/skills/schema.js +159 -0
- package/dist/types.js +1 -0
- package/docs/canonical-prodify-layout.md +87 -0
- package/docs/claude-support.md +22 -0
- package/docs/cli-doctor-spec.md +52 -0
- package/docs/cli-init-spec.md +70 -0
- package/docs/cli-install-agent-spec.md +48 -0
- package/docs/cli-sync-spec.md +40 -0
- package/docs/codex-support.md +24 -0
- package/docs/compatibility-targets.md +59 -0
- package/docs/copilot-support.md +30 -0
- package/docs/default-preset.md +47 -0
- package/docs/generated-file-headers.md +45 -0
- package/docs/generation-rules.md +94 -0
- package/docs/idempotency-guarantees.md +31 -0
- package/docs/managed-file-detection.md +45 -0
- package/docs/manual-edit-conflicts.md +37 -0
- package/docs/opencode-support.md +27 -0
- package/docs/ownership-rules.md +39 -0
- package/docs/path-resolution-rules.md +40 -0
- package/docs/preset-structure.md +49 -0
- package/docs/skill-system.md +67 -0
- package/docs/versioning-and-upgrade-strategy.md +40 -0
- package/package.json +22 -0
- package/src/README.md +11 -0
- package/src/cli.ts +61 -0
- package/src/commands/doctor.ts +20 -0
- package/src/commands/init.ts +37 -0
- package/src/commands/setup-agent.ts +28 -0
- package/src/commands/status.ts +34 -0
- package/src/commands/update.ts +23 -0
- package/src/contracts/README.md +10 -0
- package/src/contracts/compiled-schema.ts +42 -0
- package/src/contracts/compiler.ts +111 -0
- package/src/contracts/freshness.ts +58 -0
- package/src/contracts/index.ts +11 -0
- package/src/contracts/parser.ts +253 -0
- package/src/contracts/source-schema.ts +141 -0
- package/src/core/agent-runtime.ts +53 -0
- package/src/core/agent-setup.ts +147 -0
- package/src/core/doctor.ts +171 -0
- package/src/core/errors.ts +28 -0
- package/src/core/flow-state.ts +333 -0
- package/src/core/fs.ts +59 -0
- package/src/core/paths.ts +63 -0
- package/src/core/preset-validation.ts +47 -0
- package/src/core/prompt-builder.ts +73 -0
- package/src/core/repo-context.ts +93 -0
- package/src/core/repo-root.ts +74 -0
- package/src/core/skill-resolution.ts +151 -0
- package/src/core/state.ts +264 -0
- package/src/core/status.ts +372 -0
- package/src/core/targets.ts +53 -0
- package/src/core/upgrade.ts +66 -0
- package/src/core/validation.ts +233 -0
- package/src/core/version-checks.ts +40 -0
- package/src/index.ts +13 -0
- package/src/presets/default.ts +7 -0
- package/src/presets/loader.ts +46 -0
- package/src/presets/version.ts +31 -0
- package/src/scoring/model.ts +332 -0
- package/src/skills/loader.ts +58 -0
- package/src/skills/schema.ts +197 -0
- package/src/types.ts +329 -0
- package/tests/integration/cli-flows.test.js +347 -0
- package/tests/unit/agent-setup.test.js +81 -0
- package/tests/unit/cli.test.js +28 -0
- package/tests/unit/contracts.test.js +61 -0
- package/tests/unit/helpers.js +28 -0
- package/tests/unit/paths.test.js +52 -0
- package/tests/unit/preset-loader.test.js +37 -0
- package/tests/unit/scoring.test.js +65 -0
- package/tests/unit/self-hosted-workspace.test.js +22 -0
- package/tests/unit/skills.test.js +115 -0
- package/tests/unit/state-and-flow.test.js +120 -0
- package/tests/unit/targets.test.js +13 -0
- package/tests/unit/validation.test.js +73 -0
- package/tests/unit/version.test.js +24 -0
- package/tsconfig.json +23 -0
- package/urielsh-prodify-0.1.0.tgz +0 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
# Run State Design
|
|
2
|
+
|
|
3
|
+
Date: 2026-03-28
|
|
4
|
+
Scope: `./.prodify/artifacts/run_state.json`
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
Define a deterministic workflow state model for the Prodify task pipeline.
|
|
8
|
+
|
|
9
|
+
The run state is the single control-plane record for workflow progress. It must be sufficient to:
|
|
10
|
+
- determine which task may run next
|
|
11
|
+
- determine whether execution may resume
|
|
12
|
+
- support the `05-refactor -> 06-validate` loop
|
|
13
|
+
- stop advancement when validation or ordering rules fail
|
|
14
|
+
|
|
15
|
+
The mandatory task pipeline is:
|
|
16
|
+
`01-understand -> 02-diagnose -> 03-architecture -> 04-plan -> 05-refactor -> 06-validate`
|
|
17
|
+
|
|
18
|
+
## State Schema
|
|
19
|
+
|
|
20
|
+
### Required Fields
|
|
21
|
+
- `current_task`
|
|
22
|
+
- Type: string or null
|
|
23
|
+
- Meaning: the task currently being executed, or the task that must be resumed if execution stopped mid-task
|
|
24
|
+
- `last_completed_task`
|
|
25
|
+
- Type: string or null
|
|
26
|
+
- Meaning: the most recent task that completed successfully and whose output artifact passed validation
|
|
27
|
+
- `next_task`
|
|
28
|
+
- Type: string or null
|
|
29
|
+
- Meaning: the only task allowed to start next if execution is not currently mid-task
|
|
30
|
+
- `selected_refactor_step`
|
|
31
|
+
- Type: string or null
|
|
32
|
+
- Meaning: the single refactor-plan step currently selected for Task 05 or the step most recently validated by Task 06
|
|
33
|
+
- `completed_step_ids`
|
|
34
|
+
- Type: array of strings
|
|
35
|
+
- Meaning: refactor-plan step IDs that have successfully completed Task 05 and passed Task 06 validation
|
|
36
|
+
- `status`
|
|
37
|
+
- Type: string
|
|
38
|
+
- Allowed values:
|
|
39
|
+
- `ready`
|
|
40
|
+
- `running`
|
|
41
|
+
- `awaiting_validation`
|
|
42
|
+
- `blocked`
|
|
43
|
+
- `failed`
|
|
44
|
+
- `complete`
|
|
45
|
+
- Meaning:
|
|
46
|
+
- `ready`: the state is valid and the `next_task` may begin
|
|
47
|
+
- `running`: `current_task` is in progress and must be resumed or explicitly failed
|
|
48
|
+
- `awaiting_validation`: Task 05 completed and Task 06 must run next for the selected step
|
|
49
|
+
- `blocked`: execution cannot continue until missing inputs, stale artifacts, or operator intervention is resolved
|
|
50
|
+
- `failed`: the current task or validation failed and execution must not advance
|
|
51
|
+
- `complete`: the workflow has reached a terminal successful stop condition
|
|
52
|
+
|
|
53
|
+
### Supporting Fields
|
|
54
|
+
- `artifacts_dir`
|
|
55
|
+
- Type: string
|
|
56
|
+
- Meaning: relative path to the artifact root
|
|
57
|
+
- Required value: `.prodify/artifacts`
|
|
58
|
+
- `notes`
|
|
59
|
+
- Type: array of strings
|
|
60
|
+
- Meaning: concise state-local operator notes, failure reasons, or resume hints
|
|
61
|
+
- Constraint: high-signal only; not a narrative log
|
|
62
|
+
|
|
63
|
+
## State Invariants
|
|
64
|
+
- Only one task may be active at a time.
|
|
65
|
+
- `last_completed_task` may advance only after the task's primary artifact exists and passes template validation.
|
|
66
|
+
- `next_task` must match the task pipeline unless the workflow is in the `05`/`06` loop.
|
|
67
|
+
- `selected_refactor_step` must be non-null only when:
|
|
68
|
+
- Task 05 is running
|
|
69
|
+
- Task 06 is validating the most recent Task 05 step
|
|
70
|
+
- a failed or blocked `05`/`06` cycle must be resumed
|
|
71
|
+
- `completed_step_ids` must contain only step IDs from `refactor_plan.md`.
|
|
72
|
+
- A step ID may be appended to `completed_step_ids` only after Task 06 passes for that step.
|
|
73
|
+
- `status: complete` requires `current_task: null` and `next_task: null`.
|
|
74
|
+
- `status: awaiting_validation` requires `next_task: "06-validate"` and a non-null `selected_refactor_step`.
|
|
75
|
+
|
|
76
|
+
## Update Transitions
|
|
77
|
+
|
|
78
|
+
### Initial State
|
|
79
|
+
Use this when no task has completed yet:
|
|
80
|
+
- `current_task: null`
|
|
81
|
+
- `last_completed_task: null`
|
|
82
|
+
- `next_task: "01-understand"`
|
|
83
|
+
- `selected_refactor_step: null`
|
|
84
|
+
- `completed_step_ids: []`
|
|
85
|
+
- `status: "ready"`
|
|
86
|
+
- `artifacts_dir: ".prodify/artifacts"`
|
|
87
|
+
- `notes: []`
|
|
88
|
+
|
|
89
|
+
### Task Start Rule
|
|
90
|
+
When a task begins:
|
|
91
|
+
- verify `next_task` matches the requested task
|
|
92
|
+
- set `current_task` to that task ID
|
|
93
|
+
- keep `next_task` unchanged until the task succeeds or fails
|
|
94
|
+
- set `status` to `running`
|
|
95
|
+
|
|
96
|
+
### Successful Completion Rules For Tasks 01 Through 04
|
|
97
|
+
After the task artifact is validated:
|
|
98
|
+
- set `last_completed_task` to the just-finished task
|
|
99
|
+
- set `current_task` to `null`
|
|
100
|
+
- set `next_task` to the declared `next_task` from the task frontmatter
|
|
101
|
+
- leave `selected_refactor_step` unchanged unless Task 04 explicitly selected an initial step
|
|
102
|
+
- leave `completed_step_ids` unchanged
|
|
103
|
+
- set `status` to `ready`
|
|
104
|
+
- clear transient failure notes from `notes`
|
|
105
|
+
|
|
106
|
+
### Task 04 Special Rule
|
|
107
|
+
Task 04 may optionally preselect the first refactor step:
|
|
108
|
+
- if a step is selected from `refactor_plan.md`, write it to `selected_refactor_step`
|
|
109
|
+
- if no step is selected yet, keep `selected_refactor_step: null`
|
|
110
|
+
- `next_task` still becomes `05-refactor`
|
|
111
|
+
|
|
112
|
+
### Successful Completion Rule For Task 05
|
|
113
|
+
After `implementation_summary.md` is validated:
|
|
114
|
+
- set `last_completed_task` to `"05-refactor"`
|
|
115
|
+
- set `current_task` to `null`
|
|
116
|
+
- set `next_task` to `"06-validate"`
|
|
117
|
+
- keep `selected_refactor_step` set to the step just implemented
|
|
118
|
+
- do not update `completed_step_ids` yet
|
|
119
|
+
- set `status` to `awaiting_validation`
|
|
120
|
+
|
|
121
|
+
### Successful Completion Rule For Task 06 - PASS
|
|
122
|
+
If validation passes for the selected step:
|
|
123
|
+
- set `last_completed_task` to `"06-validate"`
|
|
124
|
+
- set `current_task` to `null`
|
|
125
|
+
- append `selected_refactor_step` to `completed_step_ids` if not already present
|
|
126
|
+
- if more refactor steps remain:
|
|
127
|
+
- set `next_task` to `"05-refactor"`
|
|
128
|
+
- set `selected_refactor_step` to the next uncompleted step or `null` until explicitly chosen
|
|
129
|
+
- set `status` to `ready`
|
|
130
|
+
- if no refactor steps remain or requested scope is complete:
|
|
131
|
+
- set `next_task` to `null`
|
|
132
|
+
- set `status` to `complete`
|
|
133
|
+
|
|
134
|
+
### Successful Completion Rule For Task 06 - FAIL
|
|
135
|
+
If validation fails and more refactor steps remain:
|
|
136
|
+
- set `last_completed_task` to `"05-refactor"`
|
|
137
|
+
- set `current_task` to `null`
|
|
138
|
+
- keep `selected_refactor_step` set to the failed step until a retry or replacement step is chosen
|
|
139
|
+
- keep `completed_step_ids` unchanged
|
|
140
|
+
- set `next_task` to `"05-refactor"`
|
|
141
|
+
- set `status` to `failed`
|
|
142
|
+
- add a short failure reason to `notes`
|
|
143
|
+
|
|
144
|
+
If validation fails and no steps remain:
|
|
145
|
+
- set `next_task` to `null`
|
|
146
|
+
- set `status` to `failed`
|
|
147
|
+
- keep `selected_refactor_step` set to the failed step
|
|
148
|
+
|
|
149
|
+
### Blocked State Rule
|
|
150
|
+
Use `blocked` when execution cannot start or continue because:
|
|
151
|
+
- a declared input artifact is missing
|
|
152
|
+
- a required template is missing
|
|
153
|
+
- the selected step cannot be resolved from `refactor_plan.md`
|
|
154
|
+
- task ordering is inconsistent with the current state
|
|
155
|
+
|
|
156
|
+
When blocked:
|
|
157
|
+
- keep `current_task` set only if execution was already in progress
|
|
158
|
+
- keep `next_task` unchanged
|
|
159
|
+
- add a precise blocker note to `notes`
|
|
160
|
+
|
|
161
|
+
### Failure Recovery Rule
|
|
162
|
+
To recover from `failed`:
|
|
163
|
+
- fix the artifact, task instruction, or selected step problem
|
|
164
|
+
- update `notes` with the recovery reason or clear stale failure notes
|
|
165
|
+
- set:
|
|
166
|
+
- `next_task` to the required retry task
|
|
167
|
+
- `current_task` to `null`
|
|
168
|
+
- `status` to `ready`
|
|
169
|
+
|
|
170
|
+
## Resume Logic
|
|
171
|
+
|
|
172
|
+
### Resume Decision Table
|
|
173
|
+
- If `status` is `ready`:
|
|
174
|
+
- start `next_task`
|
|
175
|
+
- If `status` is `running`:
|
|
176
|
+
- resume `current_task`
|
|
177
|
+
- do not advance to another task
|
|
178
|
+
- If `status` is `awaiting_validation`:
|
|
179
|
+
- run `06-validate`
|
|
180
|
+
- If `status` is `blocked`:
|
|
181
|
+
- inspect `notes`
|
|
182
|
+
- resolve the blocker
|
|
183
|
+
- re-run pre-run checks for `next_task` or `current_task`
|
|
184
|
+
- If `status` is `failed`:
|
|
185
|
+
- inspect `notes`
|
|
186
|
+
- retry the required task only after correcting the failure condition
|
|
187
|
+
- If `status` is `complete`:
|
|
188
|
+
- stop; no next task exists
|
|
189
|
+
|
|
190
|
+
### Resume Safety Rules
|
|
191
|
+
- Never infer the next task from memory; trust `run_state.json`.
|
|
192
|
+
- Before resuming any task, re-verify the declared input artifacts.
|
|
193
|
+
- Before resuming Task 05 or Task 06, re-verify that `selected_refactor_step` exists in `refactor_plan.md`.
|
|
194
|
+
- If `last_completed_task` and `next_task` contradict the pipeline, set `status` to `blocked` and stop.
|
|
195
|
+
- If `completed_step_ids` contains a step not found in `refactor_plan.md`, set `status` to `failed` and stop.
|
|
196
|
+
|
|
197
|
+
## Examples
|
|
198
|
+
|
|
199
|
+
### Example 1 - Fresh Start
|
|
200
|
+
```json
|
|
201
|
+
{
|
|
202
|
+
"current_task": null,
|
|
203
|
+
"last_completed_task": null,
|
|
204
|
+
"next_task": "01-understand",
|
|
205
|
+
"selected_refactor_step": null,
|
|
206
|
+
"completed_step_ids": [],
|
|
207
|
+
"status": "ready",
|
|
208
|
+
"artifacts_dir": ".prodify/artifacts",
|
|
209
|
+
"notes": []
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Example 2 - Mid-Pipeline After Task 03
|
|
214
|
+
```json
|
|
215
|
+
{
|
|
216
|
+
"current_task": null,
|
|
217
|
+
"last_completed_task": "03-architecture",
|
|
218
|
+
"next_task": "04-plan",
|
|
219
|
+
"selected_refactor_step": null,
|
|
220
|
+
"completed_step_ids": [],
|
|
221
|
+
"status": "ready",
|
|
222
|
+
"artifacts_dir": ".prodify/artifacts",
|
|
223
|
+
"notes": []
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Example 3 - Task 05 Completed, Validation Required
|
|
228
|
+
```json
|
|
229
|
+
{
|
|
230
|
+
"current_task": null,
|
|
231
|
+
"last_completed_task": "05-refactor",
|
|
232
|
+
"next_task": "06-validate",
|
|
233
|
+
"selected_refactor_step": "step-03-extract-service",
|
|
234
|
+
"completed_step_ids": [
|
|
235
|
+
"step-01-rename-module",
|
|
236
|
+
"step-02-add-guard-clause"
|
|
237
|
+
],
|
|
238
|
+
"status": "awaiting_validation",
|
|
239
|
+
"artifacts_dir": ".prodify/artifacts",
|
|
240
|
+
"notes": []
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Example 4 - Validation Failed, Loop Back To Task 05
|
|
245
|
+
```json
|
|
246
|
+
{
|
|
247
|
+
"current_task": null,
|
|
248
|
+
"last_completed_task": "05-refactor",
|
|
249
|
+
"next_task": "05-refactor",
|
|
250
|
+
"selected_refactor_step": "step-03-extract-service",
|
|
251
|
+
"completed_step_ids": [
|
|
252
|
+
"step-01-rename-module",
|
|
253
|
+
"step-02-add-guard-clause"
|
|
254
|
+
],
|
|
255
|
+
"status": "failed",
|
|
256
|
+
"artifacts_dir": ".prodify/artifacts",
|
|
257
|
+
"notes": [
|
|
258
|
+
"Task 06 reported a regression for step-03-extract-service; retry Task 05 after correcting the step."
|
|
259
|
+
]
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Example 5 - Workflow Complete
|
|
264
|
+
```json
|
|
265
|
+
{
|
|
266
|
+
"current_task": null,
|
|
267
|
+
"last_completed_task": "06-validate",
|
|
268
|
+
"next_task": null,
|
|
269
|
+
"selected_refactor_step": null,
|
|
270
|
+
"completed_step_ids": [
|
|
271
|
+
"step-01-rename-module",
|
|
272
|
+
"step-02-add-guard-clause",
|
|
273
|
+
"step-03-extract-service"
|
|
274
|
+
],
|
|
275
|
+
"status": "complete",
|
|
276
|
+
"artifacts_dir": ".prodify/artifacts",
|
|
277
|
+
"notes": []
|
|
278
|
+
}
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## Recommended Write Discipline
|
|
282
|
+
- Rewrite the full JSON object on every state change.
|
|
283
|
+
- Preserve key order for readability:
|
|
284
|
+
1. `current_task`
|
|
285
|
+
2. `last_completed_task`
|
|
286
|
+
3. `next_task`
|
|
287
|
+
4. `selected_refactor_step`
|
|
288
|
+
5. `completed_step_ids`
|
|
289
|
+
6. `status`
|
|
290
|
+
7. `artifacts_dir`
|
|
291
|
+
8. `notes`
|
|
292
|
+
- Keep values explicit; prefer `null` over omitted fields.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Run Summary Spec
|
|
2
|
+
|
|
3
|
+
Date: 2026-03-29
|
|
4
|
+
Scope: `./.prodify/`
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
|
|
8
|
+
Define the short human-readable summary emitted after each Prodify run cycle.
|
|
9
|
+
|
|
10
|
+
The run summary should:
|
|
11
|
+
|
|
12
|
+
- describe what just happened
|
|
13
|
+
- stay shorter than the full status view
|
|
14
|
+
- be understandable without opening `task_log.json`
|
|
15
|
+
|
|
16
|
+
## Required Sections
|
|
17
|
+
|
|
18
|
+
The run summary must include these sections in this order:
|
|
19
|
+
|
|
20
|
+
1. `Task executed`
|
|
21
|
+
2. `Result`
|
|
22
|
+
3. `Artifact written`
|
|
23
|
+
4. `Code modified`
|
|
24
|
+
5. `Next step`
|
|
25
|
+
|
|
26
|
+
## Section Definitions
|
|
27
|
+
|
|
28
|
+
### Task Executed
|
|
29
|
+
Source:
|
|
30
|
+
- latest entry in `task_log.json.executions`
|
|
31
|
+
|
|
32
|
+
Display rule:
|
|
33
|
+
- show the runtime task ID that just ran
|
|
34
|
+
- if no task ran because the system was blocked or complete, show the task that was attempted or `none`
|
|
35
|
+
|
|
36
|
+
### Result
|
|
37
|
+
Source:
|
|
38
|
+
- latest entry in `task_log.json.executions.result`
|
|
39
|
+
|
|
40
|
+
Allowed display values:
|
|
41
|
+
- `success`
|
|
42
|
+
- `blocked`
|
|
43
|
+
- `failed`
|
|
44
|
+
|
|
45
|
+
Display rule:
|
|
46
|
+
- use the exact normalized result from the latest log entry
|
|
47
|
+
|
|
48
|
+
### Artifact Written
|
|
49
|
+
Source:
|
|
50
|
+
- latest entry in `task_log.json.executions.artifacts_touched`
|
|
51
|
+
|
|
52
|
+
Display rule:
|
|
53
|
+
- show the primary artifact path when one was written
|
|
54
|
+
- if multiple artifacts were touched, show the most important runtime artifact first and optionally note additional touched artifacts
|
|
55
|
+
- if none were written, show `none`
|
|
56
|
+
|
|
57
|
+
### Code Modified
|
|
58
|
+
Derived from the task executed.
|
|
59
|
+
|
|
60
|
+
Display rule:
|
|
61
|
+
- `yes` only for Task `05-refactor`
|
|
62
|
+
- `no` for Tasks `01` through `04` and `06`
|
|
63
|
+
- if no task actually ran, show `no`
|
|
64
|
+
|
|
65
|
+
### Next Step
|
|
66
|
+
Source:
|
|
67
|
+
- current runtime state and resolver decision after the run cycle
|
|
68
|
+
|
|
69
|
+
Display rule:
|
|
70
|
+
- show the next task if the system is runnable
|
|
71
|
+
- show a retry target for failed retryable states
|
|
72
|
+
- show a blocker summary for blocked states
|
|
73
|
+
- show `none` for terminal completion
|
|
74
|
+
|
|
75
|
+
## Formatting Rules
|
|
76
|
+
|
|
77
|
+
### General Style
|
|
78
|
+
- keep the summary short
|
|
79
|
+
- prefer five stable labeled lines
|
|
80
|
+
- avoid long explanations
|
|
81
|
+
- avoid dumping notes arrays directly
|
|
82
|
+
|
|
83
|
+
### Recommended Format
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
Task executed: <task-or-none>
|
|
87
|
+
Result: <success|blocked|failed>
|
|
88
|
+
Artifact written: <artifact-path-or-none>
|
|
89
|
+
Code modified: <yes|no>
|
|
90
|
+
Next step: <next-action>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Compression Rules
|
|
94
|
+
- if multiple artifacts were touched, show the primary artifact and optionally append `(+N more)`
|
|
95
|
+
- if the next step is blocked, summarize the blocker in one short clause
|
|
96
|
+
- if the next step is complete, show `none`
|
|
97
|
+
|
|
98
|
+
## Example Summary
|
|
99
|
+
|
|
100
|
+
### Example 1 - Successful Analysis Task
|
|
101
|
+
|
|
102
|
+
```text
|
|
103
|
+
Task executed: 02-diagnose
|
|
104
|
+
Result: success
|
|
105
|
+
Artifact written: .prodify/artifacts/diagnostic_report.md
|
|
106
|
+
Code modified: no
|
|
107
|
+
Next step: 03-architecture
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Example 2 - Blocked Refactor Attempt
|
|
111
|
+
|
|
112
|
+
```text
|
|
113
|
+
Task executed: 05-refactor
|
|
114
|
+
Result: blocked
|
|
115
|
+
Artifact written: none
|
|
116
|
+
Code modified: no
|
|
117
|
+
Next step: unblock selected_refactor_step resolution
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Example 3 - Failed Validation
|
|
121
|
+
|
|
122
|
+
```text
|
|
123
|
+
Task executed: 06-validate
|
|
124
|
+
Result: failed
|
|
125
|
+
Artifact written: .prodify/artifacts/validation_report.md
|
|
126
|
+
Code modified: no
|
|
127
|
+
Next step: retry 05-refactor for step-03-extract-service
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Integration Notes
|
|
131
|
+
|
|
132
|
+
### Integration With Task Log
|
|
133
|
+
- the summary should primarily read from the latest execution entry
|
|
134
|
+
- the log remains the durable execution history
|
|
135
|
+
|
|
136
|
+
### Integration With Validation Report
|
|
137
|
+
- validation details should not be duplicated in full
|
|
138
|
+
- only the latest outcome needed for the summary should be surfaced
|
|
139
|
+
|
|
140
|
+
### Integration With Status Output
|
|
141
|
+
- the run summary is event-oriented
|
|
142
|
+
- the status output is state-oriented
|
|
143
|
+
- do not merge them into one output format
|
|
144
|
+
|
|
145
|
+
## Implementation Notes
|
|
146
|
+
|
|
147
|
+
- Keep the output useful even when the latest run was blocked.
|
|
148
|
+
- Prefer one trustworthy next-step line over a detailed branching explanation.
|
|
149
|
+
- This summary is for each run cycle, not for the entire project history.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"current_task": null,
|
|
3
|
+
"last_completed_task": "06-validate",
|
|
4
|
+
"next_task": null,
|
|
5
|
+
"selected_refactor_step": null,
|
|
6
|
+
"completed_step_ids": [
|
|
7
|
+
"step-01-clarify-default-lifecycle-docs",
|
|
8
|
+
"step-02-reframe-compatibility-docs",
|
|
9
|
+
"step-03-strengthen-consistency-tests"
|
|
10
|
+
],
|
|
11
|
+
"status": "complete",
|
|
12
|
+
"artifacts_dir": ".prodify/artifacts",
|
|
13
|
+
"notes": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Sample Repo Test Plan
|
|
2
|
+
|
|
3
|
+
Date: 2026-03-29
|
|
4
|
+
Scope: first end-to-end Prodify trial on a representative messy repository
|
|
5
|
+
|
|
6
|
+
## Repo Profile
|
|
7
|
+
|
|
8
|
+
Use a medium-sized application repository with these characteristics:
|
|
9
|
+
|
|
10
|
+
- 20 to 80 source files
|
|
11
|
+
- one primary runtime or app entrypoint
|
|
12
|
+
- inconsistent module boundaries
|
|
13
|
+
- duplicated logic in at least a few files
|
|
14
|
+
- weak naming consistency
|
|
15
|
+
- partial or outdated tests
|
|
16
|
+
- no fully reliable architecture document
|
|
17
|
+
|
|
18
|
+
Preferred technology profile:
|
|
19
|
+
|
|
20
|
+
- common application stack such as TypeScript, JavaScript, Python, or similar mainstream codebase
|
|
21
|
+
- simple enough to inspect in one run, but messy enough to require diagnosis and planning
|
|
22
|
+
|
|
23
|
+
Required messiness signals:
|
|
24
|
+
|
|
25
|
+
- at least 5 concrete maintainability issues
|
|
26
|
+
- at least 1 architectural smell
|
|
27
|
+
- at least 1 safe refactor step that can be isolated
|
|
28
|
+
|
|
29
|
+
## Execution Steps
|
|
30
|
+
|
|
31
|
+
Run the first end-to-end evaluation with this task sequence:
|
|
32
|
+
|
|
33
|
+
1. `01-understand`
|
|
34
|
+
2. `02-diagnose`
|
|
35
|
+
3. `03-architecture`
|
|
36
|
+
4. `04-plan`
|
|
37
|
+
5. one controlled `05-refactor`
|
|
38
|
+
6. immediate `06-validate`
|
|
39
|
+
|
|
40
|
+
This first sample run should stop after the first full `05 -> 06` cycle unless the test operator explicitly wants to continue looping.
|
|
41
|
+
|
|
42
|
+
## Checkpoints
|
|
43
|
+
|
|
44
|
+
### Checkpoint 1 - Orientation Completed
|
|
45
|
+
After `01-understand`, confirm:
|
|
46
|
+
|
|
47
|
+
- `orientation_map.md` exists
|
|
48
|
+
- the repo shape, entrypoints, and major subsystems are mapped
|
|
49
|
+
|
|
50
|
+
### Checkpoint 2 - Diagnosis Completed
|
|
51
|
+
After `02-diagnose`, confirm:
|
|
52
|
+
|
|
53
|
+
- `diagnostic_report.md` exists
|
|
54
|
+
- issues are categorized and prioritized
|
|
55
|
+
|
|
56
|
+
### Checkpoint 3 - Architecture Proposal Completed
|
|
57
|
+
After `03-architecture`, confirm:
|
|
58
|
+
|
|
59
|
+
- `architecture_spec.md` exists
|
|
60
|
+
- proposed structure addresses the main diagnosis findings
|
|
61
|
+
|
|
62
|
+
### Checkpoint 4 - Refactor Plan Ready
|
|
63
|
+
After `04-plan`, confirm:
|
|
64
|
+
|
|
65
|
+
- `refactor_plan.md` exists
|
|
66
|
+
- steps are isolated and safe to execute one at a time
|
|
67
|
+
- at least one step has a clear step ID
|
|
68
|
+
|
|
69
|
+
### Checkpoint 5 - Controlled Refactor Executed
|
|
70
|
+
After the first `05-refactor`, confirm:
|
|
71
|
+
|
|
72
|
+
- exactly one step was implemented
|
|
73
|
+
- `implementation_summary.md` exists
|
|
74
|
+
- scope stayed within the selected step
|
|
75
|
+
|
|
76
|
+
### Checkpoint 6 - Validation Completed
|
|
77
|
+
After `06-validate`, confirm:
|
|
78
|
+
|
|
79
|
+
- `validation_report.md` exists
|
|
80
|
+
- validation result is clear enough to decide pass, fail, or inconclusive
|
|
81
|
+
- state and task log reflect the loop outcome
|
|
82
|
+
|
|
83
|
+
## Expected Artifacts And Checkpoints
|
|
84
|
+
|
|
85
|
+
Expected primary artifacts:
|
|
86
|
+
|
|
87
|
+
- `.prodify/artifacts/orientation_map.md`
|
|
88
|
+
- `.prodify/artifacts/diagnostic_report.md`
|
|
89
|
+
- `.prodify/artifacts/architecture_spec.md`
|
|
90
|
+
- `.prodify/artifacts/refactor_plan.md`
|
|
91
|
+
- `.prodify/artifacts/implementation_summary.md`
|
|
92
|
+
- `.prodify/artifacts/validation_report.md`
|
|
93
|
+
|
|
94
|
+
Expected control artifacts:
|
|
95
|
+
|
|
96
|
+
- `.prodify/artifacts/run_state.json`
|
|
97
|
+
- `.prodify/artifacts/task_log.json`
|
|
98
|
+
|
|
99
|
+
Expected checkpoint evidence:
|
|
100
|
+
|
|
101
|
+
- each task writes exactly one primary artifact
|
|
102
|
+
- state advances deterministically
|
|
103
|
+
- task log records each attempt append-only
|
|
104
|
+
|
|
105
|
+
## Success Criteria
|
|
106
|
+
|
|
107
|
+
The sample-repo test is successful when:
|
|
108
|
+
|
|
109
|
+
- the full `01 -> 06` sequence can be planned and executed conceptually against the sample profile
|
|
110
|
+
- each task has a clear expected artifact
|
|
111
|
+
- the first refactor step is narrow and testable
|
|
112
|
+
- validation can clearly report pass, fail, or inconclusive
|
|
113
|
+
- the resulting artifacts are sufficient to explain what changed and what should happen next
|
|
114
|
+
|
|
115
|
+
## Failure Conditions
|
|
116
|
+
|
|
117
|
+
Treat the sample plan as failed if:
|
|
118
|
+
|
|
119
|
+
- the sample repo is too clean to stress diagnosis and planning
|
|
120
|
+
- the repo is so chaotic that no isolated first refactor step can be selected
|
|
121
|
+
- the task sequence requires undocumented manual interpretation to continue
|
|
122
|
+
- success cannot be judged from artifacts and state alone
|
|
123
|
+
|
|
124
|
+
## Practical Test Notes
|
|
125
|
+
|
|
126
|
+
- Prefer a repo with known maintainability problems but low operational risk.
|
|
127
|
+
- Avoid a repo that depends on hidden infrastructure to understand the code at a basic level.
|
|
128
|
+
- Avoid a repo so small that the full pipeline becomes trivial and fails to exercise the system.
|
|
129
|
+
- For the first sample run, one validated refactor loop is enough to prove the workflow shape before scaling up.
|