8000 fix: safety fixes from QA (data folder lock, waiting messages, automation guards) by aorumbayev · Pull Request #132 · kagan-sh/kagan · GitHub
[go: up one dir, main page]

Skip to content

fix: safety fixes from QA (data folder lock, waiting messages, automation guards) - #132

Merged
aorumbayev merged 25 commits into
mainfrom
feat/qa-core-safety
Nov 11, 2026
Merged

aorumbayev merged 25 commits into
mainfrom
feat/qa-core-safety

Conversation

@aorumbayev
Copy link
Copy Markdown
Member

Branch feat/qa-core-safety.

Reviewed by a fresh reviewer, fixed, and re-checked (SHIP). Gate: fmt, clippy -D warnings, workspace tests, scripts.

kg ... | head used to panic on the first write after the reader closed.
Output now goes through one helper that drops a broken pipe; the operation
already ran, so the exit code is unchanged.
It used to exit 0 with no message, so the person thought their app had
started. It now says an app is already listening and exits non-zero.
A right-to-left override in a name reversed what the window drew, including
in the approval text for a delete. One check now covers both kinds, and
every name check uses it.
It used to start a program at once, and type its text before the program
was ready. The time must now be in the future when it is added. A due time
that passes while kagan is closed still fires when kagan opens.
Two apps on one data folder ran the same threads twice and wrote the same
database. The app now takes a lock on kagan.lock before it binds its socket,
and says which pid holds the folder when it is refused.
A person-gated op (delete, remove) used to block silently. The app now sends
each question to the client as a frame before the reply, and the client prints
it on stderr, then says it was answered when the op succeeds. Stdout is unchanged.
A program that could not start failed without a word forever. The reason is
now stored on the automation as lastError, shown on its row, and cleared
when a run starts.
Cost: product Rust went from 79874 to 80088 lines (+214), and the ceiling is set to that count.
…e check

The lock gained futures for kg, so the notices hash moved. The UI automation test used a past time, which the add check now refuses.
The pid used to live in the locked file, which Windows does not let another
handle read, so the refusal fell back to a vague message. The owner's pid
now goes in kagan.pid. A client that cannot start the app because the
folder is held says so, instead of a plain timeout.
…and plugins

Section names, skill descriptions and hints, theme names, branch names,
surface ids, plugin lines and index descriptions used a control-character
check only. They now use the same check as the other names.
…to end

The broken-pipe fix had only unit tests of a helper; the new test runs the
binary with its reader gone and fails if kg panics. The waiting question is
checked at the core requester too. out.rs tests move to src/tests.
postpone wrote the failure but did not refresh the workspace, so the row kept
its old label until something else refreshed it. The reason is also trimmed to
one short line for the row.
Cost: product Rust went from 79874 to 80109 lines (+235), and the ceiling is set to that count.
A checkout names a branch git already has, so refusing a bidi mark there would
stop a working repo's branch. The behaviour doc now lists the new refusals for
section names, skill text, and theme files, with a pointer to decision 245.
…t checks the real pid

The row test stepped the clock, so a second start could refresh the page and
hide a missing refresh. It now runs one start and reads the row directly. The
lock test now checks the pid against the child it started.
# Conflicts:
#	.config/size-budget.txt
#	docs/decisions.md
Linux limits one command-line argument to 128 KiB, so the 150 000-character
body failed to spawn there with 'Argument list too long'. A 100 000-character
body still overflows a pipe buffer on both systems.
@aorumbayev
aorumbayev merged commit d0c3bb0 into main Nov 11, 2026
35 of 37 checks passed
@aorumbayev
aorumbayev deleted the feat/qa-core-safety branch November 11, 2026 18:04
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

0