Skip to content

docs: record the improvement proposals an audit produced - #13

Merged
dinhdev666 merged 1 commit into
mainfrom
docs/improvement-proposals
Nov 24, 2026
Merged

dinhdev666 merged 1 commit into
mainfrom
docs/improvement-proposals

Conversation

@dinhdev666

Copy link
Copy Markdown
Owner

What this is

IMPROVEMENT_PROPOSALS.md did not exist. This adds it: an audit of the repository as it stands, with every finding carrying the file and line it was found at, the failure it produces, and the change to make.

How severity was assigned

A defect is a case where the code does something other than what its own comment, its documentation or an invariant in AGENTS.md says it does. Improvements and features follow. Nothing proposed weakens an invariant.

Headline findings

  • C1 a truncated non-streaming body is recorded as a provider success, so a flaky instance answers 502 forever while the Providers tab shows it healthy
  • H1 UPSTREAM_TOTAL_TIMEOUT_MS does not bound the body, so a provider that dribbles one byte per interval pins a slot and 256 MiB indefinitely
  • H2 an empty ADMIN_PASSWORD in the environment creates the default-password account, contradicting the entrypoint's own warning
  • M1 two log fields are named code and are therefore redacted by the masker, so the only log line explaining a client's 502 hides the classification
  • M4 a throw after reply.hijack() leaks the provider slot (invariant 7) and the connection ownership (invariant 14)

Verified before writing

Check Result
pnpm run check 62 files OK, no console outside the logger, 20 action references pinned
pnpm run typecheck exit 0
pnpm run test:web 17 tests, all pass
pnpm test:unit 159 of 159 checks pass
SMOKE_STUB_PORT=4500 pnpm test:smoke 430 of 430 checks pass, 27 skipped (slow cases)

The one failure observed was pnpm test aborting before the smoke file because a local opencode serve holds port 4405. The suite's refusal is the documented behaviour; the documented override runs it clean.

Not done here

This is the proposal document only. No code is changed by this pull request.

The repository had no document of known defects, so every audit started
from zero and the same findings were rediscovered and re-litigated.
Write them down with the file, the line and the failure each one
produces, so a fix can be traced back to the proposal that asked for it.

Severity is assigned by whether the code contradicts its own comment,
documentation or an invariant in AGENTS.md, not by how interesting the
finding is. Two things are recorded as deliberately not findings: the
smoke suite's port refusal, which is the documented behaviour when a
local opencode serve already holds 4405, and the SSE keep-alive
injector, which is a second exception to byte passthrough that an owner
should decide on rather than discover later.

Each proposed feature is a few lines in one module. None of them
weakens an invariant, and the areas checked and found clean are listed
so they are not re-audited.
@dinhdev666
dinhdev666 merged commit fbc9ad5 into main Nov 24, 2026
6 checks passed
@dinhdev666
dinhdev666 deleted the docs/improvement-proposals branch November 24, 2026 10:03
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.

1 participant