Repository navigation
Phases 1-2: Repository setup, docs, and gateway extraction (partial) - #1
Closed
james-in-a-box[bot] wants to merge 3 commits into
Closed
james-in-a-box[bot] wants to merge 3 commits into
james-in-a-box[bot] wants to merge 3 commits into
Conversation
Implement Phase 1 of the egg extraction plan: - Create repository structure with gateway/, sandbox/, cli/, shared/, tests/ - Add pyproject.toml with uv for dependency management - Add GitHub Actions workflows (lint.yml, test.yml) - Add ./dev wrapper script for CI parity (runs act locally) - Add pre-commit configuration - Add Dependabot configuration - Write README.md with architecture overview - Write CONTRIBUTING.md with development guidelines - Add egg.yaml.example and secrets.yaml.example - Create module structure with __init__.py files - Add initial unit tests for module imports - Add docs/testing.md and docs/architecture.md This establishes the infrastructure before extracting gateway code in Phase 2. Authored-by: jib
Extract and create documentation for the egg repository: - docs/security.md: Core security model and threat mitigations - docs/adr/git-isolation-architecture.md: Git worktree isolation ADR - docs/adr/credential-injection.md: Credential injection ADR - docs/configuration.md: Configuration reference - docs/setup.md: Setup guide - docs/api.md: Gateway API reference - docs/troubleshooting.md: Common issues and solutions Security documentation extracted from james-in-a-box ADRs: - ADR-Gateway-Credential-Injection.md - ADR-Git-Isolation-Architecture.md - ADR-Anthropic-API-Credential-Injection.md All docs regenerated for egg (no james-specific references). Authored-by: jib
Add core shared modules: - shared/egg_config/loader.py: YAML config loading with env var expansion - shared/egg_config/validators.py: Config validation utilities - shared/egg_logging/logger.py: Structured JSON/console logging Add first gateway module: - gateway/policy.py: Policy engine for branch ownership and access control - Parameterized for egg (configurable bot_name, branch_prefix) - Removed james-in-a-box specific references - Uses EGG_TRUSTED_USERS instead of GATEWAY_TRUSTED_USERS Remaining Phase 2 tasks: - Port session_manager, git_client, github_client, worktree_manager - Port remaining supporting modules - Port gateway.py Flask app - Port test files Authored-by: jib
This was referenced Feb 3, 2026
james-in-a-box Bot
pushed a commit
that referenced
this pull request
Feb 7, 2026
Fix critical issues from review:
- Task ID convention mismatch: Parser now generates task-{phase}-{number}
format matching CLI expectations (Issue #3)
- Integer parsing vulnerability: Added parse_task_id() and parse_phase_id()
helpers with proper validation and error handling (Issue #1)
- URL parameter injection: Use urllib.parse.urlencode for query params (Issue #2)
- Placeholder task numbering: Use task_number=1 instead of 0 (Issue #5)
- Silent failure in shell script: gh_api_safe now sets GH_API_FAILED flag
and returns empty JSON for graceful fallback (Issue #6)
Additional improvements:
- Updated Task model pattern to accept task-P-N format
- Added comprehensive test coverage for error paths
- Added edge case tests for plan parser
- All 73 tests pass, ruff linter clean
Authored-by: egg
jwbron
added a commit
that referenced
this pull request
Feb 7, 2026
* Implement Phase 3: Agent CLI and prompt integration Add the agent-facing components for the SDLC pipeline: - Contract CLI (egg-contract) for agents to interact with contract state: - show: Display current contract state - add-commit: Link commits to tasks - update-notes: Add implementation notes - mark-task/mark-phase: Update status (reviewer role) - add-decision: Create HITL decision points - Agent rules file (contract.md) with CLI usage guidance - Document templates for refine and plan phases: - analysis.md: Problem analysis template - plan.md: Implementation plan template with task ID format - SDLC prompt builder that provides phase-specific context and instructions to the agent - Plan parser for extracting tasks from plan documents: - Parses [TASK-X-Y] patterns from markdown - Supports YAML front matter for structured task definitions - Generates placeholder tasks for empty phases - Produces warnings for parse issues - Unit tests for plan parser and contract CLI Issue: #133 Authored-by: egg * Fix bash syntax error in build-sdlc-prompt.sh Change the inner heredoc delimiter in the PR format example from 'EOF' to 'BODY' to avoid conflicting with the outer heredoc delimiter. The 'EOF' on line 363 was being interpreted as the end of the outer heredoc (starting at line 322), causing a syntax error on the closing ')'. Authored-by: egg * Fix lint and type errors in Phase 3 contracts code - Fix import sorting in shared/egg_contracts/__init__.py (I001) - Fix import sorting in tests/sandbox/test_contract_cli.py (I001) - Fix unused variable in tests/sandbox/test_contract_cli.py (F841) - Fix import sorting and remove unused import in tests/shared/egg_contracts/test_plan_parser.py (I001, F401) - Fix mypy type annotation in shared/egg_contracts/plan_parser.py - Fix mypy no-any-return errors in sandbox/egg_lib/contract_cli.py - Apply ruff formatting fixes Authored-by: egg * Address code review feedback for Phase 3 implementation Fix critical issues from review: - Task ID convention mismatch: Parser now generates task-{phase}-{number} format matching CLI expectations (Issue #3) - Integer parsing vulnerability: Added parse_task_id() and parse_phase_id() helpers with proper validation and error handling (Issue #1) - URL parameter injection: Use urllib.parse.urlencode for query params (Issue #2) - Placeholder task numbering: Use task_number=1 instead of 0 (Issue #5) - Silent failure in shell script: gh_api_safe now sets GH_API_FAILED flag and returns empty JSON for graceful fallback (Issue #6) Additional improvements: - Updated Task model pattern to accept task-P-N format - Added comprehensive test coverage for error paths - Added edge case tests for plan parser - All 73 tests pass, ruff linter clean Authored-by: egg * Remove unused GH_API_FAILED variable from build-sdlc-prompt.sh The GH_API_FAILED variable was declared and set but never read, triggering shellcheck SC2034 warning. The variable has been removed as the functionality was never implemented. Authored-by: egg * Address remaining PR review feedback - Fix add-decision RBAC: Add decisions.* to FIELD_OWNERSHIP with IMPLEMENTER role, allowing implementers to create decisions while only humans can resolve them. - Fix array append in validator: Handle appending to arrays when idx == len(array) by appending instead of raising IndexError. Also handle the case in apply_mutation where old_value doesn't exist yet for append operations. - Document race condition in add-decision: Added comments explaining the TOCTOU race condition between reading decision count and submitting mutation. Gateway should handle conflicts. - Fix mark-task/mark-phase role documentation: Updated docstrings and help text to clarify these operations require REVIEWER role. - Add commit SHA validation: New validate_commit_sha() function validates 7-40 character hex strings for git SHAs. - Fix short question ellipsis: Only append "..." if question is longer than 50 characters. - Add comprehensive tests for new functionality including commit SHA validation and array append operations. Authored-by: egg * Fix ruff format issue in contract_cli.py Collapse multi-line ValueError string to single line to satisfy ruff format requirements. Authored-by: egg * Address low-severity review feedback - Add integration tests verifying plan parser task IDs are compatible with the CLI's parse_task_id() function - Add RETURN trap in gh_api_safe() to clean up temp files on interruption - Refactor MockGatewayHandler to use a factory function that creates handler classes with isolated responses, ensuring thread safety when running tests in parallel - Generate unique HEREDOC delimiter using random suffix to prevent injection if issue body contains the delimiter string Authored-by: egg --------- Co-authored-by: jwbron <8340608+jwbron@users.noreply.github.com> Co-authored-by: james-in-a-box[bot] <246424927+james-in-a-box[bot]@users.noreply.github.com>
This was referenced Feb 7, 2026
This was referenced Jul 2, 2026
This was referenced Jul 2, 2026
This was referenced Jul 3, 2026
This was referenced Jul 21, 2026
This was referenced Jul 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.
Summary
Implement Phase 1, 1.5, and partial Phase 2 of the egg extraction plan.
Phase 1: Repository Infrastructure (Complete)
Phase 1.5: Documentation (Complete)
Phase 2: Gateway Extraction (In Progress)
Completed:
Remaining:
Issue: none
Test plan:
./dev setup./dev native lint- should pass./dev native test- tests should passfrom gateway.policy import PolicyEngineworksAuthored-by: jib