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
10 changes: 8 additions & 2 deletions .agent-runtime.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
version: 1
runtime:
provider: codex-cli
executor_command: "python3 scripts/adapters/codex_cli_executor.py"
provider: codex-sdk
executor_command: "python3 scripts/adapters/codex_sdk_executor.py"
fallback_provider: codex-cli
fallback_executor_command: "python3 scripts/adapters/codex_cli_executor.py"
transport: local_subscription
api_required: false
model_router: false
model: gpt-5.6-sol
reasoning_effort: high
service_tier: fast
require_account_type: chatgpt
10 changes: 5 additions & 5 deletions .agent-workflows.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 1
workflows:
full_agent_workflow:
description: "Run deterministic harness stages and the agent-role chain with one run id, task worktree, scoped context manifests, strict role results, and safe publication routing."
description: "Run deterministic harness stages and the agent-role chain with one run id, one explicit workspace mode, scoped context manifests, strict role results, and safe publication routing."
budgets:
max_roles: 40
max_repair_iterations: 12
Expand All @@ -18,8 +18,8 @@ workflows:
max_repair_iterations: 24
max_duration_seconds: 14400
max_tokens: 3000000
runtime_provider: codex-cli
executor: "python3 scripts/agent_role_runner.py --workflow full_agent_workflow --run-id {run_id} --task-id {task_id} --goal {goal} --project {project} --repo {repository} --branch {branch} --base-branch {base_branch} --artifacts-dir {artifacts_dir} --create-worktree --runtime-provider {runtime_provider}"
runtime_provider: codex-sdk
executor: "python3 scripts/agent_role_runner.py --workflow full_agent_workflow --run-id {run_id} --task-id {task_id} --goal {goal} --project {project} --repo {repository} --branch {branch} --base-branch {base_branch} --artifacts-dir {artifacts_dir} --runtime-provider {runtime_provider}"
max_iterations: 1
timeout_seconds: 14400
retry:
Expand All @@ -28,7 +28,7 @@ workflows:
trace_store: ".agent-runs/<run-id>/raw-events/workflow.jsonl"
steps:
- name: "agent_role_chain"
command: "python3 scripts/agent_role_runner.py --workflow full_agent_workflow --run-id {run_id} --task-id {task_id} --goal {goal} --project {project} --repo {repository} --branch {branch} --base-branch {base_branch} --artifacts-dir {artifacts_dir} --create-worktree --runtime-provider {runtime_provider}"
command: "python3 scripts/agent_role_runner.py --workflow full_agent_workflow --run-id {run_id} --task-id {task_id} --goal {goal} --project {project} --repo {repository} --branch {branch} --base-branch {base_branch} --artifacts-dir {artifacts_dir} --runtime-provider {runtime_provider}"
publish_pr:
description: "Validate, stage an allowlisted change set, commit, push, and create or update a PR when policy gates allow it."
budgets:
Expand Down Expand Up @@ -88,7 +88,7 @@ workflows:
- "invalid artifacts"
- "destructive or policy-denied action"
mutation_rules:
- "Commit, push, and create or update the PR from the exact task worktree and branch recorded in workflow.json."
- "Commit, push, and create or update the PR from the exact checkout_path and task_branch recorded in workflow.json."
- "Never create a second publication-only worktree or copy changes between unrelated checkouts."
- "Never use git add -A."
- "Stage only paths listed in artifacts/change_set.json include and not matched by exclude."
Expand Down
2 changes: 1 addition & 1 deletion .agent/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ project:
base_branch: main
branch_prefix: feat/
runtime:
provider: codex-cli
provider: codex-sdk
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ A task is not done until:
## Persistent repository rules
- Treat any migration, auth, permission, session, CSRF, production settings, secret-management, webhook, payment, billing, or irreversible side-effect change as elevated risk.
- Keep local agent memory private; do not copy private issue journals into public PR text unless explicitly approved and sanitized.
- Route every model-backed role through the provider-neutral `Runtime` contract. In Step 2 only local-subscription `codex-cli` is a production runtime; direct provider SDK/CLI calls from Harness code and Model Router behavior are forbidden.
- Route every model-backed role through the provider-neutral `Runtime` contract. The production provider is the official Python `codex-sdk` using ChatGPT subscription authentication; `codex-cli` is an explicit compatibility fallback. Provider SDK/CLI calls belong only inside runtime adapters, and Model Router behavior remains forbidden.
- Treat `.agent/project.yaml` as local execution identity only. It must never grant publication, merge, deployment, credential, network, protected-path, or provider-routing authority.

## Mobilistics preflight
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ validate-artifacts:
fi

runtime-preflight:
AGENT_CODEX_CLI_COMMAND="$(CODEX_CLI)" python3 scripts/check_runtime.py --repo .
python3 scripts/check_runtime.py --repo .

codex-preflight: runtime-preflight

codex-smoke:
AGENT_REAL_CODEX_SMOKE=1 AGENT_CODEX_CLI_COMMAND="$(CODEX_CLI)" \
AGENT_REAL_CODEX_SMOKE=1 \
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python3 -m pytest tests/test_real_codex_smoke.py -q

runtime-chaos:
Expand Down
2 changes: 1 addition & 1 deletion ai_harness/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""User-facing package for the local AI Harness."""

__version__ = "0.1.0"
__version__ = "0.2.0"
60 changes: 60 additions & 0 deletions ai_harness/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
"""Deterministic installed-build identity for worker freshness checks."""

from __future__ import annotations

import hashlib
from pathlib import Path


CONFIG_FILES = (
".agent-artifact-owners.yaml",
".agent-policy.yaml",
".agent-project-profiles.yaml",
".agent-recovery.yaml",
".agent-role-capabilities.yaml",
".agent-role-contracts.yaml",
".agent-routing.yaml",
".agent-runtime.yaml",
".agent-tool-policy.yaml",
".agent-workflows.yaml",
"AGENTS.md",
)


def harness_build_fingerprint(root: Path, *, package_root: Path | None = None) -> str:
"""Hash the files that define installed worker and runtime behavior."""

root = root.resolve()
candidates = [root / relative for relative in CONFIG_FILES]
for directory, pattern in (
(
root / "ai_harness"
if (root / "ai_harness").is_dir()
else (package_root or Path(__file__).resolve().parent),
"*.py",
),
(root / "scripts", "*.py"),
(root / "schemas", "*.json"),
(root / ".agents" / "prompts", "*.md"),
):
if directory.is_dir():
candidates.extend(directory.rglob(pattern))
digest = hashlib.sha256()
entries: dict[str, bytes] = {}
for path in {item.resolve() for item in candidates if item.is_file()}:
try:
try:
relative = path.relative_to(root)
except ValueError:
relative = Path("ai_harness") / path.relative_to(
package_root or Path(__file__).resolve().parent
)
entries[str(relative)] = path.read_bytes()
except (OSError, ValueError):
continue
for relative, content in sorted(entries.items()):
digest.update(relative.encode("utf-8"))
digest.update(b"\0")
digest.update(content)
digest.update(b"\0")
return digest.hexdigest()
Loading
Loading