feat(ai): add recursive agent composition analysis#159
Merged
Conversation
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.
Summary
agentparsing and IR for scoped nested agents, explicit authority/context grants, output visibility, orchestration edges, failure policy, and lightweight contract rule metadata.fslc ai checkstructural analysis for agent graphs with deterministicagent_irand graph summaries.ai_componenthard-contract lowering/replay behavior and extends docs, examples, schemas, skill reference, LSP indexing, and corpus snapshots.Why
sub_agentconcept.What Changed
agentblocks, bracketed lists, grants, visibility, orchestration, failure policy, trust labels, review gates, andcontract { hard { rule ... } }metadata.agent_structural_violationfindings for authority exceedance, low-trust reachability to high-authority tools, irreversible tools without human approval, review bypass, and sibling visibility leaks.fslc ai checknow handles bothai_componentandagent; regularfslc checkaccepts agent files for corpus parse/semantic sweeps without claiming kernel proof.Blast Radius
src/fslc/ai_*, CLI AI commands, LSP raw-tree parser selection, AI finding schema, examples/docs/skills, corpus snapshot.ai_componentsyntax, check result, replay result, and focused tests remain unchanged.Invariants
ai_componentremains backward-compatibletests/test_ai_hard_contract.pyformal_result: "not_run"tests/docsFailure Modes
outputand agent output visibilityEvidence
.venv/bin/python -m pytest tests/test_ai_recursive_agent.py tests/test_ai_hard_contract.py -q-> 18 passed.venv/bin/python -m pytest tests/test_corpus_snapshot.py -q-> 176 passed, 1 skipped.venv/bin/python -m pytest -q-> 1004 passed, 78 skippedgit diff --checkRollout & Rollback
agentsyntax is additive.ai_componentbehavior is isolated from the new structural analyzer.Review Focus
src/fslc/ai_parser.py: grammar remains unambiguous and preservesai_componentsyntax.src/fslc/ai_agent.py: grant subset and graph findings match Implement recursive agent composition for fsl-ai #157 semantics.docs/DESIGN-ai-hard.md/docs/LANGUAGE.md: proof boundary is clear.Related
Closes #157