Implement source-backed NetKingdom agent security knowledge pilot
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a101af-e240-7882-a1e3-e37720cbdbea
This commit is contained in:
parent
caa7da2397
commit
a835c11ae7
54 changed files with 3634 additions and 27 deletions
26
tools/export_knowledge.py
Normal file
26
tools/export_knowledge.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Export a self-contained orientation bundle into a new directory (no overwrite)."""
|
||||
from pathlib import Path
|
||||
import argparse
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))
|
||||
from emergent_security.knowledge import Knowledge, confined
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("destination", type=Path)
|
||||
args = parser.parse_args()
|
||||
package = Knowledge()
|
||||
args.destination.mkdir(parents=True, exist_ok=False)
|
||||
for name in ["release.yaml", *package.release["files"]]:
|
||||
target = confined(args.destination, name)
|
||||
target.parent.mkdir(parents=True, exist_ok=True)
|
||||
shutil.copyfile(confined(package.root, name), target)
|
||||
print(f"Exported orientation-only package {package.catalog['version']} ({package.package_digest})")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue