Skip to content

Phase1 implementation - #1

Merged
tchxm merged 4 commits into
mainfrom
phase1-implementation
Sep 19, 2026
Merged

tchxm merged 4 commits into
mainfrom
phase1-implementation

Conversation

@tchxm

@tchxm tchxm commented Sep 19, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI lite review requested due to automatic review settings September 19, 2026 19:07
@tchxm
tchxm merged commit 97c8d35 into main Sep 19, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Critical security and integrity findings remain unresolved, along with moderate correctness and test-coverage issues.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 8 High severity · 5 Medium severity · 1 Low severity

Open (14)
What changed in this PR

Phase 1 adds validated intent handling, guarded Terraform execution, structured errors, tests, and a standalone PlanBound browser demonstration.

Changes:

  • Adds Lambda memory and S3 tag intent parsing and validation.
  • Strengthens workspace, evaluation, contract, and apply safeguards.
  • Adds browser routes, lifecycle/accessibility tooling, verification scripts, and evidence artifacts.
File Change / final review notes
tests/​test_phase1.py Phase 1 tests. Moderate (1 vote): live interpretation E2E is skipped without Ollama. Moderate (1 vote): live S3-tag E2E is similarly skipped.
tests/​test_chaos.py Updated Cedar failure expectations.
engine/​types/​__init__.py Adds EVALUATION_ERROR.
engine/​pipeline.py Integrates intent, modes, guards, and evaluation. Critical (2 votes): intent is excluded from the confirmation integrity hash. Moderate (3 votes): broad TypeError fallback can retry editing without intent.
engine/​intent/​__init__.py Intent extraction and validation. Includes the reported critical trailing-newline validation issue (1 vote), moderate missing-value, case-preservation, compound-operation, JSON-shape, optional-import, transport-error, and numeric-prefix issues, plus the nit production test-prompt shortcut.
engine/​guard.py Workspace and Terraform checks. Critical (1 vote): arbitrary .terraform directories are accepted. Critical (1 vote): .tf.json files can bypass checks. Critical (2 votes): live runs use the poisoned bypass and skip exact attribute comparison.
engine/​gate.py Apply-gate checks. Critical (2 votes): non-dict verdicts can allow apply. Critical (1 vote): canonical and verdict data are not bound to the hashed plan.
engine/​exceptions.py Structured domain exceptions.
engine/​evaluator/​__init__.py Typed Cedar failure handling.
engine/​contract/​__init__.py Intent-scoped contract drafting.
engine/​api.py Structured API errors and intent endpoint.
engine/​agent.py Intent-scoped live editing tools. Critical (1 vote): Team validation admits trailing newlines.
docs/​evidence/​local-apply.json Refreshed apply evidence.
design/​site-evidence/​verification.json Browser verification evidence.
design/​site-evidence/​keyboard.json Keyboard evidence.
design/​site-evidence/​index.html Evidence gallery.
design/​site-evidence/​final-regression.json Regression evidence.
design/​site-evidence/​download.json Exported evidence.
design/​SITE_SELF_REVIEW.md Site review documentation. Nit (3 votes): the untouched-backend statement contradicts the pull request changes.
design/​SITE_README.md Site usage documentation.
design/​planbound/​site.css Site styling and responsive rules.
design/​planbound/​site-views.js Browser routes and views.
design/​planbound/​site-ui.js UI and accessibility helpers.
design/​planbound/​site-support.js Lifecycle and event management.
design/​planbound/​site-engine.js Sample-plan engine.
design/​planbound/​site-app.js Site integration and routing. Moderate (2 votes): repeated homeState renders accumulate observers and frame callbacks.
design/​planbound/​site_verify.py Browser verification runner.
design/​planbound/​site_smoke.py Browser smoke checks.
design/​planbound/​site_regression.py Browser regression checks.
design/​planbound/​site_keyboard.py Keyboard checks.
design/​planbound/​build_site.py Standalone site builder.
Files not reviewed (6)
  • design/planbound/site-app.js: Generated file
  • design/planbound/site-engine.js: Generated file
  • design/planbound/site-support.js: Generated file
  • design/planbound/site-ui.js: Generated file
  • design/planbound/site-views.js: Generated file
  • design/planbound/site.css: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread engine/agent.py
"""Set only the Team tag on aws_s3_bucket.assets to the confirmed value."""
if team != target_team:
raise ValueError(f"The confirmed contract permits only Team={target_team!r}, got {team!r}")
if not re.match(r"^[a-zA-Z0-9_-]{1,32}$", team):
Comment thread engine/gate.py
Comment on lines +20 to +24
# Evaluation error verification: Cedar failures cannot become approvable REVIEWs
eval_errors = [
v
for v in verdicts
if isinstance(v, dict)
Comment thread engine/gate.py

def apply_saved(contract, run, resolutions):
reason = gate_reason(contract, run.get("verdicts"), resolutions)
reason = gate_reason(contract, run.get("verdicts"), resolutions, canonical=run.get("canonical"))
Comment thread engine/guard.py
Comment on lines +40 to +44
if entry.is_dir():
if entry.name != ".terraform":
raise ValueError(
f"Unexpected directory in workspace: {entry.name}. Arbitrary directory structures are rejected."
)
Comment thread engine/guard.py
Comment on lines +46 to +48
if entry.name.endswith(".tfplan") or entry.name.endswith(".json"):
# Generated plan artifacts
continue
Comment thread engine/intent/__init__.py
Comment on lines +213 to +221
match = re.search(
r"(?:team\s*tag\s*(?:to|=)?\s*|team\s*=\s*|tag\s+team\s+to\s+)([a-zA-Z0-9_-]+)",
lower,
)
if not match:
match = re.search(
r"(?:add|set|update)\s+team\s+tag\s+([a-zA-Z0-9_-]+)", lower
)
team_val = match.group(1) if match else "core"
Comment thread engine/intent/__init__.py
Comment on lines +333 to +337
except Exception as exc:
if isinstance(exc, ModelUnavailableError):
raise
raise AmbiguousRequestError(
f"Failed to parse model intent output: {exc}",
Comment thread engine/intent/__init__.py
Comment on lines +341 to +346
op = data.get("operation", "unsupported")
if op == "unsupported":
raise UnsupportedOperationError(
f"The AI model identified this request as outside supported capabilities: {task}",
details={"task": task, "model_response": data},
)
Comment thread engine/pipeline.py
Comment on lines +100 to +102
log = live_edit(t["contract"]["task"], workspace, intent=t.get("intent"), adversarial=False)
except TypeError:
log = live_edit(t["contract"]["task"], workspace)

Final SHA-256: `af58e20e2482cef6bb832672d33bdc61e5cffec299af266fcc80b1c08357c352`.

The existing Part 1 artifact and its source modules were not edited. `build_site.py` wraps their output with scoped lifecycle hooks, singleton-canvas sizing, live tree/robot state, routing and the new views. No application backend, Cedar policy, canonicalizer, apply-gate implementation or existing test was changed.
tchxm added a commit that referenced this pull request Sep 20, 2026
@tchxm
tchxm deleted the phase1-implementation branch September 20, 2026 09:13
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.

2 participants