Add machine-facing agent API and structured DSL ergonomics for deterministic, low-ambiguity workflows#1321
Draft
Add machine-facing agent API and structured DSL ergonomics for deterministic, low-ambiguity workflows#1321
Conversation
Open
Agent-Logs-Url: https://github.com/SkBlaz/py3plex/sessions/d3b9524e-566e-4164-98f8-c710dc0c94ea Co-authored-by: SkBlaz <10035780+SkBlaz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve ergonomics of py3plex for LLM-based agents
Add machine-facing agent API and structured DSL ergonomics for deterministic, low-ambiguity workflows
Mar 29, 2026
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.
This PR makes py3plex materially easier for LLM/agent workflows by adding a thin stable task API and structured pre-execution/query-result surfaces. It targets ambiguity traps (replica vs physical nodes, degree semantics, grouped top-k semantics) while preserving existing DSL behavior.
Machine-facing task API (
py3plex.agent)load_network_from_pathtop_hubs_by_layeruncertainty_centralitycommunity_detection_with_uqtemporal_slicereproducible_export_bundlecompare_networkssummarize_resultstatus,assumptions,warnings,result,provenance,replay,export_paths.Structured validation + plan introspection
QueryBuilder.validate()returning structured data for agent preflight:QueryBuilder.explain_plan_json()for machine-readable plan preview without execution.Ambiguity-safe helpers in core DSL/result surfaces
top_k_global(...)top_k_per_layer(...)top_k_across_layers(...)QueryResult:replica_nodes()physical_nodes()kindsupport in compute AST path (compute(..., kind=...)->ComputeItem.kind) to explicitly carry degree intent.Structured diagnostics/warnings contract
STRUCTURED_WARNING_CATALOG+build_structured_warning(...)with stable fields:code,severity,message,cause,likely_intent,suggested_fixes,autofixableCanonical machine serialization on query results
summary_dict()inspect_json()canonical_export_dict()Agent regression coverage
tests/test_agent_api.pyfor:py3plex/agent.pyis covered at 100%.Example
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.