@acrasie/dev-flow 0.0.0-stage → 1.0.1

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.
Files changed (58) hide show
  1. package/.codex-plugin/plugin.json +20 -0
  2. package/LICENSE +21 -0
  3. package/README.md +181 -2
  4. package/dist/codex-dev-flow.mjs +3 -0
  5. package/dist/dev-flow.mjs +241 -0
  6. package/docs/adr/0001-hybrid-portable-workflow.md +23 -0
  7. package/docs/adr/0002-share-an-invalidable-context-capsule.md +55 -0
  8. package/docs/adr/0004-scale-assurance-lanes-by-applicable-risk.md +36 -0
  9. package/docs/adr/0006-make-intake-adaptive-user-authoritative-and-token-efficient.md +76 -0
  10. package/docs/adr/0007-collect-opt-in-local-benchmark-feedback.md +82 -0
  11. package/docs/adr/0008-automate-maintainer-releases-with-an-interactive-bun-workflow.md +121 -0
  12. package/docs/adr/0009-separate-intake-decisions-from-shape-discovery.md +200 -0
  13. package/docs/adr/0010-choose-quick-or-plan-after-discovery.md +161 -0
  14. package/docs/adr/0011-separate-fast-local-and-authoritative-ci-quality-gates.md +49 -0
  15. package/docs/adr/0012-use-bun-test-and-require-node-24.md +41 -0
  16. package/docs/adr/0013-layer-source-distribution-and-runtime-tests.md +42 -0
  17. package/docs/adr/0014-ratchet-source-coverage-with-bun.md +51 -0
  18. package/docs/adr/0015-split-fast-and-type-aware-linting.md +41 -0
  19. package/docs/adr/0016-use-husky-with-a-tested-bun-staged-file-adapter.md +45 -0
  20. package/docs/adr/0017-format-conservatively-with-oxfmt.md +45 -0
  21. package/docs/adr/0018-use-a-high-signal-oxlint-policy.md +53 -0
  22. package/docs/adr/0019-gate-deterministic-size-and-observe-timing.md +44 -0
  23. package/docs/adr/0020-support-linux-and-macos-with-targeted-ci.md +41 -0
  24. package/docs/adr/0021-randomize-tests-without-retries.md +35 -0
  25. package/docs/adr/0022-use-one-root-bun-workspace.md +41 -0
  26. package/docs/adr/0024-make-gate-a-minimal-plan-approval.md +74 -0
  27. package/docs/adr/0025-end-the-lifecycle-after-assure.md +55 -0
  28. package/docs/adr/0026-keep-intake-product-stable-and-interview-shape-by-dependency.md +151 -0
  29. package/docs/adr/0027-add-agentic-project-init-and-versioned-engineering-profiles.md +147 -0
  30. package/docs/adr/0028-make-public-documentation-user-first-and-current.md +65 -0
  31. package/docs/adr/0029-make-build-a-native-execution-boundary.md +51 -0
  32. package/docs/adr/0030-unify-product-domain-and-technical-design-interviews.md +240 -0
  33. package/docs/adr/0031-make-assure-the-success-boundary.md +205 -0
  34. package/docs/artifacts.md +47 -0
  35. package/docs/baselines/2026-07-18-p0-lifecycle.json +142 -0
  36. package/docs/design.md +101 -0
  37. package/docs/getting-started.md +204 -0
  38. package/docs/glossary/dev-flow.md +527 -0
  39. package/docs/lifecycle-contract.md +189 -0
  40. package/docs/lifecycle-contract.projection.json +931 -0
  41. package/docs/metrics-protocol.md +113 -0
  42. package/docs/project-profile-contract.md +157 -0
  43. package/docs/runbooks/maintainer-release.md +291 -0
  44. package/docs/target-intake-shape-contract.md +416 -0
  45. package/package.json +68 -4
  46. package/schemas/config.schema.json +104 -0
  47. package/schemas/policy.schema.json +17 -0
  48. package/schemas/project-init-state.schema.json +159 -0
  49. package/schemas/project-profile-local.schema.json +53 -0
  50. package/schemas/project-profile.schema.json +285 -0
  51. package/schemas/state.schema.json +826 -0
  52. package/skills/debug-root-cause/SKILL.md +16 -0
  53. package/skills/design-decisions/SKILL.md +24 -0
  54. package/skills/dev-flow/SKILL.md +306 -0
  55. package/skills/dev-flow/agents/openai.yaml +6 -0
  56. package/skills/discover-change/SKILL.md +31 -0
  57. package/skills/plan-change/SKILL.md +29 -0
  58. package/skills/review-change/SKILL.md +21 -0
@@ -0,0 +1,189 @@
1
+ # Dev Flow lifecycle contract
2
+
3
+ This document is normative. `src/state-machine.ts` and generated
4
+ `lifecycle-contract.projection.json` are executable projection.
5
+
6
+ ## Macro-phases
7
+
8
+ ```text
9
+ INTAKE -> SHAPE -> GATE -> BUILD -> ASSURE ✓
10
+ ```
11
+
12
+ Successful tasks traverse all five phases. Cancelled or failed tasks stop truthfully at
13
+ their source phase. Quick/Plan is preparation profile selected inside SHAPE, not
14
+ lifecycle mode. Risk/policy controls safety.
15
+
16
+ ## INTAKE
17
+
18
+ Owns objective, observable success, determining constraints, product decisions, and
19
+ risk. It never chooses preparation profile or performs deep technical discovery.
20
+ Complete Intake always enters Discovery.
21
+
22
+ Statuses: `new`, `intaking`, plus `awaiting_intake_decision` when Shape needs explicit
23
+ product decision. Rich escalation stores evidence/provenance, product impact, 2–3
24
+ options, recommendation/basis, affected dependency roots, and prior Shape role.
25
+
26
+ ## SHAPE
27
+
28
+ ### Discovery
29
+
30
+ Only Discovery reads repository. Work is bounded by structured targets. Evidence carries
31
+ provenance, exact source fingerprints, and dependency identity. One evaluation may
32
+ resolve related targets; widening requires material impact.
33
+
34
+ `discovery_sufficient` requires semantic receipt and deterministic proof: current Intake
35
+ binding, valid DAG, no open/blocked/stale/escalated target, no stale supporting evidence,
36
+ no active escalation, and no unresolved budget checkpoint. No routine second model
37
+ judgment.
38
+
39
+ ### Profile choice
40
+
41
+ After Discovery receipt and before Planning, persist compact checkpoint and Quick/Plan
42
+ recommendation. Unless explicit Plan request/policy lock preselects Plan, exact user
43
+ answer is mandatory. Silence never selects. Choice survives later Discovery widening
44
+ unless policy or user explicitly changes it.
45
+
46
+ ### Planning
47
+
48
+ Planning cannot read repository. It consumes fresh structured Discovery evidence.
49
+ Missing fact creates targeted Discovery Target.
50
+
51
+ Quick and Plan share canonical contract. Every task maps criteria; every criterion maps
52
+ task coverage and validation. `contract_complete` requires semantic implementability and
53
+ deterministic freshness, graph, coverage, profile, guide, and digest checks.
54
+
55
+ Plan adds deterministic Markdown projection. Manual drift requires explicit
56
+ integrate/regenerate. Material integration invalidates Approval.
57
+
58
+ ### Cost/resume
59
+
60
+ Nominal cost: one Discovery session plus one Planning session. Extra call needs new
61
+ material/invalidated target. Soft-budget exhaustion preserves all work and offers
62
+ continue, reduce scope, cancel. No reset-all operation exists.
63
+
64
+ ## GATE
65
+
66
+ GATE is one short pre-BUILD validation and approval step. Pure deterministic preflight
67
+ checks current SHAPE completion, exact canonical digest, criterion/task/validation
68
+ coverage, risk controls, evidence freshness, escalation closure, and current receipt
69
+ reuse. It performs no model, network, repository discovery, or subprocess work.
70
+
71
+ One deterministic five-line card shows objective, plan counts, risks/controls, short
72
+ digest, and actions. Only explicit user intent is valid:
73
+
74
+ - approve -> persist compact Plan Approval Receipt and enter `executing`;
75
+ - change with non-empty instruction -> enter `planning` and invalidate prior receipt;
76
+ - reject -> enter `cancelled`;
77
+ - view -> remain `awaiting_approval` with no mutation.
78
+
79
+ Missing/stale facts return only to affected SHAPE role; product choices may escalate to
80
+ INTAKE. Non-interactive runs remain `awaiting_approval`. No bypass exists. Receipt binds
81
+ user, task/artifact identity, state revision/fingerprint, complete local contract digest,
82
+ and time. Exact digest change invalidates it; time alone does not. Approval never covers
83
+ Git, GitHub, registry, or release actions.
84
+
85
+ ## BUILD
86
+
87
+ BUILD is one thin `executing` boundary. Current Plan Approval Receipt and exact contract
88
+ digest are mandatory before first write and resume. Native Codex implements the complete
89
+ approved plan without a Dev Flow execution skill, checkpoint, progress tracker,
90
+ validation requirement, or persisted BUILD output. Current command evidence may be
91
+ checkpointed for later reuse. Local technical corrections continue
92
+ natively. Material scope, product behavior, approved architecture, or risk change stops
93
+ writes and returns through SHAPE then GATE. Completion transitions automatically to
94
+ `assuring`.
95
+
96
+ ## ASSURE
97
+
98
+ ASSURE is final phase and has one internal status, `assuring`. Canonical
99
+ `assuranceContract`—approved before BUILD—defines subjects, operations, coverage,
100
+ dependencies, predicates, scopes, budgets, and policy snapshot.
101
+
102
+ Reuse fresh BUILD evidence, then run only missing/invalidated deterministic operations.
103
+ Known failures block dependent checks and model work. Policy may activate one bounded
104
+ independent consolidated review. Non-automatable human observations are batched once;
105
+ missing response blocks with exact `resumeTo: assuring`.
106
+
107
+ Exact coverage atomically freezes completion index, creates minimal Assurance Receipt,
108
+ and appends `assure.completed`. Valid paired proof makes `assuring` immutable and derives
109
+ public `ASSURE ✓` / `success`; no separate success status exists. External delivery is
110
+ outside Dev Flow task state and uses native Codex authorization afterward.
111
+
112
+ ## Canonical statuses
113
+
114
+ ```text
115
+ new
116
+ intaking
117
+ discovering
118
+ awaiting_shape_decision
119
+ awaiting_profile_choice
120
+ planning
121
+ awaiting_intake_decision
122
+ awaiting_approval
123
+ executing
124
+ assuring
125
+ blocked
126
+ cancelled
127
+ failed
128
+ ```
129
+
130
+ Primary Shape edges:
131
+
132
+ ```text
133
+ new -> intaking
134
+ intaking -> discovering
135
+ discovering -> awaiting_profile_choice
136
+ discovering -> awaiting_shape_decision
137
+ awaiting_profile_choice -> planning
138
+ planning -> discovering
139
+ planning|discovering -> awaiting_intake_decision
140
+ awaiting_intake_decision -> discovering|planning
141
+ planning -> awaiting_approval
142
+ ```
143
+
144
+ `blocked` retains exact `resumeTo` and `resumeReason`. Resume reconciles inputs and
145
+ continues exact state with existing design/Shape/ASSURE state. V1 through V5 state is incompatible and
146
+ fails with `state_schema_incompatible`; no migration occurs.
147
+
148
+ ## Guards
149
+
150
+ Shape boundary guards: `task_initialized`, `effective_constraints_valid`,
151
+ `intake_complete`, `routing_ready`, `workspace_ready`, `discovery_sufficient`,
152
+ `profile_selected`, `contract_complete`. Discovery and Planning guards require trusted
153
+ state-bound evaluator receipts. Raw attestations cannot prove them.
154
+
155
+ Downstream guards remain listed in generated projection. `gate_decision_valid` accepts
156
+ only structurally valid decision receipt bound to current contract and target semantics.
157
+ `approval_current` protects BUILD resume. ASSURE completion is not a transition guard;
158
+ runtime validates exact evidence coverage in one atomic receipt/event transaction.
159
+
160
+ ## Events
161
+
162
+ SHAPE events: `discovery.target_recorded`, `discovery.evidence_recorded`,
163
+ `discovery.completed`, `profile.choice_requested`, `profile.choice_recorded`,
164
+ `design.question_recorded`, `design.answer_recorded`, `design.invalidated`,
165
+ `contract.projected`, `projection.reconciliation_requested`,
166
+ `evidence.invalidated`, `shape.checkpoint`, `state.transition`.
167
+
168
+ ASSURE events: `assurance.evidence_recorded`, `assurance.evidence_invalidated`,
169
+ `assurance.human_observation_requested`, and `assure.completed`. Parent alone persists
170
+ events, canonical state, and projections.
171
+
172
+ ## Project INIT outside task lifecycle
173
+
174
+ Exact `$dev-flow init` performs agentic repository Discovery and adaptive engineering
175
+ convention interview, then validates and publishes digest-bound shared/local project
176
+ profiles after explicit Profile Approval. It creates no TaskState, product scaffold, or
177
+ task GATE approval. Deterministic `npx @acrasie/dev-flow init` remains separate plugin
178
+ configuration wizard.
179
+
180
+ Normative profile schema, authority, reconciliation, privacy, and atomic publication:
181
+ [Project Engineering Profile contract](project-profile-contract.md). Ordinary SHAPE may
182
+ consume approved profile and domain-documentation conventions by digest-bound reference.
183
+
184
+ ## Privacy and metrics
185
+
186
+ Metrics allow only opaque run identity, preparation profile/unselected, macro-phase,
187
+ allowlisted numeric counters, measurement/source enums, and allowlisted routing
188
+ dimensions. Never objective, code, evidence prose, command output, raw model response, or
189
+ user answer.