2ed2b3ae0f
One nova/<name>.py per user-facing core/ module. Each ≤50 lines, ≤3 FunctionDef (add_parser + run [+1 helper]), every user-function call resolves to a core.* import, no `if` statements except `if __name__`. Subcommands: - nova resolve → core.contract_resolver.resolve - nova decommission → core.decommission_transform.decommission_transform - nova env-transition detect|record → core.env_transition - nova env-check → core.environment_check.check - nova hitl → core.hitl_gates.attest (+ approver_from_env) - nova onboard → core.onboarding.generate_env_file - nova outbox → core.outbox_writer.write_event - nova publish-outputs → core.output_publisher.publish_to_ssm + format_comment - nova policy → core.policy_engine.get_engine + get_policy_root (status) - nova regression → core.regression_verify.run_regression + write_report - nova sod → core.separation_of_duties.check - nova readiness → core.submission_readiness.cli_main - nova attestation-matrix → core.attestation_matrix.cli_main (new thin wrapper) - nova confidence → core.confidence_signal.cli_main (new thin wrapper) core wrappers added (minimal): attestation_matrix.cli_main, confidence_signal.cli_main — extracted from their __main__ blocks so the nova subcommands stay thin. ---ci--- project: acdl phase: 1 milestone: v1.28 status: execute persona: cli-engineer ---/ci---
30 lines
853 B
Python
30 lines
853 B
Python
"""nova resolve — resolve a contract YAML to a Target Stack JSON."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
|
|
from core.contract_resolver import resolve
|
|
from core import env
|
|
|
|
|
|
def add_parser(subparsers):
|
|
p = subparsers.add_parser("resolve", help="resolve a contract.yml to stack JSON")
|
|
p.add_argument("contract")
|
|
p.add_argument("out")
|
|
p.add_argument("--environment", default=None)
|
|
p.set_defaults(_run=run)
|
|
|
|
|
|
def run(args) -> int:
|
|
env_override = args.environment or env.get_env("ENVIRONMENT_OVERRIDE")
|
|
result = resolve(args.contract, environment_override=env_override)
|
|
with open(args.out, "w") as fh:
|
|
json.dump(result, fh, indent=2)
|
|
print(f"resolve: wrote {args.out}")
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
import sys
|
|
print("use: nova resolve <contract.yml> <out.json>", file=sys.stderr) |