@@ -81,7 +81,7 @@ The second argument is auto-detected:
8181
8282When an issue number is given, the optional third argument provides additional instructions on top of the issue context.
8383
84- The ` run.sh ` script overrides the container's default CMD to run ` python /app/entrypoint.py ` (batch mode) instead of the uvicorn server.
84+ The ` run.sh ` script overrides the container's default CMD to run ` python /app/src/ entrypoint.py ` (batch mode) instead of the uvicorn server.
8585
8686### Environment Variables
8787
@@ -320,24 +320,45 @@ docker images bgagent-local --format "{{.Size}}"
320320agent/
321321├── Dockerfile Python 3.13 + Node.js 20 + Claude Code CLI + git + gh + mise (default platform linux/arm64)
322322├── .dockerignore
323- ├── pyproject.toml App dependencies (claude-agent-sdk, FastAPI, boto3, OpenTelemetry distro, MCP, …)
323+ ├── pyproject.toml App dependencies (claude-agent-sdk, FastAPI, boto3, OpenTelemetry distro, MCP, cedarpy, …)
324324├── uv.lock Locked deps for reproducible `uv sync` in the image
325325├── mise.toml Tool versions / tasks used when the target repo relies on mise
326- ├── entrypoint.py Config, context hydration, ClaudeSDKClient pipeline, metrics, run_task()
327- ├── server.py FastAPI — async /invocations (background thread) and /ping; OTEL session correlation
328- ├── task_state.py Best-effort DynamoDB task status (no-op if TASK_TABLE_NAME unset)
329- ├── observability.py OpenTelemetry helpers (e.g. AgentCore session id)
330- ├── memory.py Optional memory / episode integration for the agent
331- ├── prompts/ Per-task-type system prompt workflows
332- │ ├── __init__.py Prompt registry — assembles base template + workflow for each task type
333- │ ├── base.py Shared base template (environment, rules, placeholders)
334- │ ├── new_task.py Workflow for new_task (create branch, implement, open PR)
335- │ ├── pr_iteration.py Workflow for pr_iteration (read feedback, address, push)
336- │ └── pr_review.py Workflow for pr_review (read-only analysis, structured review comments)
337- ├── system_prompt.py Behavioral contract (PRD Section 11)
326+ ├── src/ Agent source modules (pythonpath configured in pyproject.toml)
327+ │ ├── __init__.py
328+ │ ├── entrypoint.py Re-export shim for backward compatibility (tests); delegates to specific modules
329+ │ ├── config.py Configuration: build_config(), get_config(), resolve_github_token(), TaskType validation
330+ │ ├── models.py Data models and enumerations (TaskType StrEnum with is_pr_task property)
331+ │ ├── pipeline.py Top-level pipeline: main() CLI entry, run_task() orchestration
332+ │ ├── runner.py Agent runner: run_agent() — ClaudeSDKClient connect/query/receive_response
333+ │ ├── context.py Context hydration: fetch_github_issue(), assemble_prompt() (local/dry-run only)
334+ │ ├── prompt_builder.py System prompt assembly + memory context, repo config scanning
335+ │ ├── hooks.py PreToolUse hook callback for Cedar policy enforcement (Claude Agent SDK hooks)
336+ │ ├── policy.py Cedar policy engine — in-process cedarpy evaluation, fail-closed, deny-list model
337+ │ ├── post_hooks.py Deterministic post-hooks: ensure_committed, ensure_pushed, ensure_pr, verify_build, verify_lint
338+ │ ├── repo.py Repository setup: clone, branch, git auth, mise trust/install/build/lint
339+ │ ├── shell.py Shell utilities: log(), run_cmd(), redact_secrets(), slugify(), truncate()
340+ │ ├── telemetry.py Metrics, disk usage, trajectory writer (_TrajectoryWriter with write_policy_decision)
341+ │ ├── server.py FastAPI — async /invocations (background thread) and /ping; OTEL session correlation
342+ │ ├── task_state.py Best-effort DynamoDB task status (no-op if TASK_TABLE_NAME unset)
343+ │ ├── observability.py OpenTelemetry helpers (e.g. AgentCore session id)
344+ │ ├── memory.py Optional memory / episode integration for the agent
345+ │ ├── system_prompt.py Behavioral contract (PRD Section 11)
346+ │ └── prompts/ Per-task-type system prompt workflows
347+ │ ├── __init__.py Prompt registry — assembles base template + workflow for each task type
348+ │ ├── base.py Shared base template (environment, rules, placeholders)
349+ │ ├── new_task.py Workflow for new_task (create branch, implement, open PR)
350+ │ ├── pr_iteration.py Workflow for pr_iteration (read feedback, address, push)
351+ │ └── pr_review.py Workflow for pr_review (read-only analysis, structured review comments)
338352├── prepare-commit-msg.sh Git hook (Task-Id / Prompt-Version trailers on commits)
339353├── run.sh Build + run helper for local/server mode with AgentCore constraints
340- ├── tests/ pytest unit tests for pure functions and prompt assembly
354+ ├── tests/ pytest unit tests (pythonpath: src/)
355+ │ ├── test_config.py Config validation and TaskType tests
356+ │ ├── test_hooks.py PreToolUse hook and hook matcher tests
357+ │ ├── test_models.py TaskType enum tests
358+ │ ├── test_policy.py Cedar policy engine tests (fail-closed, deny-list)
359+ │ ├── test_pipeline.py Pipeline orchestration tests (cedar_policies injection)
360+ │ ├── test_shell.py Shell utility tests (slugify, redact_secrets, truncate, format_bytes)
361+ │ └── ...
341362├── test_sdk_smoke.py Diagnostic: minimal SDK smoke test (ClaudeSDKClient → CLI → Bedrock)
342363└── test_subprocess_threading.py Diagnostic: subprocess-in-background-thread verification
343364```
0 commit comments