feat(agent)!: build into a caller-owned graph config instead of the internal registry - #100
Merged
Conversation
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tablassert agentnow requires--configuration-file/-fpointing at a caller-owned Graph YAML: theagent reads its
fullmap/name/version/rig:from that graph, audits each article with a one-tablecopy of it, and appends successful absolute table-config paths back to that same file — replacing the
synthesized
<state-dir>/graph.yamlregistry.CLI surface
--configuration-file/-freplaces--fullmap; validated bygraph_target.prepare_graphbefore any model, secret, or fetch work. PMC ids stay positional.rebuild-agent-graphcommand and--fullmapparsing —tests/test_cover_cli.pylocks both rejections.
Target graph mechanics (
src/tablassert/graph_target.py)prepare_graph: resolves the YAML to an absolute path, validates theGraph, and resolvesfullmap+rig.artifact_base_pathagainst the graph's directory — in memory only; the file and allexisting table YAMLs are never rewritten.
append_successful_config: rereads the target under an exclusive<graph>.lockflock, drops theentry matching the config's basename stem, appends the new absolute path, re-validates, and persists
via tmp +
os.replace. Malformed targets raise without quarantine or overwrite.MAPPED/BUILT_UNMEASUREDappend; a failed rerun leaves the prior entry andbest config untouched.
Supervisor semantics
invocation while
state.jsonkeeps attempts and coverage history. Only successful results atomicallyrewrite
configs/<pmc_id>.yamland update the target graph.normalize_agent_table_configmakes every generatedsource.localabsolute(bases: cwd,
state_dir, artifact root, graph dir); user-authored table YAMLs are never rewritten.run_supervisor/make_tools/build_and_auditaccept the preparedGraph; one-table audits deep-copy it, keepname/version/fullmap/fullrig:, redirect onlyrig.artifact_base_pathintobuilds/<pmc>/artifacts/, and passaudit_sources=Falseso a one-tableaudit never trips the full-table-set RIG cross-check.
fullmap/name/versionkwargs remain for direct callers; the CLIpath never uses them.
In-process build core
build_graph_pipeline(graph, ...)frombuild_pipeline(src/tablassert/cli.py) so agentaudits reuse the production stages without loading every table already in the target graph;
build-kgbehavior is unchanged.
Design
agent_0.0.1metadata and enforced a first-winsfullmap rule that could disagree with the graph users actually build. The supplied graph is now the
single source of build identity and the single aggregation point.
tablesentries andsource.localvalues are absoluteby design (buildable from any CWD); the workspace is not relocatable without rerunning or fixing
paths. Documented in
docs/agent.md.state.json: the checkpoint read-modify-write stays per-workspace and unlocked;concurrent agents sharing one target graph must use separate
--state-dirs or disjoint PMC sets. Thegraph file itself is flock-safe.
src/tablassert/graph_registry.py(−215) andtests/test_graph_registry.py(−313) are deletedoutright — no compatibility shim.
Docs & examples
docs/agent.md— rewrites the workspace layout, checkpoint/rerun, and concurrency narrative around thecaller-owned graph;
docs/cli.md— updates theagentflag table and drops therebuild-agent-graphsection.
examples/agent/— README commands now use--configuration-file; the QC scripts glob<name>_<version>.*artifacts instead of hardcodedagent_0.0.1names.Testing
uv run --extra qc --extra agent pytest -q→929 passed, 13 skipped(94% coverage).uv run ruff check .+uv run ruff format --check .→ clean.uv run --extra qc --extra agent pyright→0 errors, 0 warnings.cargo test --manifest-path rust/Cargo.toml→69 + 10 passed(1 ignored);cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings→ clean.tests/test_graph_target.py: prepare-without-rewrite, metadata-preserving replace, malformed-targetrejection, and an 8-process concurrent-append test that loses no entries.
TARGET_KG_9.0.0.nodes.ndjson, noagent_0.0.1), failed reruns preserve the prior entry/config, successful reruns keep exactly one entryper PMC, and terminal +
BUILT_UNMEASUREDrecords are reprocessed on later invocations.