Skip to content

0.12.0 --- the working directory reaches the program, and a unit can be asked for - #26

Merged
Sunrisepeak merged 3 commits into
mainfrom
spawn-is-one-operation
Aug 30, 2026
Merged

0.12.0 --- the working directory reaches the program, and a unit can be asked for#26
Sunrisepeak merged 3 commits into
mainfrom
spawn-is-one-operation

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Two of the three things a consumer's own tests were red on are now green, and
both were measured against their tree rather than against a probe of mine.

chdir' NOW REACHES A STARTED PROGRAM. openkal 0.11 carries a second directory per start, so okm_cwd_dir' --- which is what chdir' has always moved, this library having no other place to move --- is passed as the one the program runs in. That closes the fork' route too: a copy that chdir'd has its own
okm_cwd_dir', and the execve' it then performs reaches the same line.

POSIX_SPAWN_SETPGROUP' is honoured, in the one form this port can mean: a zero group asks for a unit of the program's own, which openkal 0.11's kal_spawn.job'
says exactly. A NAMED group is still refused rather than quietly turned into a
different one --- openkal cannot put a program into somebody else's unit.

⚠️ WHAT IS STILL RED, AND IT IS ONE ASSERTION. The consumer forms its group with
fork'; setpgid(0, 0)'; execvp' and then kills by number from the parent. The unit that start forms belongs to the STARTED program, whose identifier is not the copy's --- so the parent's kill(-pid)' names a group that is not the one that
exists. Closing it needs an operation that puts THE CALLING program into a unit,
which openkal does not have and which is the obvious next declaration. Recorded
rather than approximated.

Measured on the consumer's tree, both architectures: cwd: 子进程 chdir 生效' and EOF 早到: 进程未残留' green, 超时: 后台后代随组死' still red; agent-core 42/9 to 43/8, with test_chat_tools' bash-cwd now green.

…be asked for

Two of the three things a consumer's own tests were red on are now green, and
both were measured against their tree rather than against a probe of mine.

⭐ `chdir' NOW REACHES A STARTED PROGRAM. openkal 0.11 carries a second directory
per start, so `okm_cwd_dir' --- which is what `chdir' has always moved, this
library having no other place to move --- is passed as the one the program runs
in. That closes the `fork' route too: a copy that chdir'd has its own
`okm_cwd_dir', and the `execve' it then performs reaches the same line.

`POSIX_SPAWN_SETPGROUP' is honoured, in the one form this port can mean: a zero
group asks for a unit of the program's own, which openkal 0.11's `kal_spawn.job'
says exactly. A NAMED group is still refused rather than quietly turned into a
different one --- openkal cannot put a program into somebody else's unit.

⚠️ WHAT IS STILL RED, AND IT IS ONE ASSERTION. The consumer forms its group with
`fork'; `setpgid(0, 0)'; `execvp' and then kills by number from the parent. The
unit that start forms belongs to the STARTED program, whose identifier is not the
copy's --- so the parent's `kill(-pid)' names a group that is not the one that
exists. Closing it needs an operation that puts THE CALLING program into a unit,
which openkal does not have and which is the obvious next declaration. Recorded
rather than approximated.

Measured on the consumer's tree, both architectures: `cwd: 子进程 chdir 生效'
and `EOF 早到: 进程未残留' green, `超时: 后台后代随组死' still red; agent-core
42/9 to 43/8, with `test_chat_tools' bash-cwd now green.
Three calls a shell runner makes, each of which used to succeed and change
nothing a caller could observe --- which is the failure shape this port names in
okm_opt.h and had three more instances of.

`setpgid(0, 0)' answered 0 and formed nothing. True in a world with no groups, so
it was not a lie; it was also not a unit, and the caller's next act ---
`kill(-pid)' --- found nothing to kill. It is now `kal_process_job_enter'.

`kill(-n)' answered ESRCH while a unit existed. It now names the unit: the one
this program formed, or the one a start formed for a child. ⚠️ THE UNIT IS KEPT
PAST THE WAIT, and that is the case a unit is used FOR --- a shell exits at once
and the work it backgrounded is what a timeout has to reach. Clearing it on the
wait made this answer ESRCH a fraction of a second before every caller that
wants it; measured, the background work survived.

`posix_spawn_file_actions_addchdir_np' was refused along with everything this
file could not express. openkal 0.11 gives a spawn a second directory, so both
chdir actions are now answered.

⚠️ `POSIX_SPAWN_SETPGROUP' is honoured only in the form this port can mean: a
zero group asks for a unit of the program's own, which is exactly
`kal_spawn.job'. A NAMED group stays refused --- openkal cannot put a program into
somebody else's unit, and turning that request into a different one quietly is
the defect above with a fourth instance.

⚠️⚠️ AND ONE IDIOM REMAINS OUT OF REACH, WHICH IS RECORDED AND NOT APPROXIMATED.
`fork(); setpgid(0, 0); exec…' forms a unit led by the program the COPY starts,
whose identity the original never learns --- so the original's `kill(-pid)' names
a group that is not the one that exists. Closing it needs the copy and its parent
to agree on a name before either exists, which nothing here can arrange.
`posix_spawn' with the attribute above is the form that works, and it is what the
consumer moved to.
⚠️⚠️ A replacement leaves ONE image; this composition leaves two, and the one
that remains still held every file description the caller had --- including the
write end of a pipe it had just placed at the started program's standard output.
A pipe reports the end of input when the LAST writer lets go, so the reader on
the other side saw a stream that was still open, from a program that had ended.

⭐ Measured through a consumer: an MCP server that exits mid-request should be
reported as "Connection closed" and was reported as "Timed out after 1000ms".
The server was gone, nobody was writing, and the pipe stayed open because of a
waiter neither side knew existed.

⚠️ THIS IS THE 0.10 DEFECT'S THIRD FACE. `kal_process_spawn_bound' was added
because a SIGNAL reached the middle image; this is the middle image holding a
RESOURCE. Same fact, same fix: make that image as invisible as it claims to be.
@Sunrisepeak
Sunrisepeak merged commit a891730 into main Aug 30, 2026
10 of 12 checks passed
@Sunrisepeak
Sunrisepeak deleted the spawn-is-one-operation branch August 30, 2026 20:24
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