Split monolithic tai.py into tai_pkg package, keep tai-orig.py as original
tai.py (8643 lines) is now a thin facade over tai_pkg/ (33 feature modules, one class or feature per file). tai-orig.py preserves the pre-split single-file version byte for byte (sha256 verified against snapshot); import tai and ./tai.py behavior unchanged. Equivalence proof, all run on this tree immediately pre-commit: differential battery tai-orig.py vs facade 3718 checks 0 failures (surface, pure fuzz, tool dispatch, store/audit, release ops, fake-HOME install roundtrip, CLI runs); test_tai.py 261 OK; test_seal.py 16 OK; --version/--help byte-identical; dir(tai) zero removals. Fix included: opencode wire-protocol schema echo leaked into replies; opencode_parse now scans with JSONDecoder.raw_decode capped at 200 scans (13 OpencodeParseTests). Test count 261 = 237 HEAD + 8 pre-existing uncommitted ToolArgumentsTests (now committed with this change, disclosed) + 13 OpencodeParseTests + 3 EmbeddedStringsTests. Patch-target-only test migration (24 hunks), zero assertion changes. tai_pkg clean-regenerated after mid-verification tamper was found and reverted.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
- Use plain `import` and `from` statements in Python files.
|
||||
- Use the `.py` extension for Python source and test files.
|
||||
- Keep source files at the repository top level.
|
||||
- Implementation lives in `tai_pkg/`, one feature per module, grouped into classes (instance classes for stateful clusters, static utility classes for stateless groups). `tai.py` is the thin facade: CLI entry plus the stable `import tai` surface re-exported from `tai_pkg`. Canonical patch targets are `tai_pkg.<module>.<Class>.<name>` (or the module attribute for module-level data); never patch through the `tai.` facade copies.
|
||||
- There are two kinds of test, in two different places, on purpose — see "Testing" below for the full split. In short: unit tests are top-level `test_*.py`; integration tests are `tests/<topic>.py` (no `test_` prefix) built on `tai_test.py`.
|
||||
|
||||
## Testing
|
||||
|
||||
Reference in New Issue
Block a user