Skip to content
26 changes: 23 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,21 @@ For every change:
7. inspect review feedback and exact-head checks;
8. merge only when repository policy is satisfied.

Do not bypass required checks, independent approval, or branch protection. Waiting checks are not permission to weaken tests; continue with independent product analysis or a non-conflicting next task.
Do not bypass required checks, branch protection, or any review authority actually required by current GitHub rules or an explicit operationally satisfiable OriginWeave/CWL governance rule. Waiting checks are not permission to weaken tests; continue with a non-conflicting next task.

## Work-conserving autonomous maintenance

**A completed action is an intermediate state**, not an implicit end of a maintenance invocation. “One bounded slice” means **one write-active slice at a time**, not one slice, pull request, RCA, check, review request, documentation update, or merge per run.

After every completed mutation, validation result, merge, defer decision, or newly proven blocker, return to the fresh executable queue. A pending check, reviewer delay, rate limit, unavailable provider, external dependency, or writer conflict **blocks only that item** or branch. Continue with another safe, non-conflicting OriginWeave task while practical run budget remains.

### Mandatory exit sweep

Before autonomous maintenance ends, refetch protected `main`, every open OriginWeave pull request and issue, current reviews/checks, release state, documentation graph, and buyer-visible product gaps. Evaluate whether any safe action remains, including merge, test-first defect repair, thread resolution, duplicate cleanup, another PR/issue, protected-main acceptance, documentation repair, product-gap implementation, quality/security/operability improvement, or release evidence work.

If any safe executable item remains, **termination is prohibited**: execute the highest-value item and repeat the sweep. End only when the practical invocation budget is exhausted or every remaining item is genuinely non-actionable under current authority, dependency order, writer lease, and safety constraints.

Do not repeatedly poll an unchanged pending item. Defer it by exact PR/head/run/review identity, work elsewhere, and revisit after a material state change, another substantive action, or the exit sweep.

## Blocker RCA and corrective-action feasibility

Expand All @@ -33,7 +47,13 @@ For every failed check, review, approval, permission, tool, infrastructure, or w
6. If the action does not produce that state transition, incorporate the evidence into the RCA and evaluate the next safe candidate; do not repeat an unsupported or disproven action.
7. Only report an external blocker after current evidence proves that no safe feasible corrective action is available. Continue one non-conflicting bounded task when the writer lease and dependency graph permit it.

A qualifying approval is a formal `APPROVED` review by an eligible non-author repository collaborator on the exact unchanged head. Comments, statuses, mentions, clean-review prose, author reviews, and unavailable bot identities are not approval. If no eligible reviewer exists, classify the condition as a reviewer-provisioning gap rather than approval latency; never synthesize, self-submit, or bypass approval.
### Review-governance realism

A formal non-author approval is a merge gate only when **current GitHub rules** or an explicit current, operationally satisfiable OriginWeave/CWL governance rule requires it. Advisory comments, statuses, automated-review prose, author reviews, and unavailable identities never substitute for a counted approval when one is actually required.

When current rules require counted approval, the required evidence must be a formal `APPROVED` review by an eligible non-author **repository collaborator** (or another identity that current GitHub policy explicitly counts). If that governing rule remains active but no legitimate eligible path exists, classify the condition as a **reviewer-provisioning gap**; never synthesize, self-submit, or impersonate approval.

The organization currently documents a **solo-maintainer** governance condition. When there are **fewer than two eligible** independent maintainers, an otherwise impossible non-author approval rule is **on hold** rather than manufactured or bypassed; exact-head CI, security, 100% coverage, rustdoc, resolved findings, live-base checks, and branch protection remain mandatory. The independent-review gate must be **re-enabled** when the repository again has two or more eligible maintainers or when current GitHub rules independently require it. If a counted reviewer route is required, verify collaborator/team/App eligibility before requesting it and never repeat a route already proven ineligible without a relevant state change.

## Architecture constraints

Expand Down Expand Up @@ -95,4 +115,4 @@ A skipped security, GPU, browser, TLS, or statistical test is not passing eviden

## Release contract

A release requires all current-head checks, complete coverage and docs, updated `CHANGELOG.md`, SBOM and provenance, reproducible artifacts, compatibility evidence, security review, and an explicit version decision. Pre-alpha commits are not releases.
A release requires all current-head checks, complete coverage and docs, updated `CHANGELOG.md`, SBOM and provenance, reproducible artifacts, compatibility evidence, security review, and an explicit version decision. Pre-alpha commits are not releases.
26 changes: 19 additions & 7 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
# OriginWeave Architecture

## Authoritative documentation graph

This file is the canonical product-wide topology and bounded-context view. It is intentionally linked to the rest of the authoritative documentation graph so a maintainer or buyer does not have to reconstruct requirements or decisions from chat, pull-request prose, or isolated feature plans:

- [Product requirements](docs/PRD.md)
- [Technical requirements and implementation-status boundaries](docs/TRD.md)
- [Architecture decision index and lifecycle](docs/adr/README.md)
- [UML and control-flow diagrams](docs/uml/README.md)
- [Conceptual ERD and durable domain model](docs/erd/README.md)
- [Requirement, decision, standards, and implementation traceability](docs/traceability/README.md)
- [Research and standards doctoring](docs/doctoring.md)
- [Product roadmap](docs/product-roadmap.md)

Protected-main code and executable tests define current implementation truth; deployed build/release artifacts, migrations, and configuration are additional operational evidence when they exist. Accepted ADRs define design authority, not proof that planned behavior has shipped. The PRD/TRD/diagrams may also contain `Planned`, `Proposed`, or `Open` product direction; those labels must remain explicit until corresponding implementation and review evidence reaches protected `main`.

## 1. Product definition

OriginWeave is an enterprise agentic web runtime and provenance-native browser control plane. Chromium remains the compatibility kernel; Rust owns new governance, destination, direct network, TLS identity, resource, evidence, and agent-facing contracts. This separation minimizes the Chromium patch surface and allows the same Rust modules to operate in a desktop browser, headless service, naruon module, or external agent runtime.

## 2. Architectural principles

1. **Compatibility before reinvention.** Blink, V8, Skia, Viz, Dawn, Site Isolation, sandboxing, and Manifest V3 remain upstream-compatible.
2. **Authority is explicit.** No ambient browser state or page content implicitly grants a capability; observed node authority is bound to an exact browser session, browsing context, canonical origin, and document epoch.
2. **Authority is explicit.** No ambient browser state or page content implicitly grants a capability.
3. **Actions are typed.** Production agents do not receive unrestricted JavaScript evaluation as a default tool.
4. **Observe before acting; verify after acting.** A command is successful only when its expected post-condition is observed.
5. **Secrets stay outside model context.** Models receive opaque handles; a broker resolves values directly into a trusted browser process.
Expand Down Expand Up @@ -55,7 +70,6 @@ An Agent Task session must not automatically share the default human profile. Fu
Owns stable value contracts without I/O:

- browser-equivalent normalized `Origin` values that reject ambiguous numeric hosts;
- nonzero `BrowserSessionId`, `BrowsingContextId`, and `DocumentEpoch` identities plus `ObservedNodeHandle` values bound to their exact session, context, origin, document lifetime, and adapter-local node identifier;
- immutable `ActionIntentDigest` values;
- `SessionMode` and `ExecutionPurpose`;
- `InstructionSource` and `SecretDelivery`;
Expand Down Expand Up @@ -152,7 +166,7 @@ Observation should prefer the most structured trustworthy source available:
4. accessibility tree combined with DOM and layout;
5. screenshot or vision fallback for canvas and inaccessible custom interfaces.

Raw HTML is not the default model input. Full snapshots are followed by incremental semantic diffs, versioned by document epoch. Every actionable node reference carries its nonzero browser-session identity, browsing-context identity, canonical origin, document epoch, and adapter-local node identifier. A browser adapter must validate all five values immediately before use; another automation session, navigation, document replacement, origin change, or a different tab or frame context invalidates the handle.
Raw HTML is not the default model input. Full snapshots are followed by incremental semantic diffs, versioned by document epoch. Node references become invalid after navigation or epoch change.

## 8. Action lifecycle

Expand All @@ -163,7 +177,6 @@ user intent
→ typed request
→ instruction-source check
→ capability and browser-equivalent origin check
→ browser-session + browsing-context + origin + document-epoch node binding
→ resolved-destination approval and pinning
→ exact direct TCP peer binding
→ authenticated TLS service identity
Expand Down Expand Up @@ -248,7 +261,6 @@ WARC stores source exchanges and resources; relational storage holds sessions, p
- Browser content is data, never authority.
- Secrets are never included in model prompts, traces, or provenance values.
- Generic header and query values are never retained by the evidence kernel.
- Observed node handles are valid only in the exact browser session, browsing context, canonical origin, and document epoch that produced them; adapter-local node identifiers alone never confer authority.
- Logical origin grants, resolved-destination grants, actual peer evidence, and TLS service identity remain distinct.
- DNS answer expansion after approval is denied as a possible rebinding event.
- Direct TCP accepts only a canonical approved socket, never a hostname.
Expand Down Expand Up @@ -283,7 +295,7 @@ No deployment mode may depend on an in-process singleton. Session, policy, desti
| Attribute | Required evidence |
|---|---|
| correctness | contract, property, hostile-input, real TCP/TLS, and post-condition tests |
| safety | prompt-injection, secret, session/context-bound node, origin, destination, rebinding, redirect, exact-peer, TLS identity, approval, and renderer-boundary tests |
| safety | prompt-injection, secret, origin, destination, rebinding, redirect, exact-peer, TLS identity, approval, and renderer-boundary tests |
| reliability | crash recovery, checkpoint, retry, timeout, and idempotency tests |
| performance | input latency, frame time, task RSS, VRAM, transfer, connection, handshake, and token metrics |
| interoperability | BiDi/CDP/MCP/WARC/PROV and Manifest V3 compatibility suites |
Expand All @@ -292,4 +304,4 @@ No deployment mode may depend on an in-process singleton. Session, policy, desti

## 15. Change control

Changes to the compatibility-kernel boundary, risk taxonomy, secret model, origin model, session/context-bound node-handle identity, canonical intent model, evidence semantics, destination taxonomy, DNS pinning semantics, direct socket authority, TLS reference identity, trust-root semantics, trusted-time semantics, ALPN policy, redirect policy, resource mitigation semantics, or protocol versioning require a new ADR. The current baseline decisions are recorded under `docs/adr/`.
Changes to the compatibility-kernel boundary, risk taxonomy, secret model, origin model, canonical intent model, evidence semantics, destination taxonomy, DNS pinning semantics, direct socket authority, TLS reference identity, trust-root semantics, trusted-time semantics, ALPN policy, redirect policy, resource mitigation semantics, or protocol versioning require a new ADR. The current baseline decisions are recorded under `docs/adr/`.
Loading
Loading