edify-agents-cli 0.2.0__py3-none-any.whl

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 (102) hide show
  1. edify/__init__.py +19 -0
  2. edify/__main__.py +6 -0
  3. edify/_toml.py +286 -0
  4. edify/agents.py +261 -0
  5. edify/anim.py +499 -0
  6. edify/assets/commands/build.md +64 -0
  7. edify/assets/commands/plan.md +68 -0
  8. edify/assets/commands/spec.md +63 -0
  9. edify/assets/commands/tasks.md +65 -0
  10. edify/assets/commands/verify.md +67 -0
  11. edify/assets/formats/plan.example.md +455 -0
  12. edify/assets/formats/plan.format.md +128 -0
  13. edify/assets/formats/spec.example.md +483 -0
  14. edify/assets/formats/spec.format.md +116 -0
  15. edify/assets/formats/tasks.example.md +712 -0
  16. edify/assets/formats/tasks.format.md +199 -0
  17. edify/assets/harvest/harvest.md +91 -0
  18. edify/assets/harvest/sources.md +295 -0
  19. edify/assets/harvest/vocab.md +52 -0
  20. edify/assets/manifest.md +30 -0
  21. edify/assets/mcp/default-registry.md +66 -0
  22. edify/assets/skills/adversary.md +61 -0
  23. edify/assets/skills/debugger.md +64 -0
  24. edify/assets/skills/implementer-general.md +53 -0
  25. edify/assets/skills/implementer-go.md +63 -0
  26. edify/assets/skills/implementer-node.md +61 -0
  27. edify/assets/skills/implementer-postgres.md +63 -0
  28. edify/assets/skills/implementer-python.md +65 -0
  29. edify/assets/skills/implementer-react.md +65 -0
  30. edify/assets/skills/planner.md +58 -0
  31. edify/assets/skills/test-writer-node.md +64 -0
  32. edify/assets/skills/test-writer-python.md +60 -0
  33. edify/assets/skills/verifier.md +67 -0
  34. edify/assets/templates/CLAUDE.md +18 -0
  35. edify/assets.py +77 -0
  36. edify/cli.py +681 -0
  37. edify/commands/__init__.py +1 -0
  38. edify/commands/check_cmd.py +72 -0
  39. edify/commands/doctor_cmd.py +206 -0
  40. edify/commands/feedback_cmd.py +90 -0
  41. edify/commands/governance_cmd.py +65 -0
  42. edify/commands/graph_cmd.py +156 -0
  43. edify/commands/harvest_cmd.py +538 -0
  44. edify/commands/init_cmd.py +333 -0
  45. edify/commands/init_new_cmd.py +151 -0
  46. edify/commands/license_cmd.py +80 -0
  47. edify/commands/mcp_cmd.py +159 -0
  48. edify/commands/self_cmd.py +185 -0
  49. edify/commands/setup_cmd.py +79 -0
  50. edify/commands/skills_cmd.py +177 -0
  51. edify/commands/upgrade_cmd.py +178 -0
  52. edify/context.py +57 -0
  53. edify/conventions.py +275 -0
  54. edify/detect.py +313 -0
  55. edify/distribution.py +40 -0
  56. edify/errors.py +66 -0
  57. edify/feedback.py +207 -0
  58. edify/formats/__init__.py +11 -0
  59. edify/formats/check.py +573 -0
  60. edify/formats/document.py +238 -0
  61. edify/formats/finding.py +50 -0
  62. edify/formats/fix.py +114 -0
  63. edify/formats/mcp.py +126 -0
  64. edify/formats/plan.py +151 -0
  65. edify/formats/skill.py +139 -0
  66. edify/formats/spec.py +164 -0
  67. edify/formats/tasks.py +321 -0
  68. edify/governance.py +316 -0
  69. edify/graph/__init__.py +11 -0
  70. edify/graph/extract.py +351 -0
  71. edify/graph/ignore.py +107 -0
  72. edify/graph/langs/__init__.py +93 -0
  73. edify/graph/langs/ctags.py +145 -0
  74. edify/graph/langs/markdown.py +41 -0
  75. edify/graph/langs/patterns.py +361 -0
  76. edify/graph/langs/python_ast.py +154 -0
  77. edify/graph/langs/sqlish.py +86 -0
  78. edify/graph/model.py +102 -0
  79. edify/graph/queries.py +211 -0
  80. edify/graph/store.py +157 -0
  81. edify/harvest/__init__.py +28 -0
  82. edify/harvest/ledger.py +191 -0
  83. edify/harvest/screen.py +236 -0
  84. edify/harvest/sources.py +298 -0
  85. edify/host.py +345 -0
  86. edify/interview.py +354 -0
  87. edify/library.py +176 -0
  88. edify/licensing/__init__.py +30 -0
  89. edify/licensing/ed25519.py +154 -0
  90. edify/licensing/projects.py +223 -0
  91. edify/licensing/tier.py +172 -0
  92. edify/licensing/token.py +149 -0
  93. edify/paths.py +282 -0
  94. edify/selfinstall.py +244 -0
  95. edify/skills.py +108 -0
  96. edify/tsv.py +109 -0
  97. edify/ui.py +334 -0
  98. edify_agents_cli-0.2.0.dist-info/METADATA +408 -0
  99. edify_agents_cli-0.2.0.dist-info/RECORD +102 -0
  100. edify_agents_cli-0.2.0.dist-info/WHEEL +4 -0
  101. edify_agents_cli-0.2.0.dist-info/entry_points.txt +2 -0
  102. edify_agents_cli-0.2.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: tasks
3
+ description: A spec and a plan become a build plan.
4
+ model: strongest
5
+ ends-at: a human
6
+ ---
7
+
8
+ # /tasks
9
+
10
+ Turn the approved documents into something a cheap model can execute without
11
+ thinking. The test is mechanical: if the builder has to think, this document was
12
+ incomplete.
13
+
14
+ ## What you read
15
+
16
+ The approved `spec.md`, `plan.md` if there is one, and the graph. Every `file:line`
17
+ you write comes from a graph query, never from memory.
18
+
19
+ ## What you write
20
+
21
+ `specs/<feature>/tasks.md`, in the format at `.edify/formats/tasks.format.md`. The
22
+ worked example beside it is the most important artifact in this system — the
23
+ difference between a good plan and a plausible one is entirely in that level of
24
+ detail, and it does not survive being described in the abstract.
25
+
26
+ ## The passes
27
+
28
+ 1. **Cut.** Every requirement and every closure-checklist row becomes one or more
29
+ tasks. A task that discharges nothing is refused; that is where scope creep
30
+ enters.
31
+ 2. **Place.** For each task, `edify graph where` for the symbols it touches and
32
+ `edify graph dependents` for everything that breaks. Write the exact file set
33
+ and line ranges. A task that cannot be placed is a task the plan does not
34
+ understand, and it blocks the gate rather than becoming build-time exploration.
35
+ 3. **Order.** Assign phases by dependency, respecting the plan's milestone rules.
36
+ Mark the contracts that freeze at the end of phase 1.
37
+ 4. **Write phase 2.** Every assertion in the spec becomes a phase-2 task producing
38
+ a *failing* test, at the verification kind the spec declared. This pass is not
39
+ optional and is never merged into the tasks that implement the behaviour.
40
+ 5. **Parallelise.** Within each phase, `edify graph overlap` between file sets
41
+ including dependents. Exact, because the graph is exact. A task citing a whole
42
+ file makes it a false positive and quietly collapses the phase to serial.
43
+ 6. **Detail.** Steps and a done-check per task. This pass determines whether
44
+ `/build` runs on a cheap model, and it is the pass most likely to be rushed.
45
+ 7. **Close.** Fill `## Coverage`, one row per requirement and per checklist item,
46
+ and check it is complete *before* showing it to anyone. An incomplete coverage
47
+ table must never reach a gate looking complete.
48
+
49
+ Run `edify check` last. It reports a task with no discharge, no steps, or no
50
+ done-check; a whole-file reference on an edit; a phase-2 done-check that asserts
51
+ tests pass; and an empty coverage cell.
52
+
53
+ ## What this command refuses
54
+
55
+ A task with no requirement behind it. A task with no done-check. A whole-file
56
+ reference on anything but a new file. A phase-2 task whose done-check asserts tests
57
+ *pass*. Starting implementation. Showing an incomplete coverage table as if it were
58
+ complete.
59
+
60
+ ## The gate
61
+
62
+ Show the human the phase list, the coverage table, and the tasks. This is the last
63
+ cheap moment to say "that is not how we do it here."
64
+
65
+ Format: `.edify/formats/tasks.format.md` · Example: `.edify/formats/tasks.example.md`
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: verify
3
+ description: The code becomes evidence.
4
+ model: strong, and never a session that wrote code
5
+ ends-at: a report anyone can read
6
+ ---
7
+
8
+ # /verify
9
+
10
+ Re-run everything yourself and write down what actually came out. This command runs
11
+ things. It does not decide things, and it never edits code.
12
+
13
+ ## What you read
14
+
15
+ The repository, `spec.md`, `tasks.md`, and `plan.md` if there is one.
16
+
17
+ ## What you write
18
+
19
+ `specs/<feature>/verification.md` — four sections, readable by someone who was not
20
+ in the room.
21
+
22
+ ## The passes
23
+
24
+ 1. **Re-run everything.** The full suite, the type check, the lint, invoked exactly
25
+ as the spec's constraints say to invoke them. Capture the raw output. A summary
26
+ of a test run is a claim about a test run, and the entire reason this runs in a
27
+ fresh session is that claims about one's own work carry no information.
28
+ 2. **Confirm the ordering.** Read `git log` and confirm the tests for each
29
+ assertion landed before the code that satisfies them. A suite written afterwards
30
+ encodes the behaviour the code has rather than the behaviour the spec asked for,
31
+ and this is the only mechanical way to know which happened.
32
+ 3. **Exercise it for real.** Where an acceptance scenario can be run — start the
33
+ service and make real calls, drive the interface, run the job against fixtures —
34
+ do that and paste the transcript. This is where the class of failure that passes
35
+ every unit test surfaces.
36
+ 4. **Walk the coverage table.** Every row marked satisfied with its evidence,
37
+ waived with its reason, or blocked with what is missing. Check each assertion
38
+ against the verification kind the spec declared: a property test that became an
39
+ example test is a silent downgrade, and it is reported, not accepted.
40
+ 5. **Check the plan's gates**, if there is a plan. Milestone gates are separate
41
+ from spec assertions and are otherwise never checked by anything.
42
+ 6. **Read the diff as one design.** The one judgment call: is there one way of
43
+ doing each thing here, or several? Name specifics — a second helper duplicating
44
+ an existing one, two error-handling styles, inconsistent vocabulary between
45
+ modules. Write down what was checked; never assert it was clean.
46
+
47
+ ## The report
48
+
49
+ ```
50
+ ## Ran every command, its exact invocation, and its raw output
51
+ ## Ordering per assertion: test commit → code commit, or a note that it was not
52
+ ## Coverage every row: satisfied (evidence) | waived (reason) | blocked (what)
53
+ ## One design what was checked for duplication and drift, and what was found
54
+ ```
55
+
56
+ ## What this command refuses
57
+
58
+ Editing code. Running in a session that wrote code. A summary where raw output
59
+ belongs. Marking a row satisfied without evidence. Passing an assertion whose
60
+ declared verification kind was silently downgraded.
61
+
62
+ ## Where it runs
63
+
64
+ Phase 7 of every build, in a fresh agent. In CI on every push, where passes 1 and 4
65
+ are the mechanical half. By hand, whenever anyone wants it. This is also where a
66
+ team that needs a hard block puts one: `/verify` in CI with a non-zero exit is the
67
+ enforcement EDIFY itself does not ship, owned by the people it protects.
@@ -0,0 +1,455 @@
1
+ # Implementation Plan — IRA7 BIOMECH (Phase 1 MVP + Phase 2-5 Roadmap)
2
+
3
+ **Feature ID:** `ira7-biomech-mvp`
4
+ **Trace ID:** IRA7-MVP-2026-05
5
+ **Created:** 2026-05-26 (scope expansion authored after spec.md/prd.md/research.md/data-model.md/contracts/ extensions)
6
+ **Status:** Draft — pending /spec human gate after analyze + checklist
7
+ **Source artifacts:** spec.md, prd.md, research.md, data-model.md, contracts/01..17.md, quickstart.md
8
+ **Downstream consumer:** `/task-manifest` (reads this file to decompose into tasks.md with snippet_refs into the artifacts above)
9
+
10
+ This plan is the architectural handoff document. It tells `/task-manifest` exactly how to decompose the spec into tasks: which phases, what order, which work can parallelize, which files are affected, and where in the code (once code exists) the implementation must integrate. It does NOT write code; it sequences the work and embeds snippet seeds for `/tasks` and `/implement` to consume without exploration.
11
+
12
+ ---
13
+
14
+ ## 1. Phase Sequencing (per CONST-INV-008)
15
+
16
+ 12 milestones across 5 phases. Phase gates must pass before the next phase begins.
17
+
18
+ ```
19
+ Phase 1 (MVP): M1 → M2 → M3 ↘
20
+ M3 → M4 ↘ → M6 → ✅ Phase 1 gate (SC-1..SC-10)
21
+ M3 → M5 ↗
22
+ ↓
23
+ Phase 2: M7 (parallel-eligible with M8) → ✅ Phase 2 gate (SC-11..SC-14)
24
+ M8
25
+ ↓
26
+ Phase 3: M9 → M10 → ✅ Phase 3 gate (SC-15..SC-19)
27
+ ↓
28
+ Phase 4: M11 → ✅ Phase 4 gate (SC-20..SC-23)
29
+ ↓
30
+ Phase 5: M12 → ✅ Phase 5 gate (SC-24..SC-25) → ✅ Roadmap complete
31
+ ```
32
+
33
+ **Dependency rules:**
34
+ - M1 must complete before M2 (CameraX capture screen + Calibration row schema are M2 inputs).
35
+ - M2 must complete before M3, M4, M5 (BlazePose + filter + COM are pillar prerequisites).
36
+ - M3, M4, M5 can run in parallel after M2.
37
+ - M6 must come last in Phase 1 (consumes all upstream Metric rows for UI + export).
38
+ - Phase 2 M7 + M8 can run in parallel after Phase 1 gate (M7 builds frontal capture stack; M8 builds penultimate + initiation + F-v-P which depend only on M3 pipeline + new metric computation).
39
+ - M9 strictly precedes M10 (Pillar D requires 3D triangulation output from M9).
40
+ - M11 precedes M12 (Phase 5 biomech overlay requires Phase 4 tracking + focus).
41
+
42
+ ---
43
+
44
+ ## 2. Per-Milestone Plan
45
+
46
+ ### 2.1 M1 — Capture + Calibration Skeleton *[Phase 1]*
47
+
48
+ **Goal:** CameraX capture screen (30/120/240 fps), static shank-length calibration, basic Session/Trial creation, record-blocked-until-calibrated gate.
49
+
50
+ **FRs covered:** FR-001, FR-002, FR-005, partial FR-029.
51
+ **Gate:** SC-4 (three back-to-back calibrations within ±5% std).
52
+ **Size:** M.
53
+ **Affected files (estimated, prefix `app/src/main/`):**
54
+ - `java/com/ira7/biomech/Ira7Application.kt`
55
+ - `java/com/ira7/biomech/di/AppModule.kt`
56
+ - `java/com/ira7/biomech/capture/CaptureScreen.kt`
57
+ - `java/com/ira7/biomech/capture/CameraAdapter.kt`
58
+ - `java/com/ira7/biomech/capture/CalibrationScreen.kt`
59
+ - `java/com/ira7/biomech/data/db/Ira7Database.kt`
60
+ - `java/com/ira7/biomech/data/db/entities/{Athlete,Session,Calibration,Trial}Entity.kt`
61
+ - `java/com/ira7/biomech/data/db/dao/{Athlete,Session,Calibration,Trial}Dao.kt`
62
+ - `java/com/ira7/biomech/data/db/migrations/MigrationV1.kt`
63
+ - `AndroidManifest.xml`
64
+ - `res/xml/network_security_config_block_all.xml`
65
+ - `build.gradle.kts`
66
+
67
+ **Domains:** mobile, vision (calibration shank detection), data.
68
+
69
+ **Snippet seeds for /task-manifest:**
70
+ - `contracts/01-capture-and-calibration.md` line 1–end (capture + calibration contract)
71
+ - `data-model.md §2.1, §2.2, §2.3, §2.4` (Athlete, Session, Calibration, Trial entities)
72
+ - `research.md §2, §6, §7, §9` (calibration, fps, auto-zoom, CameraX decisions)
73
+ - `spec.md FR-001, FR-002, FR-004, FR-005` (capture FRs)
74
+
75
+ ### 2.2 M2 — BlazePose Inference + Signal Processing *[Phase 1]*
76
+
77
+ **Goal:** Bundled MediaPipe BlazePose, per-frame inference, outlier rejection, Butterworth filter, central-diff differentiation, per-frame re-scaling, out-of-plane motion check, Frame persistence.
78
+
79
+ **FRs covered:** FR-003, FR-006, FR-007, FR-008, FR-009, FR-010, partial FR-004.
80
+ **Gate:** SC-5 (≥85% retention clean, ≥95% rejection occluded).
81
+ **Size:** L.
82
+ **Affected files (estimated):**
83
+ - `assets/models/blazepose.tflite` (bundled model)
84
+ - `java/com/ira7/biomech/vision/BlazePoseInferenceService.kt`
85
+ - `java/com/ira7/biomech/vision/OutlierRejection.kt`
86
+ - `java/com/ira7/biomech/vision/PerFrameRescaler.kt`
87
+ - `java/com/ira7/biomech/vision/InPlaneMotionDetector.kt`
88
+ - `java/com/ira7/biomech/biomech/ButterworthFilter.kt`
89
+ - `java/com/ira7/biomech/biomech/CentralDiffDifferentiator.kt`
90
+ - `java/com/ira7/biomech/biomech/Anthropometry.kt` (de Leva bundled table)
91
+ - `java/com/ira7/biomech/biomech/ComComputer.kt`
92
+ - `java/com/ira7/biomech/data/db/entities/FrameEntity.kt` (full DAO)
93
+ - `java/com/ira7/biomech/data/db/dao/FrameDao.kt`
94
+
95
+ **Domains:** vision, biomech, data.
96
+
97
+ **Snippet seeds:**
98
+ - `contracts/02-pose-and-signal-pipeline.md`
99
+ - `contracts/03-com-and-anthropometry.md`
100
+ - `data-model.md §2.5` (Frame entity)
101
+ - `research.md §1, §3, §4, §5` (BlazePose, filter, outlier, BSP decisions)
102
+
103
+ ### 2.3 M3 — Pillar A (Sprint & Acceleration) *[Phase 1]*
104
+
105
+ **FRs covered:** FR-011..FR-016, partial FR-024.
106
+ **Gate:** SC-3 (GCT ±10 ms vs frame-by-frame), SC-8 (low-fps blocking 100%).
107
+ **Size:** M.
108
+ **Affected files:**
109
+ - `java/com/ira7/biomech/biomech/pillara/{TrunkLeanComputer,ShinAngleComputer,ComVelocityComputer,StepLengthFrequencyComputer,GctComputer,KneeDriveComputer}.kt`
110
+ - `java/com/ira7/biomech/biomech/pillara/PillarAComputer.kt` (aggregator)
111
+ - `java/com/ira7/biomech/biomech/EventDetector.kt` (touchdown/toe-off)
112
+ - `java/com/ira7/biomech/biomech/LsiComputer.kt`
113
+
114
+ **Snippet seeds:** `contracts/04-pillar-a-sprint.md`, `data-model.md §4 Pillar A` canonical metrics.
115
+
116
+ ### 2.4 M4 — Pillar B (Plyometric / Elastic) *[Phase 1]*
117
+
118
+ **FRs covered:** FR-018..FR-021, partial FR-024.
119
+ **Size:** M.
120
+ **Affected files:**
121
+ - `java/com/ira7/biomech/biomech/pillarb/{RsiComputer,LegStiffnessComputer,JumpHeightComputer,AnkleStiffnessComputer}.kt`
122
+ - `java/com/ira7/biomech/biomech/pillarb/PillarBComputer.kt`
123
+
124
+ **Snippet seeds:** `contracts/05-pillar-b-plyometrics.md`.
125
+
126
+ ### 2.5 M5 — Pillar C (Sagittal) + LSI Roll-up *[Phase 1]*
127
+
128
+ **FRs covered:** FR-022, FR-023, completion of FR-024.
129
+ **Size:** S.
130
+ **Affected files:**
131
+ - `java/com/ira7/biomech/biomech/pillarc/{DecelerationComputer,ApproachExitVelocityComputer}.kt`
132
+ - `java/com/ira7/biomech/biomech/pillarc/PillarCSagittalComputer.kt`
133
+
134
+ **Snippet seeds:** `contracts/06-pillar-c-deceleration.md`.
135
+
136
+ ### 2.6 M6 — UI Scrubber + Storage + Export + Drill Catalog + "What's Missing" *[Phase 1]*
137
+
138
+ **FRs covered:** FR-025..FR-035.
139
+ **Gate:** SC-1, SC-2, SC-6, SC-9, SC-10.
140
+ **Size:** L.
141
+ **Affected files (high-level):**
142
+ - `java/com/ira7/biomech/ui/analysis/{FrameScrubberScreen,SynchronizedDataPanel,SessionCompareScreen}.kt`
143
+ - `java/com/ira7/biomech/rules/RuleEngine.kt`
144
+ - `java/com/ira7/biomech/data/db/dao/{Metric,RuleEvaluation,DrillPreset}Dao.kt`
145
+ - `java/com/ira7/biomech/data/db/migrations/MigrationV{3,4,5,6}.kt`
146
+ - `java/com/ira7/biomech/data/export/{CsvExporter,JsonExporter}.kt`
147
+ - `java/com/ira7/biomech/ui/library/VideoLibraryScreen.kt`
148
+ - `assets/rule-catalog.json`, `assets/drill-presets.json`
149
+
150
+ **Snippet seeds:** contracts/07–12 + research §11, §12, §13.
151
+
152
+ ---
153
+
154
+ ### 2.7 M7 — Phase 2 Frontal Capture Stack *[Phase 2]*
155
+
156
+ **Goal:** Two-Phone (sagittal + frontal) topology, FR-045 minimal mode (audio sync only), FR-037 2D-proxy FPPA, FR-038 trunk lean + lateral plant distance.
157
+
158
+ **FRs covered:** FR-001 (frontal-view extension), FR-005, FR-037 (2D proxy), FR-038, FR-045 (minimal mode), partial FR-024 (LSI on FPPA).
159
+ **Gate:** SC-11 (FPPA repeatability ±3°), SC-14 (two-phone concurrent capture 30-rep no-drop), SC-6 re-run on multiphone variant manifest.
160
+ **Size:** L.
161
+ **Domains:** mobile, vision.
162
+ **Migration:** V8 (Metric.quality_flag column for FPPA rotation flag; FPPA + lateral_plant metric name CHECK extensions).
163
+ **Affected files (new + extended):**
164
+ - `java/com/ira7/biomech/capture/MultiPhoneCaptureCoordinator.kt`
165
+ - `java/com/ira7/biomech/capture/HotspotJoinFlow.kt`
166
+ - `java/com/ira7/biomech/capture/SyncEventGenerator.kt`
167
+ - `java/com/ira7/biomech/sync/AudioCrossCorrelator.kt`
168
+ - `java/com/ira7/biomech/data/db/entities/{MultiCameraRigEntity,ClipSyncEventEntity}.kt`
169
+ - `java/com/ira7/biomech/data/db/migrations/MigrationV8.kt`
170
+ - `java/com/ira7/biomech/biomech/pillarc/frontal/{FppaComputer,TrunkLeanComputer,LateralPlantDistanceComputer,RotationFlagDetector}.kt`
171
+ - `java/com/ira7/biomech/biomech/pillarc/frontal/PillarCFrontalComputer.kt`
172
+ - `java/com/ira7/biomech/ui/analysis/TwoViewSideBySideScreen.kt`
173
+ - `AndroidManifest.xml` (multiphone flavor)
174
+ - `res/xml/network_security_config_rfc1918_only.xml`
175
+ - `build.gradle.kts` (product flavor `multiphone`)
176
+ - `app/buildSrc/.../VerifyNoPublicEndpoint.kt` (CI gradle task)
177
+
178
+ **Snippet seeds:**
179
+ - `contracts/14-pillar-c-frontal.md` (FPPA + trunk lean + lateral plant)
180
+ - `contracts/15-multi-phone-3d.md §2.1` (FR-045 minimal mode)
181
+ - `data-model.md §13.1, §13.2, §13.3, §13.5, §15.2`
182
+ - `research.md §19.2, §19.10, §19.11`
183
+
184
+ ### 2.8 M8 — Phase 2 Penultimate-Step + Initiation + F-v-P *[Phase 2]*
185
+
186
+ **FRs covered:** FR-017, FR-036, FR-039.
187
+ **Gate:** SC-12 (penultimate detector accuracy), SC-13 (F-v-P reference range).
188
+ **Size:** M.
189
+ **Affected files:**
190
+ - `java/com/ira7/biomech/biomech/pillarc/frontal/PenultimateStepDetector.kt`
191
+ - `java/com/ira7/biomech/biomech/pillarc/frontal/PenultimateBrakingComputer.kt`
192
+ - `java/com/ira7/biomech/biomech/pillarc/frontal/InitiationLatencyComputer.kt`
193
+ - `java/com/ira7/biomech/biomech/pillara/FvProfileComputer.kt`
194
+ - `java/com/ira7/biomech/biomech/pillara/ExponentialFitter.kt`
195
+ - `assets/rule-catalog.json` (extend with FVP reference ranges + double-flag rule)
196
+ - `java/com/ira7/biomech/ui/analysis/FvProfileChart.kt`
197
+
198
+ **Snippet seeds:**
199
+ - `contracts/13-pillar-a-fv-profile.md`
200
+ - `contracts/14-pillar-c-frontal.md §2.1, §2.4`
201
+ - `data-model.md §15.1, §15.2`
202
+ - `research.md §19.1`
203
+
204
+ ### 2.9 M9 — Phase 3 Multi-Phone Sync + Camera Calibration + 3D Triangulation *[Phase 3]*
205
+
206
+ **FRs covered:** FR-045 (full), FR-046, FR-047.
207
+ **Gate:** SC-15 (sync ≤ 5 ms), SC-16 (calibration ≤ 3 px), SC-17 (3D inter-joint ±2 cm).
208
+ **Size:** L.
209
+ **Migration:** V7 (Trial.topology + Trial.multi_camera_rig_id + Trial.sync_residual_ms + Trial.triangulation_blocked + Trial.pose_dimensionality columns; Frame.camera_index + Frame.pose_model_used columns; MultiCameraRig + CameraExtrinsics + ClipSyncEvent + Pose3DFrame tables).
210
+ **Affected files:**
211
+ - `assets/models/rtmpose_halpe26.tflite`
212
+ - `assets/models/yolov8_small_detector.tflite` (shared with M11)
213
+ - `assets/calibration/charuco_6x8.pdf`
214
+ - `java/com/ira7/biomech/vision/rtmpose/RtmPoseInferenceService.kt`
215
+ - `java/com/ira7/biomech/vision/yolo/YoloDetector.kt`
216
+ - `java/com/ira7/biomech/calibration/CharucoIntrinsicsCalibrator.kt`
217
+ - `java/com/ira7/biomech/calibration/ExtrinsicsSolver.kt`
218
+ - `java/com/ira7/biomech/triangulation/DltTriangulator.kt`
219
+ - `java/com/ira7/biomech/triangulation/RansacInlierSelector.kt`
220
+ - `java/com/ira7/biomech/transfer/LocalFileServer.kt` (Ktor or NanoHTTPD on hotspot)
221
+ - `java/com/ira7/biomech/transfer/ChunkedClipUploader.kt`
222
+ - `java/com/ira7/biomech/data/db/entities/{CameraExtrinsicsEntity,Pose3DFrameEntity}.kt`
223
+ - `java/com/ira7/biomech/data/db/migrations/MigrationV7.kt`
224
+ - `java/com/ira7/biomech/ui/setup/RigSetupWizard.kt`
225
+ - `java/com/ira7/biomech/ui/setup/CalibrationScreen.kt`
226
+ - `java/com/ira7/biomech/ui/setup/SyncTestScreen.kt`
227
+
228
+ **Snippet seeds:**
229
+ - `contracts/15-multi-phone-3d.md` (entire file)
230
+ - `data-model.md §13.3..§13.7, §16` (Phase 3 schema + migration)
231
+ - `research.md §19.3, §19.4, §19.5, §19.6, §19.10`
232
+
233
+ ### 2.10 M10 — Phase 3 Pillar D Kinetics + Honest Labeling *[Phase 3]*
234
+
235
+ **FRs covered:** FR-037 (3D path), FR-040..FR-044.
236
+ **Gate:** SC-18 (estimated-label coverage 100%), SC-19 (error-band disclosure 100%).
237
+ **Size:** L.
238
+ **Migration:** V9 (Metric.unit CHECK extension for newtons_per_kg, watts_per_kg, etc.; Pillar D metric name extensions).
239
+ **Affected files:**
240
+ - `java/com/ira7/biomech/biomech/pillard/JointAngleComputer.kt`
241
+ - `java/com/ira7/biomech/biomech/pillard/JointOmegaComputer.kt`
242
+ - `java/com/ira7/biomech/biomech/pillard/InverseDynamicsComputer.kt`
243
+ - `java/com/ira7/biomech/biomech/pillard/KinematicGrfEstimator.kt`
244
+ - `java/com/ira7/biomech/biomech/pillard/JointPowerWorkComputer.kt`
245
+ - `java/com/ira7/biomech/biomech/pillard/EnergyLabeler.kt`
246
+ - `java/com/ira7/biomech/biomech/pillarc/frontal/KneeAbduction3dComputer.kt` (FR-037 3D path)
247
+ - `java/com/ira7/biomech/ui/analysis/PillarDScreen.kt`
248
+ - `java/com/ira7/biomech/ui/analysis/EstimatedBadge.kt` (reusable UI component for CONST-INV-002)
249
+ - `assets/copy/pillar-d-disclosures.json`
250
+ - `java/com/ira7/biomech/data/db/migrations/MigrationV9.kt`
251
+
252
+ **Snippet seeds:**
253
+ - `contracts/16-pillar-d-kinetics.md` (entire file)
254
+ - `data-model.md §15.3, §16`
255
+ - `research.md §19.7`
256
+
257
+ ### 2.11 M11 — Phase 4 Match Detection + Tracking + Homography + Basic Stats *[Phase 4]*
258
+
259
+ **FRs covered:** FR-033 (consent gate live), FR-048, FR-049, FR-050, FR-051 (Phase 4 subset).
260
+ **Gate:** SC-20 (MOTA ≥ 0.6), SC-21 (homography ≤ 2 m midfield), SC-22 (consent gate 100%), SC-23 (offline operability).
261
+ **Size:** XL.
262
+ **Migration:** V10 (Session.match_id + Session.consent_dismissed_at columns; Match + PlayerTrack + PitchHomography + MatchPlayerStats + PlayerFocus tables).
263
+ **Affected files (high-level):**
264
+ - `assets/models/yolov8_pose.tflite` (shared with M9)
265
+ - `assets/models/tvcalib_pitch.tflite`
266
+ - `java/com/ira7/biomech/match/ConsentGate.kt`
267
+ - `java/com/ira7/biomech/match/MatchCaptureFlow.kt`
268
+ - `java/com/ira7/biomech/match/detection/YoloMatchDetector.kt`
269
+ - `java/com/ira7/biomech/match/tracking/ByteTracker.kt`
270
+ - `java/com/ira7/biomech/match/team/HsvTeamAssigner.kt`
271
+ - `java/com/ira7/biomech/match/homography/PitchKeypointDetector.kt`
272
+ - `java/com/ira7/biomech/match/homography/HomographySolver.kt`
273
+ - `java/com/ira7/biomech/match/homography/KalmanOpticalFlowPropagator.kt`
274
+ - `java/com/ira7/biomech/match/focus/PlayerFocusManager.kt`
275
+ - `java/com/ira7/biomech/match/focus/ReIdentifier.kt`
276
+ - `java/com/ira7/biomech/match/stats/PerPlayerStatsComputer.kt`
277
+ - `java/com/ira7/biomech/data/db/entities/{MatchEntity,PlayerTrackEntity,PitchHomographyEntity,MatchPlayerStatsEntity,PlayerFocusEntity}.kt`
278
+ - `java/com/ira7/biomech/data/db/migrations/MigrationV10.kt`
279
+ - `java/com/ira7/biomech/ui/match/{MatchCaptureScreen,PlayerGridView,PitchHeatmapView,MatchTimelineStrip,FocusedPlayerPanel}.kt`
280
+
281
+ **Snippet seeds:**
282
+ - `contracts/17-match-module.md §1, §2.1..§2.5`
283
+ - `data-model.md §14`
284
+ - `research.md §19.8, §19.12`
285
+
286
+ ### 2.12 M12 — Phase 5 Match Event Stats + Focused-Player Biomech Overlay *[Phase 5]*
287
+
288
+ **FRs covered:** FR-051 (Phase 5 subset), FR-052.
289
+ **Gate:** SC-24 (visibility ≥ 60%), SC-25 (indicative badge 100%).
290
+ **Size:** L.
291
+ **Migration:** V11 (MatchEvent table; MatchPlayerStats event-stat columns).
292
+ **Affected files:**
293
+ - `java/com/ira7/biomech/match/events/{PassDetector,ShotDetector,PossessionTracker,OneVsOneDetector}.kt`
294
+ - `java/com/ira7/biomech/match/events/EventStatsComputer.kt`
295
+ - `java/com/ira7/biomech/match/biomech/FocusedPlayerBlazePoseRoi.kt`
296
+ - `java/com/ira7/biomech/match/biomech/MatchBiomechOverlayComputer.kt`
297
+ - `java/com/ira7/biomech/data/db/entities/MatchEventEntity.kt`
298
+ - `java/com/ira7/biomech/data/db/migrations/MigrationV11.kt`
299
+ - `java/com/ira7/biomech/ui/match/MatchBiomechOverlayScreen.kt`
300
+ - `java/com/ira7/biomech/ui/match/IndicativeBadge.kt` (reusable UI component)
301
+ - Annotate every match-overlay Metric row with `pose_dimensionality = 'match_2d_roi'`
302
+
303
+ **Snippet seeds:**
304
+ - `contracts/17-match-module.md §2.5, §2.6`
305
+ - `data-model.md §14.5, §14.7, §15.5`
306
+ - `research.md §19.9`
307
+
308
+ ---
309
+
310
+ ## 3. Cross-Cutting Concerns by Phase
311
+
312
+ ### 3.1 Build Variant Strategy
313
+
314
+ - `singlephone` variant (default, used by Phase 1 + Phase 2 frontal-only): manifest declines `INTERNET`; `network_security_config_block_all.xml`.
315
+ - `multiphone` variant (Phase 3+): manifest declares `INTERNET` scoped via `network_security_config_rfc1918_only.xml` to RFC1918 subnets; build-time `verifyNoPublicEndpoint` task fails CI on non-RFC1918 references.
316
+
317
+ M7 introduces the variant infrastructure even though it only minimally uses sync. M9 onward fully exercises it.
318
+
319
+ ### 3.2 Migration Strategy
320
+
321
+ Phase 1 owns V1..V6 (per tasks.md §Migration Version Owner Contract). Phase 2-5 own V7..V11:
322
+
323
+ | V | Phase | Milestone | Schema additions |
324
+ |---|---|---|---|
325
+ | V7 | 3 | M9 | Trial Phase 3 columns + Frame Phase 3 columns + MultiCameraRig + CameraExtrinsics + ClipSyncEvent + Pose3DFrame |
326
+ | V8 | 2 | M7 | Metric.quality_flag column + FPPA/lateral metric name CHECK extension |
327
+ | V9 | 3 | M10 | Metric.unit CHECK extension for Pillar D units; Pillar D metric name extension |
328
+ | V10 | 4 | M11 | Session match columns + Match/PlayerTrack/PitchHomography/MatchPlayerStats/PlayerFocus tables |
329
+ | V11 | 5 | M12 | MatchEvent table + MatchPlayerStats event-stat columns |
330
+
331
+ Migration version order is V1..V11 numerically. V8 is allocated to M7 (Phase 2) but applied in numeric order, so a fresh install of a Phase-3 build applies V1..V9 in order (V8 before V9).
332
+
333
+ ### 3.3 Pose Model Asset Bundling
334
+
335
+ - Phase 1+2+5 (training + match focused ROI): BlazePose `.tflite` (~10 MB) bundled in `singlephone` variant and shared by `multiphone` variant.
336
+ - Phase 3 (3D pipeline): RTMPose Halpe-26 `.tflite` (~25 MB) bundled only in `multiphone` variant.
337
+ - Phase 4+5 (match detection): YOLOv8/YOLO11-pose small-class `.tflite` (~10 MB) + TVCalib pitch keypoint `.tflite` (~15 MB) bundled in `multiphone` variant.
338
+
339
+ Total asset bundle: `singlephone` ~10 MB; `multiphone` ~60 MB additional.
340
+
341
+ ### 3.4 UI Reusable Components (introduced incrementally)
342
+
343
+ - `EstimatedBadge` (introduced at M10 for Pillar D, reused at M8 for F-v-P).
344
+ - `IndicativeBadge` (introduced at M12 for match biomech overlay).
345
+ - `TwoViewSideBySideScreen` (introduced at M7).
346
+ - Existing `FrameScrubberScreen` extended at M8 + M10 + M12 for per-phase metric overlays.
347
+
348
+ ### 3.5 Constitutional Enforcement Gates per Phase
349
+
350
+ | Phase | Critical invariant check | Gate event |
351
+ |---|---|---|
352
+ | 1 | CONST-INV-001, -002, -003 (stub), -004, -005, -006, -007 (BlazePose), -008 | M6 gate: SC-6 + SC-7 + SC-9 + SC-10 |
353
+ | 2 | CONST-INV-001 (multiphone manifest scoped), -002 (2D proxy label + FPPA-estimated label), -005 (frontal pre-conditions), -007 (BlazePose extension) | M7 gate: SC-6 re-run on multiphone variant; M8 gate: SC-13 |
354
+ | 3 | CONST-INV-001 (multiphone scoped), -002 (Pillar D estimated label + ±10–20% disclosure), -005 (sync gate + calibration gate + triangulation block), -007 (RTMPose binding) | M9 gate: SC-15, SC-16, SC-17; M10 gate: SC-18, SC-19 |
355
+ | 4 | CONST-INV-001 (no internet during match), -003 (consent gate enforced), -005 (homography degraded tag), -007 (YOLO11-pose binding) | M11 gate: SC-22 + SC-23 + SC-6 re-run |
356
+ | 5 | CONST-INV-002 (indicative badge), -007 (BlazePose on focused ROI binding) | M12 gate: SC-25 |
357
+
358
+ ---
359
+
360
+ ## 4. Parallelization Opportunities
361
+
362
+ | Phase | Within-phase parallel work |
363
+ |---|---|
364
+ | 1 | M3 + M4 + M5 can run concurrently after M2 (different Pillar computers in different packages) |
365
+ | 2 | M7 (frontal capture stack) + M8 (penultimate/initiation/F-v-P) can run concurrently after Phase 1 gate (different domain: M7 is infrastructure, M8 is compute) |
366
+ | 3 | M9 (sync + calibration + triangulation) and M10 (Pillar D) are strictly sequential (M10 consumes M9 output) |
367
+ | 4 | M11 sub-tasks: detection + tracking + team-assign can run concurrently with homography + per-player stats (different files; aggregator in single integration task) |
368
+ | 5 | M12 sub-tasks: event detection + biomech overlay can run concurrently (different files; integration task surfaces both in focused-player panel) |
369
+
370
+ Cross-phase parallelization is forbidden by CONST-INV-008 phase sequencing.
371
+
372
+ ---
373
+
374
+ ## 5. Estimated Affected-File Count per Phase
375
+
376
+ | Phase | Milestone | Estimated new files | Estimated extended files |
377
+ |---|---|---|---|
378
+ | 1 | M1..M6 | ~60 | ~5 (manifest, build.gradle) |
379
+ | 2 | M7..M8 | ~25 | ~6 (CaptureScreen, AndroidManifest variant, rule-catalog) |
380
+ | 3 | M9..M10 | ~35 | ~3 (FrameScrubberScreen, AnalysisScreen) |
381
+ | 4 | M11 | ~25 | ~5 |
382
+ | 5 | M12 | ~10 | ~3 |
383
+ | **Total** | **M1..M12** | **~155** | **~22** |
384
+
385
+ ---
386
+
387
+ ## 6. Risks (Phase 2-5 specific; carried from spec.md §11)
388
+
389
+ | Risk | Phase | Mitigation in plan |
390
+ |---|---|---|
391
+ | R-10 (FPPA 2D-proxy rotation bias) | 2 | M7 includes RotationFlagDetector + quality_flag column (V8 migration) |
392
+ | R-11 (F-v-P body mass error) | 2 | M8 includes reference-range deviation flag (SC-13); F-v-P "estimated" badge |
393
+ | R-12 (multi-camera calibration error) | 3 | M9 enforces calibration-quality gate (≤3 px reprojection); re-capture flow on failure |
394
+ | R-13 (homography failure on camera pan) | 4 | M11 includes KalmanOpticalFlowPropagator with extrapolated tagging (CONST-INV-005 spirit) |
395
+ | R-14 (ByteTrack ID switches on jersey similarity) | 4 | M11 includes coach team-override UX (US-035); jersey-number OCR deferred to Phase 4b polish |
396
+ | R-15 (multi-phone manifest INTERNET nuance) | 3, 4 | Variant build flavor + network-security-config + verifyNoPublicEndpoint CI gate (M7 introduces, M9 fully exercises) |
397
+
398
+ ---
399
+
400
+ ## 7. Handoff Seeds for /task-manifest
401
+
402
+ For each milestone, `/task-manifest` should produce task entries with `snippet_refs` pointing to the artifacts below. Each ref is `(file, line_start, line_end, reason)`.
403
+
404
+ ### M7 handoff seeds (per task-manifest consumption)
405
+
406
+ ```json
407
+ {
408
+ "milestone": "M7",
409
+ "snippet_refs": [
410
+ {"file": "specs/ira7-biomech-mvp/contracts/14-pillar-c-frontal.md", "line_start": 1, "line_end": 100, "reason": "FPPA + trunk lean + lateral plant contract"},
411
+ {"file": "specs/ira7-biomech-mvp/contracts/15-multi-phone-3d.md", "line_start": 30, "line_end": 110, "reason": "FR-045 minimal mode (audio sync only)"},
412
+ {"file": "specs/ira7-biomech-mvp/data-model.md", "line_start": 700, "line_end": 850, "reason": "Trial extensions + MultiCameraRig + ClipSyncEvent (Phase 3 schema applied to Phase 2 minimal mode)"},
413
+ {"file": "specs/ira7-biomech-mvp/data-model.md", "line_start": 1100, "line_end": 1200, "reason": "Pillar C frontal canonical metric names"},
414
+ {"file": "specs/ira7-biomech-mvp/research.md", "line_start": 1, "line_end": 100, "reason": "research §19.2 frontal topology + §19.10 variant manifest + §19.11 rotation flag (search by section markers)"},
415
+ {"file": "specs/ira7-biomech-mvp/spec.md", "line_start": 1, "line_end": 100, "reason": "FR-037, FR-038, FR-045 specs (search by FR markers)"}
416
+ ]
417
+ }
418
+ ```
419
+
420
+ Other milestones follow the same pattern; `/task-manifest` should also pull the relevant prd.md user stories (US-019..US-035) and spec.md success criteria (SC-11..SC-25) per the M7-M12 bullet lists in prd.md §8.
421
+
422
+ ---
423
+
424
+ ## 8. /task-manifest Re-Run Plan
425
+
426
+ The existing tasks.md (57 tasks, 6 phases, 34 FRs mapped) is Phase 1 only. After this plan.md lands and the human gate passes, `/task-manifest` should be re-run with the following posture:
427
+
428
+ 1. **Preserve Phase 1 tasks verbatim.** task-1-1..task-6-19 are approved and locked. Re-running task-manifest must NOT modify them.
429
+ 2. **Add new phase-task blocks for M7..M12.** Estimated task count per phase: M7 ~12 tasks, M8 ~8 tasks, M9 ~14 tasks, M10 ~12 tasks, M11 ~22 tasks, M12 ~10 tasks. Total ~78 new tasks, bringing tasks.md to ~135 total.
430
+ 3. **Update tasks.md §Phase Summary** table with the new milestones.
431
+ 4. **Update tasks.md §Migration Version Owner Contract** with V7..V11.
432
+ 5. **Re-run snippet_refs verification** for any task that references contracts/ files (the new files 13-17) or data-model.md sections (the new §13–§17).
433
+
434
+ ---
435
+
436
+ ## 9. Plan Quality Self-Check
437
+
438
+ | Check | Pass |
439
+ |---|---|
440
+ | Every milestone has FRs + gate (SC reference) + size + affected files | yes |
441
+ | Phase sequencing per CONST-INV-008 explicitly enforced | yes (§1 dependency rules) |
442
+ | Parallelization opportunities identified | yes (§4) |
443
+ | Constitutional enforcement gates listed per phase | yes (§3.5) |
444
+ | Migration version allocation documented | yes (§3.2) |
445
+ | Build variant strategy documented | yes (§3.1) |
446
+ | Pose model asset bundling documented | yes (§3.3) |
447
+ | Risks mapped to mitigation in plan | yes (§6) |
448
+ | Snippet seeds for /task-manifest provided | yes (§7) |
449
+ | /task-manifest re-run posture defined | yes (§8) |
450
+
451
+ ---
452
+
453
+ **Status:** Draft for /spec human gate. After approval, `/task-manifest` re-runs to extend tasks.md with Phase 2-5 task decomposition; engineering lead approves the extended tasks.md at the standard task-manifest human gate; then `/tasks` produces phase-N.json contracts for each phase as needed.
454
+
455
+ **End of plan.md.**