GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — harness/AGENTS.md at main · majorcontext/harness

Expand file tree

/

AGENTS.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
74 lines (63 loc) · 7.11 KB
/

AGENTS.md

Copy path

File metadata and controls

74 lines (63 loc) · 7.11 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

AGENTS.md

Rules for agents that edit harness. Also read the AGENTS.md in each directory you change.

Design

  • The architecture is docs/architecture.md. New code follows it.
  • Design each interface from its consumer's need. Nothing is kept because it exists. There is no backward compatibility.
  • One owner and one source of truth for each piece of state.
  • Build session state from the event log with one Apply function, live and on replay.
  • Give one goroutine each session's state. Other code sends it commands and reads immutable views.
  • An interface lives in the package that consumes it. Never branch on a provider or backend name.
  • Imports are one-way. Internal packages never import cmd.

Invariants

  • A session is an append-only log of canonical messages, never provider wire objects.
  • A repair of live or persisted history is additive-only. Never delete a real tool result.
  • An empty tool result never serializes as null. Read ToolResult.SafeContent.
  • Model references use provider/model. Aliases resolve before a request reaches a provider.
  • Only the runtime creates message.EngineContext. User text never gains that trust.

Spec and review

  • docs/architecture.md is the binding spec. Cite the sections a change implements in the PR body. When the spec is silent or unclear, stop and ask; do not invent.
  • A difference from the spec is a blocker. A spec change needs an Andy decision, and the same PR or a docs PR edits the spec to describe the system as it is. The spec holds no history: no phases, no earlier-system comparison, no dated notes.
  • Add no feature the spec does not list.
  • Judge a change against the architecture as a whole, not the diff: answer the installed .agents/skills/architecture-review/SKILL.md and then .github/skills/harness-architecture-review/SKILL.md for every review.
  • Follow the installed .agents/skills/go-guide/SKILL.md for Go layout, API design, concurrency, tests, and comments. Where it differs from this file, this file wins.
  • One concern per PR. Describe the change in the PR body: problem, design, semantic change, verification. Do not hard-wrap a PR body.
  • Never resolve a review thread without a reply: fix it and say how, or say why you decline.

Gates (internal/gates, docs/architecture.md CI gates)

  • Routes: the route table, its read routes, and the mounts of httpapi.Handler and httpapi.ReadHandler equal the spec's route list.
  • Errors: every code is a protocol constant, a protocol.HTTPStatus entry, a row of the spec Errors table with the same status, and a value of the openapi.json Error.code enum. internal, payload_too_large, and unauthorized need no sentinel error (docs/architecture.md Errors).
  • Structure: internal/gates/structure.go lists the one owner of each concept (for example the context window, Store.Append, State.Apply, message.EngineContext) and bans provider-name branches outside config, the router, and provider wires. An allow-list entry carries a date and a reason; a stale entry fails.
  • Wire: a test double emits only what testdata/wire holds; a recording holds no secret or id. testdata/wire/allowed.txt lists exceptions with reasons; HARNESS_RECORD_WIRE=1 go run ./internal/wirerecord -out testdata/wire refreshes recordings with real model calls. Every e2e/ HTTP client comes from wireClient.

Settled non-goals

Add none of these without a new design decision:

  • A permission or approval system for tool calls, or a plan mode.
  • A JavaScript runtime, an opencode compatibility layer, or plugin auth hooks.
  • A2A support without a concrete cross-organization use case.
  • A web UI. majorcontext/bailey owns that surface.

Startup rules

  • Keep harness version and the time to the initialize response of harness acp inside the budget of the Startup budget step in .github/workflows/ci.yml.
  • Keep stdout of harness acp for ACP frames only. Log to stderr.
  • Before first output, read only the user and project config files. For harness run and harness acp only (never serve or the Go API), the default model of a config with no model also checks the API key variable, stats the Codex login file that codex_auth_file names (state of the user, like the config) and looks up claude on PATH. It reads no content and starts no process.
  • Make no network call and start no subprocess before a command needs it.
  • Add no init() side effects. Keep production Go free of cgo.
  • Validate credentials on first use. Keep model catalogs static. The one exception is the model list of a provider with auth chatgpt: it is fetched on first use, cached, and falls back to the static list.

Code

  • Keep files at most 800 lines. Keep each function's closing brace at most 80 lines below its opening brace. internal/gates compares each changed file with its merge-base version, follows renames, and never blocks a change that only deletes code.
  • Write no comment by default. A comment states a constraint, a hazard, or a non-obvious reason.
  • A comment never states history: no issue numbers, dates, "previously", or "no longer".
  • An exported identifier gets a one-line doc comment.
  • Use ASD-STE100 Simplified Technical English for prose. Never print or log a secret value.
  • Write tooling in Go (a test helper or go run ./internal/...), not shell scripts.
  • After a change to a protocol type or to internal/server Table, commit the go generate ./protocol output (protocol/openapi.json, protocol/protocol.ts). CI fails on a diff.

Tests

  • TDD means: write the failing contract test first, see it fail for the named reason, then implement. A contract test is a scenario row in e2e/; a row runs on both drivers with HARNESS_E2E_RUNTIME=1, except a row marked rowDeleted (the contract has no such behavior). A behavior change adds a row; a bug fix adds one row to the nearest table.
  • Write no other test unless the code is pure: internal/eventlog Apply, internal/acp, wire transcoders (internal/provider/*/, internal/backend/modelapi/convert_test.go, internal/backend/claudecode/frames_test.go), config, internal/message, internal/gates. Otherwise list the file with a one-line reason in testdata/test-exceptions.txt (path, space, reason). internal/gates fails a change that nets new lines inside Test, Benchmark, Fuzz, or Example functions or package-level vars elsewhere. Top-level helpers, fakes, and types do not count. A listed file still meets the 1.5 test:code ratio of its package.
  • Name a test by its behavior, never by an incident. No test reads another package's unexported state.
  • No time.Sleep or time.After in tests. Use testing/synctest or channels. Use internal/testpoll only for cross-process waits.
  • Run Go tests with -race. gofmt output differs across Go minor versions; CI reads the version from go.mod.

Before handoff

go build ./... && go vet ./... && go test -race ./... && test -z "$(gofmt -l .)"

Commits

  • Use Conventional Commit subjects.
  • The body states the problem, the design, the semantic change, and the verification. Incident detail goes in the body, never in code.
  • No AI attribution.
  • Add a CHANGELOG.md entry under the unreleased heading for each user-visible change.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.