mochan-tk / mochan-tk/tt1-codex

Add durable AgentRun supervision and enforceable contracts

Open
#3 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

agent:running ai:ready exec:app type:task
Dominant language
Shell
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Objective

Upgrade the scaffold to a repository-native v0.6 supervisory protocol that safely tracks replaceable AgentRun attempts, computes a fail-closed frontier, and deterministically validates Task and PR contracts.

Context & references

  • Epic: #2
  • Requirements: the Task Issue is the durable contract; AgentRun sessions are replaceable attempts; at most one attempt may hold the active lease; GitHub remains the durable audit log.
  • Decisions: preserve GitHub-native operation and Bash 3.2 compatibility; use append-only, machine-readable Issue comments for AgentRun events; treat state discovery failure as non-dispatchable; apply ai:ready only after relationship and contract validation.
  • Audit findings: active tasks remain redispatchable, frontier state discovery fails open, a closed blocker is not necessarily successful, gh issue create applies parent/dependency updates after Issue creation, governance rules are mostly advisory, and crash recovery is not defined.

Acceptance criteria

  • AC1: Constitution and session-orchestration documentation define 1 Task = 1 durable contract = 1 branch/PR = 0..N sequential AgentRuns, with no more than one active lease.
  • AC2: An AgentRun CLI records claim, heartbeat, release, and terminal outcomes as append-only structured Issue events; concurrent claims converge on one winner; expired leases are reclaimable; status is reconstructable without chat history.
  • AC3: Frontier computation fails closed on Issue, dependency, or AgentRun-state lookup failure; excludes active leases; requires successful blocker outcomes rather than mere closure; and confirms type:task.
  • AC4: Task creation performs local preflight, creates the Issue without ai:ready, wires parent/dependencies, validates remote state, and adds ai:ready only last.
  • AC5: Deterministic Task and PR contract validators check required structure, labels, ownership/evidence invariants, and actionable contradictions.
  • AC6: Hermetic tests cover success, API failure, duplicate claim, expiry/reclaim, heartbeat, invalid transition, incomplete Task, ownership violation, and failed blocker cases.
  • AC7: CI/self-checks run the new tests; all shell is Bash 3.2-compatible and shellcheck-clean.
  • AC8: Governance and reproducibility improvements cover critical CODEOWNERS paths, stronger ruleset defaults, supported GitHub CLI version checks, pinned MCP tooling, corrected CLI guidance, and synchronized README/changelog/retro documentation.
  • AC9: At least five distinct review passes are completed; each pass records its focus, findings, fixes, and rerun evidence in the PR.

Out of scope

  • Externally hosted databases or always-on controllers.
  • Vendor-specific Codex, Copilot, or Claude execution adapters.
  • Recursive Work Package/Task hierarchy beyond documenting it as a follow-up.
  • Activating repository rulesets or merging the PR.
  • Selecting a LICENSE without an explicit owner decision.
  • Building a graphical dashboard.

File ownership

  • AGENTS.md
  • README.md
  • SCAFFOLD-CHANGELOG.md
  • .vscode/mcp.json
  • .github/CODEOWNERS
  • .github/ISSUE_TEMPLATE/**
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/agents/**
  • .github/instructions/**
  • .github/prompts/**
  • .github/skills/**
  • .github/workflows/**
  • scripts/**
  • docs/agreements/retro-log.md

Verification

git ls-files '*.sh' | while IFS= read -r f; do /bin/bash -n "$f"; done
bash scripts/check-template-sync.sh
bash scripts/check-md-links.sh
bash scripts/test-supervision.sh
bash scripts/tuning-status.sh --ci
shellcheck -S style $(git ls-files '*.sh')
actionlint .github/workflows/*.yml

Expected: every command exits 0; supervision tests cover the listed positive and negative paths; tuning status reports the intentionally generic scaffold only as warnings.

Routing

  • Surface: exec:app
  • Suggested role: default implementer, with independent reviewer passes
  • Model/reasoning tier: high-reasoning
  • Parallel-safe: no -- this Task intentionally changes the shared control plane and must remain the sole writer.

Handoff notes

  • The PR must explain the root causes, invariants, compatibility boundary, security implications, known limitations, and all five review passes in detail.
  • Prefer executable checks over additional prose. Keep always-on files within the retro Budget rule.
  • Any proposal that cannot be made deterministic in this repository-only scope must become a linked follow-up rather than an unverified claim.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the owned files listed in the issue, especially scripts/, .github/workflows/, AGENTS.md, and the agreement documentation, then run scripts/test-supervision.sh to understand the current scaffold. Use the listed verification commands to exercise supervision, template, link, tuning, shell, and workflow checks. Done means the acceptance criteria are covered, all checks exit 0, and the PR records the required review passes and evidence.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, github, shell
Domain
ci-cd, devops, documentation, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.