@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,41 @@
1
+ # ADR 0022: Use One Root Bun Workspace
2
+
3
+ ## Status
4
+
5
+ Accepted.
6
+
7
+ ## Context
8
+
9
+ Repository-wide quality tools and Husky execute from the Git root, while the publishable
10
+ plugin currently owns a separate Bun installation and lockfile. Adding an independent
11
+ root installation would duplicate dependency resolution, cache state, and frozen-lock
12
+ validation.
13
+
14
+ Placing repository tooling inside the plugin package would invert ownership and require
15
+ commands to reach outside the package boundary.
16
+
17
+ ## Decision
18
+
19
+ Convert the private root package into the Bun workspace owner with
20
+ `workspaces: ["plugins/*"]` and one committed root `bun.lock`.
21
+
22
+ The root package owns repository-level quality dependencies and orchestration scripts,
23
+ including Husky, Oxfmt, Oxlint, and the staged-file adapter. The plugin workspace remains
24
+ self-contained in its manifest and declares its build, test, release, and product-facing
25
+ development dependencies.
26
+
27
+ Install the repository once from the root with `bun install --frozen-lockfile`. Remove
28
+ the nested plugin lockfile after verifying identical or intentionally updated resolved
29
+ versions.
30
+
31
+ Publishing continues from `plugins/codex-dev-flow`; the private root package is never
32
+ packed or published.
33
+
34
+ ## Consequences
35
+
36
+ - Local development and CI use one install and one dependency graph.
37
+ - Repository tools have the same scope as their owning package.
38
+ - Workspace isolation helps expose undeclared plugin dependencies.
39
+ - Release scripts and documentation must stop assuming a nested lockfile or plugin-local
40
+ install.
41
+ - Lockfile migration requires reviewing resolved-version and platform-binary changes.
@@ -0,0 +1,74 @@
1
+ # ADR 0024: Make GATE a Minimal Plan Approval
2
+
3
+ ## Status
4
+
5
+ Accepted and implemented in TaskState V4.
6
+
7
+ ## Context
8
+
9
+ SHAPE already proves that the canonical change contract is complete, evidence-backed,
10
+ fresh, internally consistent, and executable. Re-running discovery, planning, or model
11
+ review in GATE would duplicate SHAPE, add latency, and weaken phase ownership.
12
+
13
+ The V3 lifecycle also uses one generic approval mechanism for both pre-BUILD plan
14
+ authorization and post-ASSURE completion approval. This makes GATE broader than its
15
+ product purpose: let the user validate and authorize the implementation plan before
16
+ workspace mutation begins.
17
+
18
+ ## Decision
19
+
20
+ GATE is one short pre-BUILD user decision over the exact current canonical contract.
21
+ Quick and Plan, and every risk level, use the same interaction. Risk and policy affect
22
+ the contract and its required controls, not the length or number of GATE prompts.
23
+
24
+ Before presenting a decision, GATE runs one deterministic preflight that proves:
25
+
26
+ - the current `contract_complete` receipt is valid;
27
+ - the recomputed canonical digest matches the stored contract digest;
28
+ - every acceptance criterion has validation coverage;
29
+ - referenced SHAPE evidence is fresh; and
30
+ - no Decision Escalation remains open.
31
+
32
+ The preflight performs no model call, network access, repository discovery, or
33
+ subprocess execution. Failure returns to the exact owner: stale evidence to Discovery,
34
+ an invalid contract or digest to Planning, an open product decision to INTAKE, and
35
+ malformed state to a typed block. It never resets SHAPE.
36
+
37
+ On success, GATE renders a deterministic card of at most five lines containing the
38
+ objective, task/criterion/validation counts, risk and control count, a short display
39
+ form of the contract digest, and these actions:
40
+
41
+ - `approuver` / `approve`;
42
+ - `modifier: <instruction>` / `change: <instruction>`;
43
+ - `rejeter` / `reject`.
44
+
45
+ Empty, ambiguous, or continuation-like answers are rejected. `voir` / `view` is a
46
+ read-only action that renders the full canonical contract and leaves the task in GATE.
47
+ No model interprets a GATE answer.
48
+
49
+ Approval authorizes the complete local implementation contract, not one task at a time.
50
+ It never authorizes commit, push, pull request, merge, publication, or release. The
51
+ approval is a compact `PlanApprovalReceipt` bound to user actor, timestamp, task and
52
+ artifact identity, full contract digest, state revision, and state fingerprint. Raw
53
+ conversation text is not persisted.
54
+
55
+ `change_requested` returns to SHAPE Planning with the structured, redacted instruction.
56
+ SHAPE decides whether a product-impacting change needs a Decision Escalation to INTAKE.
57
+ `rejected` ends the task as `cancelled`. All three decisions enter bounded history, but
58
+ only `approved` creates an active authorization.
59
+
60
+ Any canonical contract digest change invalidates approval. Unrelated progress does not.
61
+ Approval has no arbitrary wall-clock expiry; SHAPE evidence freshness remains the
62
+ validity boundary. Non-interactive execution stops in `awaiting_approval` and cannot
63
+ use a configuration, policy, or CLI bypass.
64
+
65
+ ## Consequences
66
+
67
+ - Nominal GATE cost is one local preflight, one card, one user decision, and one state
68
+ transition.
69
+ - Approval semantics become exact and auditable without storing user prose.
70
+ - `ApprovalGate`, `pendingGate`, and completion approval are removed in V4.
71
+ - TaskState V3 gate-type and materiality rules are replaced in V4 by one full-digest
72
+ plan approval.
73
+ - Metrics may record only allowlisted preflight outcomes, decision kinds, approval
74
+ reuse, and targeted returns; they contain no objective, instruction, digest, or path.
@@ -0,0 +1,55 @@
1
+ # ADR 0025: End the Lifecycle After ASSURE
2
+
3
+ ## Status
4
+
5
+ Superseded by ADR 0031. Historical TaskState V4 decision retained for context.
6
+
7
+ ## Context
8
+
9
+ V3 HANDOFF distinguishes local completion from external Git or GitHub delivery, stores
10
+ remaining actions and provider receipts, and reconciles retries. In the intended Codex
11
+ product flow, conversation resume and external actions already belong to the parent
12
+ Codex interaction. Keeping those concerns inside dev-flow duplicates native behavior
13
+ and adds statuses, policy, metrics, and failure paths after implementation is already
14
+ verified.
15
+
16
+ ## Decision
17
+
18
+ TaskState V4 has five public macro-phases:
19
+
20
+ ```text
21
+ INTAKE -> SHAPE -> GATE -> BUILD -> ASSURE -> finished
22
+ ```
23
+
24
+ ASSURE persists a compact verification receipt containing criterion coverage, executed
25
+ validation identities and results, freshness fingerprint, and timestamp. Successful
26
+ ASSURE transitions directly to the single success terminal `finished`. Parent Codex,
27
+ not a dev-flow phase, renders the conversational completion response.
28
+
29
+ HANDOFF and its public/internal contract are removed, including `handing_off`,
30
+ `ready_for_handoff`, `finished_local`, `remainingActions`, handoff intent and
31
+ reconciliation receipts, HANDOFF capsule/events/guards, handoff configuration, and
32
+ handoff metrics.
33
+
34
+ Commit, push, pull request, merge, publication, and release occur outside the dev-flow
35
+ lifecycle through native Codex behavior and native confirmations. A combined request
36
+ such as “implement, commit, and open a pull request” is split implicitly: dev-flow owns
37
+ implementation through verified `finished`; parent Codex may then execute requested
38
+ external actions. TaskState does not persist those external actions.
39
+
40
+ No GATE approval authorizes an external action. Removing HANDOFF therefore does not
41
+ weaken the confirmation boundary for Git, GitHub, registry, or release operations.
42
+
43
+ V4 is an explicit schema break. V1, V2, and V3 task states fail with a typed incompatible
44
+ schema error. The runtime does not guess how an old completion approval or partial
45
+ handoff maps to the five-phase lifecycle.
46
+
47
+ ## Consequences
48
+
49
+ - Verified implementation has one unambiguous success terminal.
50
+ - Resume and metrics no longer model external delivery state.
51
+ - Native Codex remains responsible for external-action authorization, retries, and
52
+ conversational summaries.
53
+ - TaskState V3 HANDOFF delivery state is removed rather than migrated into V4.
54
+ - The state schema, registry, projections, skills, configuration, benchmark protocol,
55
+ documentation, generated bundle, and deterministic tests must change atomically.
@@ -0,0 +1,151 @@
1
+ # ADR 0026: Keep INTAKE Product-Stable and Interview SHAPE by Dependency
2
+
3
+ ## Status
4
+
5
+ Superseded as target design by
6
+ [ADR 0030](0030-unify-product-domain-and-technical-design-interviews.md). Current runtime
7
+ behavior introduced before ADR 0030 remains documented by ADRs 0006, 0009, and 0010
8
+ until the replacement target lands atomically.
9
+
10
+ ## Context
11
+
12
+ INTAKE and SHAPE already separate product intent from repository discovery, but current
13
+ SHAPE primarily asks only the Quick/Plan choice and escalated product decisions. A
14
+ complex change can still contain material technical alternatives whose consequences
15
+ should be chosen explicitly rather than inferred during Planning or BUILD.
16
+
17
+ A fixed questionnaire is also wrong. Facts available from repositories, tools, or
18
+ official documentation should be discovered, while decisions remain user-owned. Asking
19
+ several questions together hides dependencies and makes answers ambiguous. Conversely,
20
+ an arbitrary question cap can leave a material branch unresolved.
21
+
22
+ INTAKE needs a stronger stability rule without becoming a mandatory five-prompt form.
23
+ Five product dimensions must be resolved, but explicit input should not be asked again.
24
+ SHAPE needs a dependency-directed interview with exact resume semantics and no periodic
25
+ interaction that exists only to report progress or estimated cost.
26
+
27
+ ## Decision
28
+
29
+ ### INTAKE owns a stable product baseline
30
+
31
+ INTAKE resolves five mandatory dimensions:
32
+
33
+ 1. objective;
34
+ 2. affected users and product value;
35
+ 3. scope and boundaries;
36
+ 4. observable success and its validator; and
37
+ 5. product risks and determining constraints.
38
+
39
+ These are five completeness dimensions, not five mandatory prompts. Input already
40
+ stated explicitly satisfies its dimension. Questions remain adaptive, one at a time,
41
+ and include two or three viable options, an evidence-based recommendation, and a
42
+ free-form path.
43
+
44
+ The Product Brief becomes stable when every dimension is resolved. A dedicated
45
+ confirmation is shown only when the brief contains a material interpretation,
46
+ normalized free-form decision, or resolved contradiction. Otherwise explicit request
47
+ and answers are sufficient; the final GATE approval still covers the complete contract.
48
+
49
+ SHAPE never mutates INTAKE. Fresh technical evidence may reopen only the affected
50
+ product decision. Product intent remains authoritative while a compatible technical
51
+ alternative exists. A contradiction is resolved by source:
52
+
53
+ - stale evidence returns to targeted Discovery;
54
+ - an incompatible technical choice with a viable alternative invalidates that SHAPE
55
+ choice;
56
+ - proven infeasibility or materially different product outcomes reopen the dependent
57
+ INTAKE decision; and
58
+ - only the transitive dependency closure is invalidated.
59
+
60
+ ### SHAPE interviews only material technical decisions
61
+
62
+ SHAPE looks up facts before asking. It may inspect repositories, configured service
63
+ roots, safe command results, and primary external documentation. Missing factual
64
+ evidence creates a Discovery Target. User-provided information that cannot be verified
65
+ is retained as `user_asserted` provenance and cannot silently become technical proof.
66
+
67
+ A user question is required only for a material technical decision. Deterministic
68
+ triggers include architecture boundaries, framework/runtime or major dependency,
69
+ schema/data migration, cross-service contract, security/privacy, compatibility,
70
+ concurrency, material performance/cost/operations, and an exception to an approved
71
+ project profile. The model may add another material decision only with an explicit
72
+ impact reason.
73
+
74
+ Reversible details already implied by repository conventions remain agent-owned. The
75
+ user cannot delegate a material decision with “choose for me”; selecting the recommended
76
+ option explicitly is a valid decision.
77
+
78
+ SHAPE maintains an acyclic decision graph. It resolves the highest-impact unblocked root
79
+ before dependent branches. Discovery and interview are interleaved so eliminated
80
+ branches are not explored:
81
+
82
+ ```text
83
+ Discovery -> technical decision -> targeted Discovery -> technical decision -> ...
84
+ ```
85
+
86
+ Each visible interaction contains exactly one question. The runtime may normalize other
87
+ unambiguous decisions volunteered in the same answer and skip their future questions.
88
+ The full graph stays internal; the question shows only its parent context, evidence,
89
+ recommendation, confidence, viable options, and direct consequences. More than three
90
+ feasible options are reduced to two or three non-dominated choices; excluded choices
91
+ remain viewable and free-form input remains available.
92
+
93
+ There is no hard question cap and no periodic five-question checkpoint. State persists
94
+ silently after each answer. A warning appears only when a real context or quota boundary
95
+ threatens continuation. User revisions invalidate only dependent decisions, evidence,
96
+ and contract sections.
97
+
98
+ ### Stable question state and completion
99
+
100
+ A new `awaiting_shape_decision` status belongs to SHAPE. It persists one exact active
101
+ question, its evidence and dependencies, and the exact prior role
102
+ `discovering|planning`. `awaiting_profile_choice` remains separate because Quick/Plan
103
+ controls preparation depth rather than technical design.
104
+
105
+ Quick/Plan is chosen after the main material technical branches are resolved and before
106
+ Planning. Planning may still create a targeted Discovery Target or Technical Decision
107
+ when a new material dependency appears.
108
+
109
+ SHAPE completion is hybrid. The model declares no material uncertainty remains;
110
+ deterministic runtime requires a valid decision DAG, no open required decision, current
111
+ evidence, current applicable project profile, complete criterion/task/validation
112
+ coverage, and resolved risks. An open mandatory branch cannot be bypassed by a request
113
+ to advance.
114
+
115
+ SHAPE then renders one compact synthesis of decisions, architecture, exceptions, risks,
116
+ and validation. The existing five-line GATE card follows in the same interaction. GATE
117
+ approval is the single final confirmation of shared understanding and authorization to
118
+ BUILD; SHAPE adds no duplicate confirmation.
119
+
120
+ ### Adaptive visual evidence
121
+
122
+ Visuals use the least expensive representation that can resolve the decision:
123
+
124
+ - ASCII for simple flows, trees, and rough wireframes;
125
+ - Mermaid for architecture, state, sequence, and dependency diagrams;
126
+ - isolated HTML/CSS for material UI layout or interaction decisions; and
127
+ - Excalidraw or generated images only when explicitly requested or higher fidelity is
128
+ necessary.
129
+
130
+ Two or three visual variants may appear inside one question when comparison is
131
+ material. HTML/CSS prototypes and executable spikes live in isolated temporary task
132
+ space, never product source. They are not promoted before GATE. Safe inspection,
133
+ non-mutating checks, and temporary experiments are allowed; installs, migrations,
134
+ external effects, and product writes are not.
135
+
136
+ Product-visible UX decisions remain INTAKE-owned. Component structure, layout
137
+ implementation, responsive mechanics, and frontend architecture remain SHAPE-owned.
138
+
139
+ ## Consequences
140
+
141
+ - INTAKE becomes stable without imposing redundant prompts on explicit requests.
142
+ - Complex technical work can be interviewed deeply without asking repository facts or
143
+ overwhelming the user with multiple simultaneous questions.
144
+ - The decision DAG provides deterministic question order, selective invalidation, and
145
+ exact resume.
146
+ - Long interviews persist compact normalized decisions, active question, provenance,
147
+ recommendations, and invalidations—not transcript or hidden reasoning.
148
+ - The new status and records extend unreleased TaskState V4 before publication rather
149
+ than creating an immediate V5 break.
150
+ - Current runtime behavior remains authoritative until the lifecycle contract, schema,
151
+ state machine, skills, and tests implement this ADR atomically.
@@ -0,0 +1,147 @@
1
+ # ADR 0027: Add Agentic Project INIT and Versioned Engineering Profiles
2
+
3
+ ## Status
4
+
5
+ Accepted and implemented for Project INIT and profile transactions. Ordinary SHAPE
6
+ profile consumption and domain-documentation integration remain pending ADR 0030.
7
+
8
+ ## Context
9
+
10
+ Material technical questions should not recur on every task when a project already has
11
+ approved architecture and development conventions. Existing repository files prove many
12
+ facts, but implicit conventions can be inconsistent or incomplete. The standalone
13
+ `npx codex-dev-flow init` configures plugin operation through a deterministic terminal
14
+ wizard; it cannot perform model-assisted repository discovery and a dependency-aware
15
+ architecture interview.
16
+
17
+ Projects may also span several repositories. Shared topology and contracts must be
18
+ portable, while absolute filesystem paths and personal preferences must remain local.
19
+ Any persisted profile must distinguish stable decisions from volatile task evidence,
20
+ detect drift, and never overwrite team conventions without explicit validation.
21
+
22
+ ## Decision
23
+
24
+ ### Add a separate agentic command
25
+
26
+ The plugin adds `$dev-flow init`. It is distinct from the existing standalone
27
+ `npx codex-dev-flow init` configuration wizard.
28
+
29
+ `$dev-flow init` discovers before asking. It reads applicable guidance, manifests,
30
+ configuration, architecture sources, tests, contracts, and representative code. It asks
31
+ only missing, contradictory, or material decisions, exactly one at a time, using the
32
+ recommendation and dependency rules now refined by ADR 0030. There is no hard question cap or
33
+ periodic progress checkpoint.
34
+
35
+ The command is adaptive. Every project uses a common core covering stack, source
36
+ structure, architectural boundaries, dependency direction, naming, error handling, and
37
+ quality/testing. Discovery or user input activates applicable modules for frontend,
38
+ APIs, data, security, concurrency, performance, compatibility, migrations,
39
+ observability, deployment, rollback, and operations. Non-applicable domains are not
40
+ asked.
41
+
42
+ Greenfield repositories are supported. With no code to inspect, INIT interviews the
43
+ applicable decisions and produces only profile and optional diagram artifacts. It never
44
+ scaffolds product code.
45
+
46
+ Long interviews persist gitignored `.codex/project-init/state.yaml` containing compact
47
+ normalized decisions, stale keys, exact active question, status, and candidate digest.
48
+ It contains no transcript or hidden reasoning. Resume restores same question unless
49
+ dependency evidence changed.
50
+
51
+ ### Persist shared and local profiles separately
52
+
53
+ The canonical shared profile is `.codex/dev-flow.project.yaml`. It is versioned and
54
+ schema-validated. It stores only durable knowledge:
55
+
56
+ - logical project and service identities;
57
+ - supported stack/runtime choices;
58
+ - architecture, boundaries, and dependency rules;
59
+ - stable API/data/security/operations conventions when applicable;
60
+ - source layout, naming, error, testing, and quality conventions;
61
+ - decision provenance and durable source fingerprints;
62
+ - references to optional diagram projections; and
63
+ - content revision, digest, and `ProfileApprovalReceipt`.
64
+
65
+ The local overlay `.codex/dev-flow.project.local.yaml` is gitignored. It stores
66
+ non-contractual personal preferences and maps logical service identities to absolute
67
+ local paths. It cannot weaken repository policy or the shared profile.
68
+
69
+ The authority order is:
70
+
71
+ ```text
72
+ system instructions and repository policy
73
+ -> INTAKE product decisions
74
+ -> explicitly approved task exception
75
+ -> shared engineering profile
76
+ -> non-contractual local preferences
77
+ -> agent defaults
78
+ ```
79
+
80
+ A lower layer cannot weaken a higher layer. Repository observations, task-local file
81
+ facts, command results, and other volatile evidence stay in ShapeState rather than
82
+ inflating the project profile.
83
+
84
+ ### Model multi-service topology without portable-path leaks
85
+
86
+ Each repository owns its own engineering profile. A root profile may describe logical
87
+ service topology, responsibilities, inter-service dependencies, and contracts, and may
88
+ reference profiles owned by other repositories. Local overlays map those service IDs to
89
+ available filesystem roots.
90
+
91
+ Discovery first inspects cheap guidance, manifests, contracts, and structure across
92
+ declared accessible services. It reads implementation deeply only when a live decision
93
+ can change the profile or current task. An inaccessible service statement is retained
94
+ as `user_asserted`, never fabricated as verified evidence.
95
+
96
+ INIT does not modify a profile owned by another repository without a separate explicit
97
+ profile transaction and validation for that owner. Absolute paths never enter shared
98
+ profiles.
99
+
100
+ ### Reconcile profile drift transactionally
101
+
102
+ Profile decisions are authoritative defaults, not unbreakable rules. If fresh evidence
103
+ contradicts a profile, runtime identifies the affected dependency closure and interviews
104
+ only stale decisions. Facts are refreshed through Discovery; user-owned conventions are
105
+ never rewritten automatically.
106
+
107
+ Answers accumulate in a local proposed profile. No shared file is changed after each
108
+ question. At the end, INIT renders an adaptive human summary of changed decisions,
109
+ topology, exceptions, sources, and any useful Mermaid projection. The exact canonical
110
+ YAML remains available through `view`.
111
+
112
+ Profile validation is distinct from task GATE because it affects future tasks. Approval
113
+ creates a compact `ProfileApprovalReceipt` bound to user actor, timestamp, profile
114
+ identity, revision, and exact content digest. The receipt is outside the content digest
115
+ to avoid a digest cycle. One atomic write publishes profile and projections only after
116
+ that validation.
117
+
118
+ If the user rejects a global update, the shared profile remains byte-for-byte unchanged.
119
+ The mismatch and any explicitly approved task-local exception remain local. Future tasks
120
+ redetect drift from fingerprints. A task may proceed through a local exception unless
121
+ repository policy forbids it.
122
+
123
+ When no profile exists, ordinary `$dev-flow <objective>` remains usable. SHAPE discovers
124
+ only task-relevant conventions. Durable decisions are accumulated silently and offered
125
+ once as a proposed profile transaction before final SHAPE synthesis; promotion is never
126
+ automatic or asked after every answer.
127
+
128
+ ### Project diagrams are projections
129
+
130
+ The YAML profile remains canonical. Non-trivial architecture may produce a deterministic
131
+ Mermaid document referenced by profile. Simple projects do not receive mandatory
132
+ diagrams. A diagram never becomes a second authority; manual drift requires explicit
133
+ reconciliation.
134
+
135
+ ## Consequences
136
+
137
+ - Approved conventions are discovered once and reused without repeated SHAPE questions.
138
+ - Shared architecture stays portable across machines and multi-repository workspaces.
139
+ - Local paths and preferences remain private and non-contractual.
140
+ - Profile drift becomes selective, reviewable, and user-authoritative rather than a
141
+ full reinitialization or silent overwrite.
142
+ - `$dev-flow init` uses strict profile schemas, deterministic digest/receipt logic, safe
143
+ multi-root discovery, atomic authority publication, and negative path/privacy tests.
144
+ - The existing `npx codex-dev-flow init` remains compatible and keeps its current purpose.
145
+ - Project INIT/profile behavior is normative in the Project Engineering Profile contract.
146
+ Ordinary task SHAPE profile consumption remains governed by current lifecycle until
147
+ ADR 0030 implementation lands.
@@ -0,0 +1,65 @@
1
+ # ADR 0028: Make Public Documentation User-First and Current
2
+
3
+ ## Status
4
+
5
+ Accepted and implemented.
6
+
7
+ ## Context
8
+
9
+ The repository root README and packaged plugin README served different audiences and had
10
+ drifted. The root explained installation while the packaged README opened with lifecycle
11
+ internals. Neither gave one complete path from installation through Project INIT to a
12
+ first verified task. Public pages also mixed available behavior with accepted target
13
+ design, and completed plans plus superseded ADRs remained in the published package.
14
+
15
+ Project INIT introduced another naming collision: `$dev-flow init` performs agentic
16
+ project discovery and interview, while `npx codex-dev-flow init` runs a deterministic
17
+ plugin Configuration wizard. A user-first explanation must distinguish them without a
18
+ breaking command rename.
19
+
20
+ ## Decision
21
+
22
+ Public documentation uses four layers:
23
+
24
+ ```text
25
+ README -> practical guide -> normative contracts -> decision records
26
+ ```
27
+
28
+ - Root and packaged README files lead with value, requirements, installation, Project
29
+ INIT, a first task, current commands, generated files, configuration, and safety.
30
+ - `docs/getting-started.md` owns the end-to-end walkthrough, resume paths, and common
31
+ failures.
32
+ - Normative contracts own exact lifecycle, schema, authority, privacy, and transaction
33
+ rules. README prose links to those rules instead of reproducing all internals.
34
+ - ADRs explain durable trade-offs. Clearly labeled target documents may describe
35
+ unimplemented design, but README files describe only behavior users can invoke now.
36
+
37
+ The two README files share tested user-journey invariants but need not be byte-identical.
38
+ The root may add repository development and quality sections. Relative links adapt to
39
+ each location.
40
+
41
+ Canonical interface names are:
42
+
43
+ - **Project INIT** for agentic `$dev-flow init`; and
44
+ - **Configuration wizard** for deterministic `npx codex-dev-flow init`.
45
+
46
+ README diagrams use portable ASCII. The practical guide may use Mermaid for relationships
47
+ that benefit from a rendered graph. Generated screenshots and binary diagrams are not
48
+ required.
49
+
50
+ Documentation that is fully superseded, describes completed delivery sequencing, or is
51
+ an obsolete implementation plan may be removed after all current references and package
52
+ manifests are updated. Documents that still define runtime behavior remain until their
53
+ replacement is implemented atomically.
54
+
55
+ ## Consequences
56
+
57
+ - New users can install the plugin, initialize a project, and start a task without first
58
+ learning TaskState internals.
59
+ - npm package, marketplace, and repository entry points teach the same workflow.
60
+ - Current capability and future target remain visibly separate.
61
+ - Command-name compatibility is preserved while the two INIT concepts become explicit.
62
+ - README alignment and relative links become automated distribution checks.
63
+ - Removing dead history reduces package noise but intentionally trades exhaustive local
64
+ design archaeology for current, authoritative documentation; Git history remains the
65
+ archive.
@@ -0,0 +1,51 @@
1
+ # ADR 0029: Make BUILD a native execution boundary
2
+
3
+ ## Status
4
+
5
+ Accepted and implemented in TaskState V5.
6
+
7
+ ## Context
8
+
9
+ Codex already chooses effective edit order, tools, local corrections, and useful
10
+ implementation-time checks. A separate `execute-change` skill repeated that native
11
+ behavior through atomic-task orchestration, checkpoints, validation after every task,
12
+ fingerprints, and a BUILD correction loop. This increased context and state complexity
13
+ without adding a product decision or final correctness proof. ASSURE already owns fresh
14
+ review and criterion-linked verification.
15
+
16
+ Users still need an explicit lifecycle boundary between approved planning and assurance,
17
+ plus visible phase changes. Codex does not expose a documented plugin API for a custom
18
+ dynamic footer item, so Dev Flow cannot promise a permanent native status-line field.
19
+
20
+ ## Decision
21
+
22
+ Keep BUILD as one public macro-phase with one internal status: `executing`.
23
+
24
+ - Announce `[DEV FLOW · GATE → BUILD]` and `[DEV FLOW · BUILD → ASSURE]` only at phase
25
+ transitions.
26
+ - Before first write or resume, require a current Plan Approval Receipt bound to the exact
27
+ canonical contract digest.
28
+ - Let native Codex implement the complete approved plan. Dev Flow adds no BUILD-specific
29
+ skill, model route, orchestration, task checkpoint, progress tracker, validation
30
+ requirement, fingerprint, or persisted output.
31
+ - Continue local technical corrections natively. Material scope, product behavior,
32
+ approved architecture, or risk changes stop writes and return through SHAPE then GATE.
33
+ - Transition automatically from `executing` to the applicable ASSURE review or
34
+ verification lane.
35
+ - Reserve `debug-root-cause` for repeated stable ASSURE failures.
36
+
37
+ Remove `validating` and `resolving_build`. This changes accepted persisted statuses, so
38
+ TaskState advances from V4 to V5. Older task state fails explicitly; no ambiguous
39
+ migration guesses whether implementation or BUILD validation had completed.
40
+
41
+ ## Consequences
42
+
43
+ - BUILD prompt and runtime surface become smaller.
44
+ - Worktree diff is implementation truth; ASSURE derives its Diff Capsule from current
45
+ state rather than consuming a BUILD summary.
46
+ - Formal validation moves entirely to ASSURE. Native Codex may still run useful checks
47
+ while implementing.
48
+ - Resume remains safe through exact approval/digest reconciliation without BUILD
49
+ checkpoints.
50
+ - Plugin UI remains honest: phase transitions are visible in conversation, but no custom
51
+ persistent Codex footer is claimed.