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.
16 lines
347 B
Python
16 lines
347 B
Python
"""Shared exception types."""
|
|
|
|
__all__ = ["BackendError", "Denied"]
|
|
|
|
|
|
class BackendError(Exception):
|
|
def __init__(self, message, status=0):
|
|
super().__init__(message)
|
|
self.status = status
|
|
|
|
|
|
class Denied(Exception):
|
|
def __init__(self, guidance=""):
|
|
super().__init__("denied by user")
|
|
self.guidance = guidance
|