AirPlan V2 initial release — unified scheduler with 12 sub-modes
Merges 8 V1 plugins into 1 unified plugin, adds 4 new components (dep, tst, sec, rvr). 12 sub-modes: arc, eng, do, dbg, xdb, sdb, ndb, ctx, dep, tst, sec, rvr. L1 code-level guarantees: atomic writes, file locks, evidence gating, forced debug routing, 3-phase arc gate, evidence-first debug gate, Chinese language lock, scheduler boundary. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
35
lib/air_runtime/modes/tst_mode.py
Normal file
35
lib/air_runtime/modes/tst_mode.py
Normal file
@@ -0,0 +1,35 @@
|
||||
"""AirTst mode — V2 测试运行器。"""
|
||||
|
||||
from pathlib import Path
|
||||
from air_runtime.test_runtime import TestRunner
|
||||
from air_runtime.io import safe_json_load
|
||||
from air_runtime.paths import airplan_root, event_log_path
|
||||
from air_runtime.events import EventLog, TEST_RUN
|
||||
|
||||
|
||||
def main(args) -> None:
|
||||
project_root = Path(args.project).expanduser().resolve()
|
||||
tid = args.task_id
|
||||
sub = args.sub or "status"
|
||||
|
||||
if sub == "run" and args.framework:
|
||||
runner = TestRunner()
|
||||
result = runner.run(tid, project_root, args.framework)
|
||||
|
||||
log = EventLog(event_log_path(project_root))
|
||||
log.emit(TEST_RUN, {
|
||||
"taskId": tid,
|
||||
"framework": result.framework,
|
||||
"total": result.total,
|
||||
"passed": result.passed,
|
||||
"failed": result.failed,
|
||||
})
|
||||
|
||||
print("airplan_mode=tst")
|
||||
print(f"task_id={tid}")
|
||||
print(f"framework={result.framework}")
|
||||
print(f"total={result.total} passed={result.passed} failed={result.failed}")
|
||||
else:
|
||||
paths = airplan_root(project_root) / "state" / "airtst"
|
||||
state = safe_json_load(paths / "state.json") or {}
|
||||
print(f"airplan_mode=tst\nenabled={state.get('enabled', False)}")
|
||||
Reference in New Issue
Block a user