Skip to content

feat: add agent artifact bundle#203

Merged
ProfRandom92 merged 2 commits into
mainfrom
feat/agent-artifact-bundle
May 22, 2026
Merged

feat: add agent artifact bundle#203
ProfRandom92 merged 2 commits into
mainfrom
feat/agent-artifact-bundle

Conversation

@ProfRandom92
Copy link
Copy Markdown
Owner

Adds a minimal deterministic agent artifact bundle script for AI-assisted work evidence.

Includes:

  • scripts/agent_artifact_bundle.py
  • deterministic JSON output
  • branch and changed-file evidence
  • safe_pr_gate result reuse
  • validation evidence via repeated CLI flags
  • optional MCP context output reference
  • focused tests
  • artifact validation skill doc update

Scope

Local evidence bundling only. No network, no external APIs, no runtime execution, no timestamps, no random IDs.

Validation

  • python -m compileall -q scripts/agent_artifact_bundle.py
  • pytest tests/test_agent_artifact_bundle.py -q

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new script, scripts/agent_artifact_bundle.py, designed to generate deterministic evidence bundles for AI-assisted workflows, accompanied by documentation and a comprehensive test suite. The script integrates with the safe_pr_gate module to evaluate the current branch state and include validation evidence. The review feedback focuses on improving the robustness of the output by suggesting that the top-level status fields (ok and result) should dynamically reflect the underlying safety gate evaluation rather than being hardcoded to success. Additionally, it is recommended that the script return a non-zero exit code when the safety gate fails to ensure that calling processes, such as CI/CD pipelines, can correctly detect and respond to failures.

Comment thread scripts/agent_artifact_bundle.py Outdated
Comment on lines +76 to +77
"ok": True,
"result": "PASS",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The top-level ok and result fields are currently hardcoded to True and "PASS". This is misleading if the underlying safe_pr_gate evaluation fails. These fields should reflect the aggregate status of the bundle based on the gate result to ensure the evidence bundle accurately represents the work state.

Suggested change
"ok": True,
"result": "PASS",
"ok": safe_pr_gate_result.ok,
"result": "PASS" if safe_pr_gate_result.ok else "FAIL",
References
  1. Maintain strictness in data processing to ensure the output accurately represents the state.

Comment thread scripts/agent_artifact_bundle.py Outdated
mcp_context_output_ref=args.mcp_context_output_ref,
)
sys.stdout.write(json.dumps(bundle, indent=2, sort_keys=True) + "\n")
return 0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The main function always returns 0 on success, even if the safety gate failed. To be consistent with safe_pr_gate.py and to allow calling processes (such as CI/CD pipelines or git hooks) to detect and react to failures, it should return a non-zero exit code when the bundle status is not ok.

Suggested change
return 0
return 0 if bundle["ok"] else 1
References
  1. Ensure failures are visible in CI rather than failing silently.

@ProfRandom92 ProfRandom92 merged commit 52da23a into main May 22, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant