Skip to content

Define ag-harness design#96

Open
andagaev wants to merge 2 commits into
mainfrom
harness-vision
Open

Define ag-harness design#96
andagaev wants to merge 2 commits into
mainfrom
harness-vision

Conversation

@andagaev

@andagaev andagaev commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator
  • Defines ag-harness as a lightweight Rust-native harness layer between applications and model providers.
  • Documents core read, write, and bash tools, structured patch edits, permission policy, persisted sessions, context handling, output caps, and model tiers.
  • Sketches the crate layout, runtime process model, multisession workflow, agent loop, library API roles, service wrapper roadmap, and comparisons with existing harnesses.

@andagaev andagaev changed the title Add ag-harness vision spec Add ag-harness vision doc Jul 5, 2026
@andagaev
andagaev force-pushed the harness-vision branch 3 times, most recently from a6fa521 to d3396ed Compare July 5, 2026 22:17
@andagaev
andagaev marked this pull request as ready for review July 5, 2026 22:19
@andagaev
andagaev requested a review from minev-dev as a code owner July 5, 2026 22:19
@andagaev
andagaev enabled auto-merge July 5, 2026 22:19
Comment thread docs/ag-harness/ag-harness-design.md
@andagaev
andagaev force-pushed the harness-vision branch 2 times, most recently from dc833c5 to aa35d1a Compare July 6, 2026 02:01
@minev-dev

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: aa35d1a178

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@andagaev
andagaev marked this pull request as draft July 7, 2026 01:28
auto-merge was automatically disabled July 7, 2026 01:28

Pull request was converted to draft

@andagaev
andagaev force-pushed the harness-vision branch 3 times, most recently from 6820d60 to b4b3cd6 Compare July 7, 2026 06:19
@andagaev
andagaev marked this pull request as ready for review July 7, 2026 06:33
@greptile-apps

greptile-apps Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a new design document for ag-harness, a lightweight Rust-native harness layer that sits between applications and LLM providers. It covers the crate layout, process model, agent loop, editing strategy, permission policy, model tiers, and a comparison with existing harnesses.

  • The permission system declares AllowCommands as the mechanism for constraining bash calls, but the design document does not define the matching semantics — whether commands are matched exactly, by prefix, or by glob — leaving it unclear how to prevent shell-injection bypass via compound operators.
  • The agent loop diagram omits the branch for a policy-denied tool call, leaving unspecified whether a denied request returns an error result to the model (loop continues) or aborts the entire turn.

Confidence Score: 4/5

Safe to merge as documentation, but the two design gaps should be addressed before implementation begins.

The document leaves two gaps in the permission model: the AllowCommands matching algorithm is undefined (enabling potential bypass via compound shell operators), and the agent loop has no specified branch for a denied tool call. Both are design-level gaps that would directly affect how implementers build the security boundary.

docs/ag-harness/ag-harness-design.md — the Permissions and Agent Loop sections need clarification before implementation begins.

Reviews (28): Last reviewed commit: "Define `ag-harness` design" | Re-trigger Greptile

Comment thread docs/plans/2026-07-05-ag-harness-vision.md Outdated
Comment thread docs/plans/2026-07-05-ag-harness-vision.md Outdated
Comment thread docs/plans/2026-07-05-ag-harness-vision.md Outdated
Comment thread docs/plans/2026-07-05-ag-harness-vision.md Outdated
Comment thread docs/plans/2026-07-05-ag-harness-vision.md Outdated
Comment thread docs/plans/2026-07-05-ag-harness-vision.md Outdated
Comment thread docs/plans/2026-07-05-ag-harness-vision.md Outdated
Comment thread docs/plans/2026-07-05-ag-harness-vision.md Outdated
Comment thread docs/plans/2026-07-05-ag-harness-vision.md Outdated
Comment thread docs/plans/2026-07-05-ag-harness-vision.md Outdated
greptile-apps[bot]
greptile-apps Bot previously approved these changes Jul 8, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review July 8, 2026 06:53

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

@greptile-apps
greptile-apps Bot dismissed their stale review July 15, 2026 04:40

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Jul 15, 2026
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@andagaev andagaev changed the title Refine ag-harness vision Define ag-harness vision Jul 15, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review July 15, 2026 05:00

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Jul 15, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review July 15, 2026 05:04

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Jul 15, 2026
@andagaev andagaev changed the title Define ag-harness vision Define ag-harness vision Jul 15, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review July 15, 2026 05:15

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Jul 15, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review July 15, 2026 06:50

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Jul 15, 2026
@andagaev andagaev changed the title Define ag-harness vision Define ag-harness design Jul 15, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review July 15, 2026 07:07

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

- Document the planned `ag-harness` as a light, Rust-native LLM harness between an app and a model, with agentty as its first consumer.
- Define the core features: `read`, `write`, `edit`, and `bash` tools, git-style diff edits, a permission policy on every tool call, append-only JSONL session journals, cache-aware context, and a typed event stream.
- State the non-goals: no orchestration, no sandboxing in core, and no UI.
- Describe the crate layout, the one-process model with sessions as state and turns as async tasks, the agent loop, the provider layer, and the library API.
- Add mermaid diagrams, a roadmap, and a decision log.
greptile-apps[bot]
greptile-apps Bot previously approved these changes Jul 16, 2026
greptile-apps[bot]
greptile-apps Bot previously approved these changes Jul 16, 2026
- Defines `ag-harness` as a lightweight Rust-native harness layer between applications and model providers.
- Documents core `read`, `write`, and `bash` tools, structured patch edits, permission policy, persisted sessions, context handling, output caps, and model tiers.
- Sketches the crate layout, runtime process model, multisession workflow, agent loop, library API roles, service wrapper roadmap, and comparisons with existing harnesses.
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants