5.1 KiB
5.1 KiB
AI Dev Plan (Must-Haves Only)
Purpose
This is the minimum implementation needed for AI to reliably build, test, and debug TalkEdit with high confidence.
Target: reliable 80-90% autonomous implementation/debugging on scoped tasks.
Must-Have Pillars
1. Single Validation Command
Required:
- One command that runs lint, build, backend tests, and smoke checks.
- Works locally and in CI.
Current status:
- Implemented via scripts/validate-all.sh.
- Enforced in CI via .github/workflows/validate-all.yml.
2. CI Quality Gate
Required:
- Pull requests fail if validation fails.
- Failures produce diagnostics artifacts.
Current status:
- Implemented in .github/workflows/validate-all.yml.
- Diagnostics collected by scripts/collect-diagnostics.sh on failure.
3. Spec Requirement for Feature Changes
Required:
- Feature code changes must include a spec file update.
- Spec format must be standardized.
Current status:
- Implemented via scripts/check-feature-spec.sh.
- Spec template exists at docs/spec-template.md.
- Specs folder guidance exists at docs/specs/README.md.
4. Backend Contract Test Coverage
Required:
- Router-level contract tests for success and error paths.
- Tests are deterministic and mock heavy services.
Current status:
- Implemented in backend/tests/test_router_contracts.py.
- Cache utility baseline tests implemented in backend/tests/test_cache_utils.py.
5. Error-Tolerant Router Contracts
Required:
- Expected client errors must remain 4xx.
- Server failures must return 5xx with useful detail.
Current status:
- Implemented for captions/export HTTPException passthrough.
- Covered by contract tests.
6. Basic Autonomy Policy
Required:
- Clear autonomous scope and escalation rules.
- Clear restrictions for high-risk changes.
Current status:
- Implemented in docs/ai-policy.md.
Must-Have Remaining Work
No remaining must-have items.
Completed in this pass:
- Added lightweight frontend tests and integrated them into scripts/validate-all.sh.
- Added pull request template with required spec link and acceptance criteria checklist.
- Added endpoint-level contract assertions for /file range requests and /audio/waveform cache-hit/cache-miss behavior.
- Confirmed scripts/validate-all.sh passes end-to-end with frontend tests + expanded backend contracts.
Out of Scope for Must-Have Baseline
Useful later, but not required for strong day-to-day autonomous implementation:
- Full quality dashboards.
- Advanced autonomy telemetry.
- Complete long-term governance expansion.
- High-autonomy optimization beyond 90% reliability target.
Definition of Done (Must-Have Plan)
Must-have plan is complete when all are true:
- scripts/validate-all.sh passes locally and in CI.
- Feature PRs without spec updates are blocked.
- Backend router contracts cover core success and error paths.
- Frontend has at least one stable test command integrated into validation.
7. AI Tools Validation Strategy
Required:
- Per-edit validation: After each code change (file edit, replacement, or creation), validate immediately with appropriate tools.
- Tool selection by change type:
- Frontend changes: ESLint (
npm run -s lint), then TypeScript build (npm run build) - Backend changes: Syntax check via Python import, then run relevant test suite
- Type/interface changes: Full type check via build or
tsc -b
- Frontend changes: ESLint (
- Failure handling: If validation fails, fix immediately before proceeding to next edit.
- Documentation updates: When changing architecture, always update .github/copilot-instructions.md as part of the same PR.
- Large multi-edit operations: Use
multi_replace_string_in_fileto batch independent edits and reduce tool call overhead. - Error collection: Use
get_errorstool to identify issues across multiple files in one call post-change.
Current implementation:
- Electron removal completed with post-edit lint and build validation at each phase.
- Zone editor feature implemented with immediate lint/build validation after component creation and UI integration.
- Validation tools:
npm run -s lint,npm run build,get_errors,run_in_terminalfor test scripts.
Best practices established:
- Always run lint before build to catch TypeScript errors early
- Run full build after component changes to verify tree-shaking and bundling
- Use
get_errorsfor multi-file error detection rather than sequential file reads - Batch unrelated edits with
multi_replace_string_in_filefor efficiency - Cache key decisions in session memory to avoid repeated exploration
- AI policy + diagnostics workflow are active.
Current State Summary
Completed:
- Validation and CI enforcement.
- Diagnostics capture.
- Spec policy and templates.
- Backend contract test foundation (including AI endpoints).
- Core router error-path correctness.
- Autonomy policy baseline.
- Frontend test command integrated into validation.
- PR template requirement added.
- /file and /audio/waveform contract assertions implemented.
Remaining:
- No must-have items remaining.