Skip to content
This repository was archived by the owner on Nov 10, 2026. It is now read-only.
Closed
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
49 changes: 49 additions & 0 deletions .github/ISSUE_TEMPLATE/agent-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Agent task contract
description: Create a bounded, verifiable task for an AI or human agent.
title: "[AGENT] "
labels: ["agent-task"]
body:
- type: textarea
id: original_request
attributes:
label: Original human request
description: Preserve the request; add context without silently rewriting intent.
validations: { required: true }
- type: textarea
id: goal
attributes:
label: Goal and observable result
validations: { required: true }
- type: textarea
id: non_goals
attributes:
label: Non-goals / forbidden changes
validations: { required: true }
- type: textarea
id: acceptance
attributes:
label: Acceptance criteria
description: Number each criterion and state how it will be verified.
validations: { required: true }
- type: textarea
id: scope
attributes:
label: Repository, branch, allowed paths and tools
validations: { required: true }
- type: dropdown
id: risk
attributes:
label: Risk tier
options: ["R0_READ", "R1_ANALYZE", "R2_WRITE_BRANCH", "R3_EXTERNAL_WRITE", "R4_DESTRUCTIVE_OR_RELEASE"]
validations: { required: true }
- type: textarea
id: approval
attributes:
label: Required human approvals
description: Merge, release, deploy, permission changes, deletion, external data sharing, etc.
validations: { required: true }
- type: textarea
id: stop
attributes:
label: Stop conditions and attempt budget
validations: { required: true }
29 changes: 29 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## Task contract
- Task ID:
- Original request:
- Base commit:

## Scope
- Goal:
- Non-goals:
- Changed paths:

## Verification
| Check | Exact command/procedure | Result | Evidence |
|---|---|---|---|
| | | NOT_RUN | |

## Risk and security
- Permissions/secrets/network impact:
- Data migration or compatibility impact:
- Rollback:

## Independent review
- Reviewer:
- Findings:
- Verdict:

## Human gates
- [ ] No merge/release/deploy/destructive operation performed without approval.
- [ ] All acceptance criteria map to evidence.
- [ ] No secrets included.
43 changes: 43 additions & 0 deletions MANIFEST.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
7ed774cfbef2a6ff954117c44017b3023794962e8d457c8b80c998f05c5c5086 ./.github/ISSUE_TEMPLATE/agent-task.yml
da9616d822c43f33664046819e72bde82633b72a8534a0571aa96a3c166a7910 ./.github/pull_request_template.md
8ca5307ba5839d4c1c150e365703ff3eac35cda46c79447ec4e23bfdcfb1797e ./AGENTS.md
0ee22dd0d80278b1df38151dcf4d52d8f3ab75c143ca72a12c840b92161d6e0a ./README_RU.md
4153155bcd93c8ac3cd25c75598b2cd4e621e7ff051af9f39ce9284f55d11802 ./docs/README.md
dcf70078992c1d7ec9930aa9741693d9ab1887fff7c40828f78de570b0b9d913 ./docs/agent-execution/00_EXECUTION_SPEC.md
5d14c7eb6246aedaeb735e0265b3a86aa2bef9e82f6a9c8a3768a411f6c1aaaf ./docs/agent-execution/01_OPERATING_CONTRACT.md
c50af01613762189f3d89a502d4b93696030ed9a6b063e74a2f5b0d9b0e1f677 ./docs/agent-execution/02_TASK_CONTRACT.md
675acb67f2d0e379033ba25172274886b5e1b1b9aebd93e107b100f25dd69529 ./docs/agent-execution/03_SYSTEM_ARCHITECTURE.md
9b32b665916f77ae5ff09d5483476e9fa67bf6192726cea001be3f850c030d13 ./docs/agent-execution/04_AGENT_ROLES.md
d7939db59cb39bddf202e26e8c48d9bc1c0d8645d47da29c3436f7809fc27fb6 ./docs/agent-execution/05_EXECUTION_WORKFLOW.md
1bdcd94d6a5ed4963a2fe54b0f02263f93045196264cf38dc5d6fd1c4b557fbd ./docs/agent-execution/06_EVIDENCE_MODEL.md
af71570db3e3219876822e56e8f320c08a5ed2a0b4b0521775b7b12179eaffc3 ./docs/agent-execution/07_SECURITY_AND_PERMISSIONS.md
451c26b914363451e19f204b9ee40c4d700b3aefc48495791d6613bbf53e8090 ./docs/agent-execution/08_TESTING_AND_EVALUATION.md
ccbbd272a26e1ba2a1b215c88650b470a8864c553bcb9b073ab4d5d0ab0a8abb ./docs/agent-execution/09_CROSS_REPO_RULES.md
567f3e99d9d17478bae724d640a2f8604c428db55033b39575f3da159bee52cb ./docs/agent-execution/10_ROADMAP.md
1d47be1d5ddf5765642569e2296429126972a1ddde7ea934c9831cebb296b037 ./docs/agent-execution/11_AGENT_RUNBOOK.md
75aee7087004e27e455bd13152fdcd35a461dc835ed4b1132ca83627b3d0b911 ./docs/agent-execution/12_SOURCES.md
7260b3b3812b2abf661bd6856f4c6c46cf61616a14e64d21096cf8fde8205e0a ./docs/agent-execution/13_TASK_GRAPH.md
fc95d429b90e36fb3c80480497ae9022dea3cc96a62dc33000d5288c71b57a6a ./docs/agent-execution/14_PUBLISHING.md
ce2ca596fc7093c445f3d3d7c290f0ba115be4afd2709b4ec75b121c73264eac ./docs/agent-execution/README.md
f1f231701ffa13ddafca388b5e8f64894e5070af932f9a2ba902f953a407401b ./examples/EXAMPLE_PROVENANCE_CHAIN.md
ac0ac19edaaefaa3b05f5d87d2f43bf619c99611057f2473bf1e2892f70ad971 ./examples/EXAMPLE_TASK.json
636fa77a701ed03a683500a5a613be7dbadc8325e6ec8a8b7d8545effdcd8151 ./examples/agent-manifest.json
b777796434ca91c3c95aac16f9fd8de0bfea4cbfe3e971b28d5625183eda1870 ./examples/claim.json
5f8c4f482ebfce18d0a5f3d6bb55b72576f85da94a1c8bb6eb1a31c2ec213e12 ./schemas/agent-execution/agent.schema.json
e5e0e734a30c2d19348d0908c73749a1910cacb6192a421d2a3ed2c85c907bc7 ./schemas/agent-execution/claim.schema.json
5c3defb49e70555fdd98bd307e41b2fb022c8150da514f3d65c7b762a4f56233 ./schemas/agent-execution/evidence.schema.json
5df862d78375db9a40dc2dc90a0e50c507866143114ed2be9ce9b349cfc85bca ./schemas/agent-execution/run.schema.json
2192a7f13a63e4756540ba165421a88d037ec450876c9e1ff612646960cbdadc ./schemas/agent-execution/task.schema.json
6afe345bf3ec2da2edf701460df3bda12196183ef1d1d7586d0bca876b282fef ./tasks/A1_REPO_SNAPSHOT.task.json
a4d3a84cfad37f0513023e3e4df963581c46beec6fc5b4d2eac50c0e859bae71 ./tasks/A2_BUILD_BASELINE.task.json
04f704e9713dabe8896ed7633cb6332b9bf903bd000e7b331b7d674d1c2294fc ./tasks/A3_ARCHITECTURE_MAP.task.json
edc58d44e26260695dd73da1f32568700386e73c0829318222d8e40cd2937d3a ./tasks/A4_SECURITY_POSTURE.task.json
3cc77ab52013d67c7df69bf95c7f0877f540fd72c0777973c552d4f43eb80ada ./templates/adr.md
823132f4956059f6a38149572682cbfec25a2ff5040e03e3a093baa87511ea88 ./templates/claim-register.csv
1cb7936ac99adc2383345ebf95cb7d9c32fe311fc8fe985bfcb625a38702c19e ./templates/evidence-record.json
3a845c0e002952f1aee030fd47dd264c127fecc3c0756fde5fed5a319e1c4f82 ./templates/finding.md
59906f921ed878005b2756ceedbc45918b486ee7aa33d336ac141448a98a5ba7 ./templates/run-record.json
9eea3cd5d6097e8efa06ff00bbd5635f90f774d8ddb40f62d4e06c0810bc709f ./templates/task.json
db721bdea6e2b6b94f3f3a4441f2bf8770d3523561fbe304c45e458a89b2d0c2 ./tests/test_validate_pack.py
d47afea57d3d5cdd49e7be97250456ced57a8d1f81879efd12fdf8ac7bfc60b6 ./tools/publish-to-github.ps1
c5e7c9d3ff51d4afc749b6c7603e83e059e34504f24f1c8e018e24b25206c48b ./tools/validate_pack.py
80 changes: 80 additions & 0 deletions README_RU.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# RTYNBIRF — Agent Execution Pack

**Версия пакета:** 0.1.0-draft
**Дата:** 2026-11-10
**Предлагаемое размещение:** `rtynbirf/polymath-os`
**Статус:** подготовлен локально; в GitHub не отправлен.
**Назначение:** дать любому совместимому coding/research agent единый, проверяемый контракт работы с задачами, кодом, тестами, доказательствами и изменениями.

> Это пакет управления исполнением агентов и документация для внедрения. Это НЕ работающий мультиагентный runtime и НЕ доказательство, что агенты уже запущены.

## Что внутри

- `AGENTS.md` — краткая точка входа для coding agents. Не энциклопедия.
- `docs/` — нормативный для этого проекта комплект: архитектура, роли, workflow, task contract, evidence, безопасность, тестирование, cross-repo rules, roadmap, runbook, источники.
- `schemas/` — JSON Schema для задач, агентов, запусков, утверждений и evidence.
- `templates/` — формы задач, решений, находок и pull request.
- `tasks/` — четыре готовых discovery-задачи первой волны для параллельного исполнения.
- `examples/` — пример задачи и пример цепочки доказательств.
- `tools/validate_pack.py` — локальная проверка схем, ссылок и обязательных файлов без запуска кода репозитория.
- `tools/publish-to-github.ps1` — неразрушающий Windows-публикатор: проверяет origin/права/конфликты, создаёт ветку, запускает проверки, делает push и открывает PR через локальную авторизацию `gh`.
- `tests/` — тесты валидатора пакета.
- `.github/ISSUE_TEMPLATE/agent-task.yml` — форма задачи для GitHub Issues.
- `.github/pull_request_template.md` — шаблон PR.

## Установка без перезаписи

Поскольку текущее дерево `polymath-os` и наличие существующего `AGENTS.md` не были проверены, пакет намеренно не содержит автоматического перезаписывания файлов.

1. Сначала клонируй репозиторий через GitHub CLI:

```powershell
gh auth login --web
gh repo clone rtynbirf/polymath-os
cd polymath-os
```

2. Распакуй пакет отдельно и сравни его содержимое с текущим репозиторием.
3. Запусти `tools/publish-to-github.ps1` с параметром `-RepoPath`. Скрипт проверяет конфликты и прекращает работу, если существующий файл отличается.
4. Если конфликтует существующий `AGENTS.md`, объедини правила вручную; не заменяй файл целиком.
5. Скрипт создаёт отдельную ветку, запускает проверки, выполняет push и открывает PR. Основная ветка не изменяется напрямую.

**Авторизация:** скрипт не принимает PAT в аргументах и не записывает credentials в файлы. Используй локальную авторизацию `gh auth login --web`; GitHub CLI сам управляет сессией. Не вставляй токены в исходники, логи или коммиты. Если PAT уже опубликован в открытом виде, проверь его состояние и при необходимости отзови/замени через GitHub Settings → Developer settings → Personal access tokens.

## Проверка самого пакета

Требуется Python 3.10+:

```bash
python tools/validate_pack.py
python -m unittest discover -s tests -v
```

Для проверки соответствия примеров JSON Schema установи `jsonschema` (если пакет ещё не установлен): `python -m pip install "jsonschema>=4.20,<5"`.

Эти команды проверяют документационный пакет и его схемы. Они НЕ проверяют сборку, тесты или корректность `polymath-os`.

## Правила статуса

- `UNKNOWN` — нет проверяемых данных.
- `DECLARED` — только написано в документации или сообщено участником.
- `OBSERVED` — непосредственно найдено в коде, конфигурации или записи.
- `EXECUTED` — команда реально выполнена; сохранены commit, среда и код возврата.
- `INDEPENDENTLY_VERIFIED` — другой исполнитель независимо воспроизвёл проверку.

Заявление агента о выполнении не является доказательством выполнения.

## Источники инженерных практик

Список официальных и исследовательских материалов находится в `docs/12_SOURCES.md`. В частности: OpenAI Harness Engineering; Microsoft Agent Harness; GitHub Actions Security/Attestations; OWASP MCP Security; AgentLens.

## Публикация в GitHub

Подробности и скрипт безопасной публикации: [`docs/agent-execution/14_PUBLISHING.md`](docs/agent-execution/14_PUBLISHING.md). Публикатор использует локальную OAuth-сессию GitHub CLI, не требует вставлять PAT в чат и не перезаписывает различающиеся существующие файлы.

## Ограничения данной поставки

- Репозиторий `polymath-os` в текущем окружении не был клонирован: исходящий DNS/GitHub доступ отсутствовал.
- Права на GitHub не подключены; коммит и push не выполнялись.
- Существующие project instructions, build/test commands и branch rules неизвестны.
- Поэтому пакет оформлен как **неразрушающий overlay**, а не как уже интегрированное изменение репозитория.
22 changes: 22 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Agent Execution Documentation

This folder is the canonical, versioned operating contract for AI-assisted work in this repository. `AGENTS.md` points here; it should stay short.

Read in order:

1. `00_EXECUTION_SPEC.md`
2. `01_OPERATING_CONTRACT.md`
3. `02_TASK_CONTRACT.md`
4. `03_SYSTEM_ARCHITECTURE.md`
5. `04_AGENT_ROLES.md`
6. `05_EXECUTION_WORKFLOW.md`
7. `06_EVIDENCE_MODEL.md`
8. `07_SECURITY_AND_PERMISSIONS.md`
9. `08_TESTING_AND_EVALUATION.md`
10. `09_CROSS_REPO_RULES.md`
11. `10_ROADMAP.md`
12. `11_AGENT_RUNBOOK.md`
13. `12_SOURCES.md`
14. `13_TASK_GRAPH.md`

The documents are project-level rules and implementation proposals. Where they conflict with current repository behavior, capture the conflict as an observation and ADR; do not silently alter production behavior to fit the proposal.
76 changes: 76 additions & 0 deletions docs/agent-execution/00_EXECUTION_SPEC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# 00 — Product / Execution Specification

**Product:** RTYNBIRF Agent Execution System (working title)
**Target host:** `rtynbirf/polymath-os` (assumption until repository identity and ownership are verified)
**Maturity:** specification only; runtime not implemented or verified.

## 1. Problem

AI-assisted work across multiple repositories loses context, confuses declared capability with executed behavior, allows scope drift, and can report success without reproducible evidence. A multi-agent workflow can amplify these failures unless authority, state, evidence, and acceptance are explicit.

## 2. Goal

Define a portable, model/provider-agnostic operating layer for agent-assisted engineering. It must make tasks executable under constrained permissions, preserve human control, and make every completion claim traceable to code, specification, tests, and run evidence.

## 3. Non-goals

- Do not replace the existing OS/runtime architecture before inspection.
- Do not require a single LLM provider, commercial orchestration framework, vector database, or hosted memory service.
- Do not merge repositories or force a monorepo.
- Do not grant autonomous merge, release, deployment, deletion, credential, or permission powers.
- Do not treat a role prompt as a separate independent agent.
- Do not define universal philosophical meanings of information/knowledge. Operational field names are local interface contracts, not declarations of universal truth.

## 4. Functional requirements

- **FR-001 Task contract:** every non-trivial task has a versioned machine-readable contract.
- **FR-002 Task graph:** tasks express dependencies, ownership, and parallelizable boundaries.
- **FR-003 Agent manifest:** each execution records agent identity, role, provider/model/version where known, capabilities, and permissions.
- **FR-004 Isolation:** implementation agents work in isolated worktrees/branches and bounded filesystem scopes.
- **FR-005 Tool authorization:** tools are typed, scoped, validated, logged, and authorized at execution time.
- **FR-006 Human gates:** external writes, merge, release, deploy, delete, permission change, and data disclosure require human approval.
- **FR-007 Evidence:** claims link to source/run/artifact evidence and provenance lineage.
- **FR-008 Run record:** commands, environments, exit codes, commit IDs, and gaps are recorded.
- **FR-009 Frozen acceptance:** criteria and test oracle cannot be weakened by the implementation agent.
- **FR-010 Independent review:** non-trivial implementation receives review from a distinct context; high-risk changes prefer different model family or human reviewer.
- **FR-011 Bounded retries:** repair iterations are limited and blind retries are rejected.
- **FR-012 Cancellation:** running tasks can be cancelled and cancellation is observable.
- **FR-013 Recovery:** crashes/timeouts recover from durable state without duplicating non-idempotent actions.
- **FR-014 Observability:** task state transitions, tool calls, failures, costs, and policy denials are traceable.
- **FR-015 Portability:** core contracts do not depend on one provider/runtime.
- **FR-016 Repository boundaries:** cross-repo edges require source evidence and contract tests.
- **FR-017 Evaluation:** agent outcome and execution process are both evaluated.
- **FR-018 Privacy:** repository contents and secrets are not sent to external services unless explicitly authorized.
- **FR-019 Auditability:** decisions, overrides, and policy changes are append-only or versioned.
- **FR-020 Honest status:** missing data remains UNKNOWN/BLOCKED/NOT_RUN; never inferred PASS.

## 5. Quality attributes

- **Safety:** least privilege, sandboxing, human approval, secret redaction.
- **Reliability:** bounded retries, idempotency, durable state, crash recovery.
- **Reproducibility:** exact commit, commands, environment, lockfiles, and artifacts.
- **Interoperability:** versioned schemas, adapters, conformance tests.
- **Portability:** local-first operation, replaceable providers, exportable evidence.
- **Maintainability:** concise root instructions; detailed, indexed documentation; machine-checkable contracts.
- **Efficiency:** parallelize non-overlapping work; avoid duplicated agent context and unnecessary retries.

## 6. Acceptance for the specification package

- A new agent can identify the governing docs and task lifecycle from `AGENTS.md`.
- Task, agent, run, claim, and evidence examples parse against their JSON Schemas.
- The first repository-inspection tasks can be assigned without inventing repo commands.
- Existing repository instructions are never overwritten by installation.
- The package validator and unit tests pass.

## 7. Open decisions

The following require real repository inspection and ADR, not guesswork:

- execution runtime and orchestrator;
- event bus and persistence engine;
- worktree/container backend;
- provider adapters and local model routing;
- memory store and retention model;
- policy engine and approval UI;
- tracing/metrics storage;
- cross-repository contract versioning.
Loading
Loading