임상 관찰 증거 출력을 고정
This commit is contained in:
parent
3b540a881f
commit
081d9d70fb
1 changed files with 17 additions and 1 deletions
|
|
@ -470,13 +470,29 @@ def _parser() -> argparse.ArgumentParser:
|
|||
required=True,
|
||||
help="증거에 고정할 UTC ISO-8601 시각(예: 2026-08-28T12:00:00Z)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--output",
|
||||
type=Path,
|
||||
help="JSON을 저장할 저장소 내부 경로. 생략하면 stdout으로 출력한다.",
|
||||
)
|
||||
return parser
|
||||
|
||||
|
||||
def main(argv: list[str] | None = None) -> int:
|
||||
args = _parser().parse_args(argv)
|
||||
payload = asyncio.run(build_observations(args.generated_at))
|
||||
print(json.dumps(payload, ensure_ascii=False, indent=2))
|
||||
rendered = json.dumps(payload, ensure_ascii=False, indent=2) + "\n"
|
||||
if args.output is None:
|
||||
print(rendered, end="")
|
||||
else:
|
||||
output_path = args.output if args.output.is_absolute() else REPO_ROOT / args.output
|
||||
output_path = output_path.resolve()
|
||||
try:
|
||||
output_path.relative_to(REPO_ROOT.resolve())
|
||||
except ValueError as error:
|
||||
raise SystemExit("--output은 저장소 내부 경로여야 한다") from error
|
||||
output_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
output_path.write_text(rendered, encoding="utf-8")
|
||||
return 1 if payload["summary"]["technical_fail_count"] else 0
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue