Implement KG-WP-0002 posture pilot scaffold
This commit is contained in:
parent
6cee3503da
commit
3c549d9b78
22 changed files with 1418 additions and 25 deletions
49
src/kings_guard/main.py
Normal file
49
src/kings_guard/main.py
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
|
||||
from kings_guard.adapters import observation_from_audit_event
|
||||
from kings_guard.contracts import as_jsonable
|
||||
from kings_guard.fixtures import load_qonto_assistant_pilot
|
||||
from kings_guard.posture import PostureEvaluator
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser(description="Run the Kings Guard pilot posture demo.")
|
||||
parser.add_argument(
|
||||
"--pilot",
|
||||
default="qonto-assistant",
|
||||
choices=["qonto-assistant"],
|
||||
help="Pilot bundle to evaluate.",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.pilot != "qonto-assistant":
|
||||
raise SystemExit(f"Unsupported pilot: {args.pilot}")
|
||||
|
||||
fixture = load_qonto_assistant_pilot()
|
||||
observation = observation_from_audit_event(
|
||||
fixture.audit_event,
|
||||
subject_id=fixture.normalization_hints["subject_id"],
|
||||
capability_scope=fixture.normalization_hints["capability_scope"],
|
||||
identity_binding=fixture.normalization_hints["identity_binding"],
|
||||
egress_destination=fixture.normalization_hints["egress_destination"],
|
||||
)
|
||||
evaluation = PostureEvaluator().evaluate(fixture.genome, observation)
|
||||
print(
|
||||
json.dumps(
|
||||
{
|
||||
"pilot": args.pilot,
|
||||
"source_notes": list(fixture.source_notes),
|
||||
"observation": as_jsonable(observation),
|
||||
"evaluation": as_jsonable(evaluation),
|
||||
},
|
||||
indent=2,
|
||||
sort_keys=True,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue