Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .agents/skills/launch-openshell-gator/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ For gator's PR/issue validation policy, load `gator-gate` inside the launched sa
| Path | Purpose |
|---|---|
| `scripts/agents/run.sh` | Manifest-driven OpenShell agent launcher. |
| `scripts/agents/gator/agent.yaml` | Gator manifest: default gateway, harness, providers, runtime, skills, and subagents. |
| `scripts/agents/gator/agent.yaml` | Gator manifest: immutable payload version, default gateway, harness, providers, runtime, skills, and subagents. |
| `scripts/agents/gator/Dockerfile` | Gator sandbox image source. Local launches build this image through OpenShell. |
| `scripts/agents/gator/policy.yaml` | Sandbox policy for the gator agent. |
| `scripts/agents/gator/bin/gh` | Gator-specific `gh` wrapper and same-SHA duplicate-post guard. |
| `scripts/agents/gator/bin/review-feedback-ledger` | Builds tree-aware review scope, durable findings, convergence telemetry, and checkpoint state. |
| `scripts/agents/gator/bin/validate-review-findings` | Enforces the blocker evidence schema and downgrades unsupported hypotheses. |
| `scripts/agents/gator/prompts/gator.md` | Rendered top-level prompt template baked into the payload. |
| `scripts/agents/gator/skills/gator-gate/SKILL.md` | In-sandbox gator state-machine skill. |
| `scripts/agents/gator/logs/` | Background launch and supervisor logs. |
Expand Down Expand Up @@ -283,6 +285,7 @@ Read that file directly. Important markers:
- `OpenAI Codex v...` plus `model: ...` confirms the Codex CLI and model actually used.
- `OPENSHELL_AGENT_RESULT {...}` is the bounded-cycle sentinel. In watch mode, the supervisor sleeps and relaunches after this line.
- `openshell-agent: still running watch cycle ...` is a heartbeat during long active model cycles.
- `review_feedback_lookup_failed` means Gator could not build the required cross-SHA feedback ledger and deliberately skipped a context-free review.

### Inspect Active Sandboxes

Expand All @@ -305,13 +308,20 @@ If `sandbox get` is not supported by the local CLI shape, use `openshell sandbox
| `status=waiting` | Normal watch wait. | Leave sandbox running. |
| `status=blocked` | Human/process blocker. | Read reason; decide whether a human action is needed. |
| `status=transient_failure` | Retryable infrastructure/auth/transport issue. | Let supervisor retry unless repeated failures hit the configured cap. |
| `status=terminal_failure` | Unrecoverable agent failure. | Inspect log and fix/relaunch. |
| `status=terminal_failure` | Unrecoverable or stale immutable payload. | Inspect the reason; rebuild/relaunch for `stale_gator_payload`. |
| `status=complete` | Target closed, merged, or one-shot complete. | Delete sandbox if no longer needed. |

## Restarting A Gator

Restart when the payload must change, the sandbox is wedged without a sentinel, the model/tooling version changed, or a transient failure repeats past the useful retry point.

Increment `payload_version` in `scripts/agents/gator/agent.yaml` whenever a
merged change alters the Gator prompt, gate skill, reviewer contract, write
guard, ledger, or bundled validator. Existing immutable watchers cannot replace
their own payload. New-version watchers detect later published versions and
stop with `stale_gator_payload`; relaunch every still-active older watcher after
the version bump is published.

Before deleting, check that the sandbox is truly stale or that the operator asked for a restart. If a bounded review cycle is actively running and still producing useful output, prefer leaving it alone.

```bash
Expand Down
84 changes: 81 additions & 3 deletions .claude/agents/principal-engineer-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,63 @@ When reviewing code or diffs:
4. Call out issues by severity:
- **Critical** — Must fix before merge. Correctness bugs, security flaws,
data loss risks.
- **Warning** — Should fix. Error handling gaps, unclear contracts, missing
edge cases.
- **Suggestion** — Consider improving. Style, naming, minor simplifications.
- **Warning** — Must fix before merge when the change introduces or
materially worsens a concrete, reachable correctness, security, or
maintainability problem.
- **Suggestion** — Non-blocking improvement. Never require another revision
solely for a suggestion.
5. Reference specific files and line numbers (`file_path:line_number`).
6. When suggesting a change, show the concrete fix — don't just describe it.
7. If something is good, say so briefly. Positive signal is useful too.
8. When behavior, commands, or development workflows change, consult the `sync-agent-infra` maintenance map and verify that related skills were updated. Apply its full consistency checklist when the changes add, remove, or rename skills or crates; change workflow relationships or skill coverage; modify issue or PR templates; or change agent cross-references. Report missing companion updates or drift as a warning.
9. When the task includes a prior review feedback ledger, treat trusted resolved
or explicitly waived findings as durable across later revisions. Do not
re-raise the same finding with different wording unless the new diff
materially invalidates the prior rationale or reintroduces the defect. If
it does, identify the new evidence and explain why the earlier disposition
no longer applies.

### Pragmatic review calibration

- Review against the pull request's stated intent, supported user paths,
documented threat model, and established repository invariants.
- Make a finding blocking only when the scenario is concretely reachable, the
impact is material, the pull request introduces or materially worsens it, and
the proposed fix is proportionate to the risk.
- For every blocker, state reachability, impact, and why the pull request owns
the problem.
- Do not block on pre-existing or orthogonal defects, unsupported
configurations, speculative future requirements, stylistic preference, or
implausible failure combinations outside an adversarial trust boundary.
Mention valuable follow-up hardening as non-blocking.
- Account for implementation cost. Do not demand branching, abstraction,
configuration, or defensive machinery that makes the code harder to read and
maintain than the risk warrants.
- Treat attacker-controlled input at a real trust boundary as reachable even
when an honest user would not supply it. Pragmatism does not weaken
default-deny behavior or excuse concrete security regressions.
- On an initial review, inspect the complete change and report the complete
known blocker set. Group related examples under one root-cause invariant.
- On a follow-up review, carry existing obligations without duplicating them,
verify prior fixes, and review only the delta since the previous reviewed
head. Do not mine unchanged code for new findings.
- Raise a new unchanged-code blocker only when newly available evidence
demonstrates a Critical security, data-loss, or correctness defect. Explain
the evidence and why the initial review could not reasonably identify it.
- Treat pre-existing security issues as private security follow-up, not public
blockers on the current pull request. Treat other pre-existing defects as
non-blocking follow-up work.
- Keep docs, skill drift, diagnostic wording, and test-strength feedback
advisory unless the published contract is materially false, the diagnostic
creates an operational or safety failure, or missing coverage leaves a
concrete regression introduced by the change undetectable.
- If remediation expands into a new subsystem, crosses an explicit non-goal,
or creates new public configuration or policy, stop and request a maintainer
scope decision instead of extending the autonomous review.
- For a security-sensitive state machine, evaluate the applicable matrix of
protocol adapters, identity replacement, revocation timing, snapshot versus
live state, fallback behavior, and trust-boundary transitions. Group failures
under the governing invariant instead of reporting one matrix cell per pass.

When reviewing plans or architecture documents:

Expand Down Expand Up @@ -100,12 +150,40 @@ Structure your review clearly:

Omit empty sections. Keep it concise — density over length.

For each Critical or Warning finding, include:

- The stable finding ID when the task supplies an ID format
- The concrete reachable scenario
- The attacker or operator prerequisite
- The supported entry point and effectful sink
- The changed location that introduces or worsens the exposure
- The base behavior compared with head behavior
- The material impact
- Why the current change owns or worsens the problem
- A minimal deterministic test or constrained reproducer
- A proportionate requested fix

Keep Suggestions explicitly non-blocking. On follow-up reviews, do not repeat
Suggestions from an earlier review.

When the task supplies the Gator review findings contract, return only its JSON
envelope. Populate every evidence field from the supplied code and diff. Do not
invent missing evidence: leave the field absent so the validator downgrades the
proposal to a hypothesis. In `human_checkpoint` mode, return only Critical
defects introduced by the latest author delta.

## Security analysis

Apply this protocol when reviewing changes that touch security-sensitive areas:
sandbox runtime, policy engine, network egress, authentication, credential
handling, or any path that processes untrusted input (including LLM output).

Apply the pragmatic calibration above to security findings too. A real
attacker-controlled boundary makes an adversarial input reachable, but
pre-existing or orthogonal hardening does not become blocking merely because it
can be assigned a CWE. Explain how the current change introduces or materially
worsens the exposure.

1. **Threat modeling** — Map the data flow for the change. Where does untrusted
input (from an LLM, user, or network) enter? Where does it exit (to a
shell, filesystem, network, or database)? Identify trust boundaries that
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,14 @@ jobs:
# Podman 4.x. The probe records whether AppArmor blocks the drop.
- runner: ubuntu-24.04
podman_major: "4"
podman_package_version: "4.9.3+ds1-1ubuntu0.2"
conmon_package_version: "2.1.10+ds1-1build2"
# Ubuntu 26.04 provides the supported Podman 5.x coverage for
# comparison with the Ubuntu 24.04 environment.
- runner: ubuntu-26.04
podman_major: "5"
podman_package_version: "5.7.0+ds2-3build1"
conmon_package_version: "2.1.13+ds1-2"
env:
IMAGE_TAG: ${{ inputs.image-tag }}
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -193,9 +197,20 @@ jobs:
openssh-client \
passt \
pkg-config \
podman \
"conmon=${{ matrix.conmon_package_version }}" \
"podman=${{ matrix.podman_package_version }}" \
slirp4netns \
uidmap
# Hosted runners can place newer Podman and conmon binaries under
# /usr/local ahead of Ubuntu's packages. Select the distro CLI and
# use Podman's supported final config override for its conmon path.
podman_config="${RUNNER_TEMP}/openshell-containers.conf"
printf '%s\n' \
'[engine]' \
'conmon_path = ["/usr/bin/conmon"]' \
> "${podman_config}"
echo "/usr/bin" >> "${GITHUB_PATH}"
echo "CONTAINERS_CONF_OVERRIDE=${podman_config}" >> "${GITHUB_ENV}"

- name: Configure rootless Podman
run: |
Expand All @@ -218,6 +233,10 @@ jobs:
"${{ matrix.podman_major }}".*) ;;
*) echo "ERROR: expected Podman ${{ matrix.podman_major }}.x, found $podman_version" >&2; exit 1 ;;
esac
test "$(dpkg-query -W -f='${Version}' podman)" = "${{ matrix.podman_package_version }}"
test "$(dpkg-query -W -f='${Version}' conmon)" = "${{ matrix.conmon_package_version }}"
test "$(command -v podman)" = "/usr/bin/podman"
test "$(podman info --format '{{.Host.Conmon.Path}}')" = "/usr/bin/conmon"
test "$(podman info --format '{{.Host.Security.Rootless}}')" = "true"
test "$(sudo sysctl -n kernel.apparmor_restrict_unprivileged_userns)" = "1"
echo "=== host ==="
Expand Down
Loading
Loading