Skip to content

docs: Add agent-compatible code problem document - #1

Merged
arewm merged 1 commit into
mainfrom
add-agent-compatible-code-problem
Mar 10, 2026
Merged

arewm merged 1 commit into
mainfrom
add-agent-compatible-code-problem

Conversation

@arewm

@arewm arewm commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Summary

No existing problem document addresses what properties of code make it suitable for autonomous agent operation. This is distinct from repo-readiness (which is diagnostic) and architectural-invariants (which derives from the architecture repo).

The new document defines criteria-based language selection (static type checking, error locality, refactoring safety, tooling, deployment simplicity) without prescribing specific languages. It distinguishes between in-house code (which should meet the criteria) and consumed dependencies (where the requirement shifts to typed integration boundaries), using hermeto/cachi2 as a concrete example.

Assisted-by: Claude Code (Opus 4.6)

@arewm
arewm force-pushed the add-agent-compatible-code-problem branch from 30b0239 to 3e415b1 Compare March 9, 2026 15:50
@ralphbean

Copy link
Copy Markdown
Member

I think my only question here is:

  • Should this be its own problem doc, or should it instead be an expansion of the repo-readiness.md doc?

@arewm
arewm force-pushed the add-agent-compatible-code-problem branch 2 times, most recently from b88a987 to a7ef7e5 Compare March 9, 2026 17:25
@arewm

arewm commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

Good question. I considered both options earlier today.

repo-readiness.md is diagnostic — it describes current state (coverage tables, CI maturity) and asks what needs to improve before agents can be trusted. Language choice is prescriptive — it defines properties that new code should have. Expanding repo-readiness to include language guidance changes the character of that document.

The topic cross-cuts beyond readiness. Type safety reduces agent drift (security-threat-model.md), simplifies code review by offloading categories of checks to the compiler (code-review.md), and enables boundary typing for consumed dependencies like hermeto — a concern that doesn't exist in repo-readiness at all. Folding it into repo-readiness would either force that doc to absorb concerns from other domains or require the language guidance to be artificially narrow.

I applied the same reasoning when creating codebase-context.md (merged in #3) — that topic also cross-cuts review, drift, invariants, and readiness without fitting cleanly into any single existing doc.

That said, repo-readiness.md could reference agent-compatible-code.md as a related concern — the way it already references CLAUDE.md as a readiness criterion. Happy to add that cross-link if it helps.

@ralphbean

Copy link
Copy Markdown
Member

Yeah, I like the cross link! Thanks!

No existing problem document addresses what properties of code make it
suitable for autonomous agent operation. This is distinct from
repo-readiness (which is diagnostic) and architectural-invariants (which
derives from the architecture repo).

The new document defines criteria-based language selection (static type
checking, error locality, refactoring safety, tooling, deployment
simplicity) without prescribing specific languages. It distinguishes
between in-house code (which should meet the criteria) and consumed
dependencies (where the requirement shifts to typed integration
boundaries), using hermeto/cachi2 as a concrete example.

Assisted-by: Claude Code (Opus 4.6)
Signed-off-by: arewm <[email protected]>
@arewm
arewm force-pushed the add-agent-compatible-code-problem branch from a7ef7e5 to 8188963 Compare March 10, 2026 00:41
@arewm

arewm commented Mar 10, 2026

Copy link
Copy Markdown
Contributor Author

Done! 😄

@arewm
arewm merged commit a618381 into main Mar 10, 2026
@arewm
arewm deleted the add-agent-compatible-code-problem branch March 10, 2026 14:05
@ascerra ascerra mentioned this pull request Apr 7, 2026
waynesun09 added a commit that referenced this pull request Apr 12, 2026
Seven specialized agents for working on the fullsend project:

- fullsend-architect (opus): architectural coherence guardian; knows all
  ADRs, five execution layers, story dependencies, repo-as-coordinator invariant
- go-developer (sonnet): CLI specialist; forge abstraction, layered config,
  multi-role GitHub App model, known gaps in PR #132
- doc-architect (sonnet): problem doc and ADR writer; design-exploration
  conventions, org-agnostic authoring rules
- stage-prompt-designer (opus): designs/reviews stage agent prompts;
  triage/implement/review/fix constraints, injection surface rules,
  known failure modes from live operation (Issues #4, #5, #010a)
- security-reviewer (opus): applies fullsend threat model; prompt injection,
  ADR 0017 credential isolation, sandbox integrity, workflow file protection
- workflow-engineer (sonnet): GitHub Actions and dispatch layer; label state
  machine, slash commands, concurrency groups, fixes for Issues #1 #003b
  #4 #5 #7 #9 #010a
- e2e-integrator (opus): full flow tracing; integration gap analysis, demo
  readiness checklist, sprint prioritization across stories

Also adds .claude/AGENTS.md with usage guide and team composition patterns.
waynesun09 pushed a commit that referenced this pull request Oct 2, 2026
On the pi runtime, runtime.NeedsOpenAIProvider decided whether to
create the run-scoped OpenAI credential from the parent's own model
alone. A persona or subagents entry that named an openai/ model never
influenced that decision, so a Vertex parent with an OpenAI persona
(agents[].subagents, subagents.default, or a persona's own frontmatter
model:) skipped the credential even when the harness declared the
openai provider, and Bootstrap then rejected the persona because
openai was never in the run's trusted model set.

Fix, in two parts:

1. internal/runtime/openai_seeder.go adds
   SubagentsNeedOpenAIProvider, which reports whether any configured
   child - a subagents.<persona> override, subagents.default, or a
   discovered persona's frontmatter model: - resolves to the openai
   provider. internal/cli/run.go ORs this into the provider-creation
   gate while keeping the parent-only check for the credential path
   the parent's own call uses (runInferenceProvider): a Vertex parent
   with an OpenAI persona still needs its own Vertex ADC validated.

2. Gate #1 alone was not enough: resolvePersonaModels' trusted-spec
   set never admitted an arbitrary openai/<id> spec (only the parent's
   own one), so a configured persona would still be rejected even once
   the credential existed. internal/runtime/pi_personas.go adds
   piConfiguredOpenAIIDs, which extends the manifest's openai
   allowlist with ids from pre-configured (repo-controlled) children,
   the same way piGoogleVertexModels/piXaiVertexModels extend theirs -
   but only when OpenAIProviderAttached (a new BootstrapInput method,
   threaded from run.go's actual provider-creation result) confirms
   the credential is really in the sandbox. A model an Agent call
   chooses at dispatch time is deliberately never admitted this way.

Also names the actual remedy in the Bootstrap error ("declare openai
in the harness's providers list, or run the parent on an openai/
model") instead of only listing accepted specs, and documents the
rule in docs/runtimes/pi.md.

Not implemented: validating a subagents.<persona> entry against the
harness's declared providers at `agent set --subagent` time. The issue
ties that to #7804's model/runtime pairing rule, which does not exist
yet; the Bootstrap-time error above covers the same case today.

Closes #7981
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