Skip to content

docs(agents): add an architecture map of the non-guessable facts - #14134

Merged
glours merged 1 commit into
docker:mainfrom
ndeloof:a6-agents-architecture-map
Nov 16, 2026
Merged

glours merged 1 commit into
docker:mainfrom
ndeloof:a6-agents-architecture-map

Conversation

@ndeloof

@ndeloof ndeloof commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

AGENTS.md gains a ~35-line architecture map of the facts local reading cannot reveal: the two lifecycle engines and who calls which, the Run()/events convention distinguishing exported operations from internal helpers, the stdout/stderr split, env-resolution idioms, the config-hash membership invariant, and Docker Desktop integration points.

Note: references service_containers.go, so best merged after #14129.

Epic #14074, section A — split out of #14075 for focused review.

🤖 Generated with Claude Code

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 No issues found — LGTM! View logs.

@glours glours left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@glours
glours enabled auto-merge (rebase) August 27, 2026 09:08
@glours
glours disabled auto-merge August 27, 2026 09:13

@glours glours left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this one during my first review

Comment thread AGENTS.md Resolved
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ndeloof
ndeloof force-pushed the a6-agents-architecture-map branch from d2d17f9 to db3ff2f Compare October 8, 2026 09:35
@ndeloof
ndeloof requested review from docker-agent and glours October 8, 2026 09:35

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

Comment thread AGENTS.md Resolved
@ndeloof
ndeloof force-pushed the a6-agents-architecture-map branch from db3ff2f to f6fff7e Compare November 4, 2026 17:06

@glours glours left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes: the "Two lifecycle engines" bullet describes a pre-ScopeStart/ScopeCreateStart main and is wrong on several points; see inline. The identity bullet also has a wrong causal claim (inline, should-fix).

Nits, no suggestion block:

  • "Operation convention": it's a rule for mutating/lifecycle methods only. Ps, Logs, Exec, Wait, Watch, Images have no Run, and the unexported prepareRun calls Run (run.go:134). Run only calls Start/Done, not On.
  • "Output conventions": COMPOSE_STATUS_STDOUT (cmd/compose/compose.go:95, stdinfo()) moves the renderer's info writer to stdout. Worth a "(unless COMPOSE_STATUS_STDOUT is set)".
  • "Packages": "exported for historical reasons, not as a stability promise" isn't stated anywhere in the repo, and it's wrong for pkg/e2e (test suite) and pkg/mocks (generated). Either drop it or say pkg/api is the contract and the rest carries no documented guarantee.
  • down.go:removePreStartHookContainers is ambiguous (cmd/compose/down.go exists too), use the full path.
  • PR description says "~35-line", the diff is +45. The "merge after #14129" note is moot, it's merged.

Comment thread AGENTS.md Resolved
Comment thread AGENTS.md Resolved
@ndeloof
ndeloof force-pushed the a6-agents-architecture-map branch 2 times, most recently from ac4b86a to 715e703 Compare November 14, 2026 10:39
@ndeloof
ndeloof requested a review from docker-agent November 14, 2026 10:40

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟡 NEEDS ATTENTION

Comment thread AGENTS.md Resolved
@ndeloof
ndeloof force-pushed the a6-agents-architecture-map branch from 715e703 to 4c5e638 Compare November 14, 2026 10:54
@ndeloof
ndeloof requested a review from docker-agent November 14, 2026 10:54

@glours glours left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me, maybe a nit to address before we merge it

Comment thread AGENTS.md
Comment on lines +46 to +48
- **Operation convention**: exported `composeService` methods wrap the work
in `Run(ctx, …, "opname")`, which drives the `EventProcessor`
(`Start`/`On`/`Done`) used for progress display. Unexported methods

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"exported composeService methods wrap the work in Run(…)" is wrong for read-only/streaming methods: Exec (containerops.go:35), Logs, Attach, Watch (watch.go:134), Wait, Ps, Images, etc. have no Run. RunOneOffContainer doesn't either, its Run lives in prepareRun (run.go:134). Only the mutating operations follow the convention.

Current lines:

- **Operation convention**: exported `composeService` methods wrap the work
  in `Run(ctx, …, "opname")`, which drives the `EventProcessor`
  (`Start`/`On`/`Done`) used for progress display. Unexported methods
Suggested change
- **Operation convention**: exported `composeService` methods wrap the work
in `Run(ctx, …, "opname")`, which drives the `EventProcessor`
(`Start`/`On`/`Done`) used for progress display. Unexported methods
- **Operation convention**: exported `composeService` *operations* (`up`,
`create`, `down`, `build`, …) wrap the work in `Run(ctx, …, "opname")`,
which drives the `EventProcessor` (`Start`/`On`/`Done`) used for progress
display; read-only and streaming methods (`Ps`, `Logs`, `Exec`, …) have no
event cycle. Unexported methods

AGENTS.md covered build/test/lint mechanics but nothing about how the
codebase is organized, so a reader's first mental model comes from file
names and local comments — several of which used to be misleading (see
the previous commits in this series).

The new section states, in ~35 lines, the facts a contributor cannot
derive from local reading: the two coexisting lifecycle engines and
which commands enter the plan-based reconciler versus the dependency
graph walk, the Run()/EventProcessor operation convention, the
stdout/stderr split, the two environment-resolution idioms and the
setEnvWithDotEnv timing, the config-hash label as the actual project
membership invariant, and the Docker Desktop integration points that
must fail silently.

Part of docker#14074 (A: the code misdescribes its own structure).

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof
ndeloof force-pushed the a6-agents-architecture-map branch from 4c5e638 to 2a6d617 Compare November 16, 2026 13:51
@glours
glours merged commit 26a770c into docker:main Nov 16, 2026
61 checks passed
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.

3 participants