Datasets:
Formats:
json
Languages:
English
Size:
< 1K
Tags:
artificial-intelligence
recursive-self-improvement
continual-learning
representation-learning
world-models
cognitive-architecture
File size: 1,306 Bytes
1c1abed | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | """Fresh-process regenerative execution of a frozen quotient program."""
from __future__ import annotations
import argparse
import json
from pathlib import Path
import sys
from .core import Capsule, FrozenModel
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("capsule", type=Path, help="JSON containing frozen program and surviving coded seed")
parser.add_argument("--word", default="", help="comma-separated chronological action names")
args = parser.parse_args()
try:
obj = json.loads(args.capsule.read_text(encoding="utf8"))
status, seed = Capsule.from_json(obj["memory"]).recover()
if status != "exact":
print(json.dumps({"status": status, "output": None}))
return 2
model = FrozenModel.from_json(obj["program"], seed=seed)
word = tuple(a for a in args.word.split(",") if a)
print(json.dumps({"status": "exact", "output": model.run(word).tolist(),
"rank": len(seed), "source_state_present": False}))
return 0
except (ValueError, KeyError, OSError, TypeError) as exc:
print(json.dumps({"status": "error", "detail": str(exc)}), file=sys.stderr)
return 1
if __name__ == '__main__':
raise SystemExit(main())
|