Skip to content

fix: gate, guard and container fixes found by the first geectl runs - #181

Merged
plusky merged 36 commits into
mainfrom
release/4.0.1
Dec 2, 2026
Merged

plusky merged 36 commits into
mainfrom
release/4.0.1

Conversation

@plusky

@plusky plusky commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Fixes the defects the first live runs on geectl hit: the gate and target gate read geectl's pull-request search payload, the gate judges only the change's own validator findings and compares a red build with the target, and a _link naming no package resolves to the same name. Also hardens the guard against login printing and state-change verbs in program text, fixes the container launcher's defaults, and has the skill use the memory and sequential-thinking servers when present.

plusky added 29 commits December 2, 2026 13:28
…d JSON

The sed that takes "experimental" out of the image's opencode.jsonc deletes
one line. Should that object ever span lines, the rest of it stays behind and
nothing noticed: the build and image-check now parse the edited file (its
whole-line // comments dropped) and fail when it does not parse or still sets
experimental.
install asks geectl for the changelog identity in its config file with no
time limit, so a geectl that hangs stalled install. The call now gets the
same timeout as the launcher's other bounded calls; one that runs out counts
as no identity from the config, with the usual notice.
The launcher looks commands up on its fixed PATH only, so a geectl in
~/.local/bin, where the README's own tarball and cargo routes put it, is
never asked and install just reported no changelog identity. The notice now
says geectl is not on the launcher's PATH and that SKILL_CONTAINER_PATH or
VC_REALNAME and VC_MAILADDR provide the identity; the PATH stays free of
home directories.
…tity

A changelog name or address has no use for U+2028, U+2029 or U+00A0, and
they would pass into the drop-in unseen. The identity check now refuses them
like the controls and unit-file specials, and the suite pins the CR,
backslash, dollar and C1 cases the check already refused.
…ed defaults

up rewrote ~/.config/skill-container/<name>/opencode.json on every run with a
plain redirect: not atomic, through a symlink, and with new bytes and mtime
even when nothing changed. It also filled only absent top-level keys, so a
file with its own "experimental" object never got automations, a file with
comments stopped up with "not JSON", and a blank file became a bare newline.

The file is now written to a temporary file beside it and renamed over it with
its mode, only when it changes; a symlink or a non-regular file is refused and
left as it is. Each missing default goes in, inside existing experimental and
compaction objects too, and no value the user set changes. A blank file is
taken as {}; a file that is not plain JSON is left alone, up names the two
settings to add by hand and carries on.
The README said the container's rules refuse every command that would ask,
so an automation cannot accept, decline or file anything. The guard and deny
rules catch the ordinary command forms of those actions; they are no
containment against a prompt written to get around them, and the text now
says that the container is.
An upgrade that ran the new secrets before install left the old units naming
the osc image's secret; once it was gone, their restarts failed until install
wrote the new units. secrets never touches that secret, which the suite now
pins, and the README says the old units need it until install has replaced
them and every instance is up again. It also says a re-install writes the
drop-in from its own flags, so --workdir, --as and --image are given again.
Harnesses and the container already offer a memory graph and a
sequentialthinking tool, but nothing told the agents to use them, so
holds, verdicts and in-flight requests were rediscovered every session
and scheduled runs had no state to filter on. Each block now starts with
a memory read and records every landing as it lands; a batch keeps one
entity current so restarts, sub-agents and the next run continue from
it. The sub-agents get the tools in their frontmatter. Both stay
optional: no gate depends on them, and memory is data that never waives
a gate, a HARD RULE or the user's go.
The container configures both servers but its instructions named
neither, and the agent could not tell that its memory graph persists
across restarts and image updates.
platform.machine() says arm64 on macOS and amd64 on the BSDs, so a
local-build for the host's own arch (--arch aarch64 on an Apple machine)
was refused as emulated. The host's name is mapped to OBS's spelling
before the comparison.
The environment rules ran on the command line before its wrappers were
taken off, so timeout, nice, command, env or stdbuf in front of printenv
GEECTL_OBS_PASSWORD let it print the login, and timeout 5 env dumped the
environment. The command a wrapper runs is now judged too; command -v
only looks the name up, and xargs takes its names from stdin, so neither
counts.
declare -p, typeset -p and readonly -p print a variable they name, and a
bare readonly or readonly -p lists every read-only one, so they printed a
login unjudged; the prefilter now passes readonly to the rules. ${NAME+word}
prints the word as ${NAME:+word} does, so it is no longer refused, for a
login file variable either.
Only a PR merge or approve was refused inside python -c, perl -e or a
written script, where the guard cannot read the reference or --live.
The other actions the command-line rules judge (a PR decline or reopen,
a request accept, decline, change-state or change-review-state) slipped
through there unjudged. They are now refused in program text with a
message to run them as their own geectl call. Docs, .changes files and
comment lines stay writable; the guard's own help is reworded so running
it is not refused.
On a Python whose fnmatch keeps a descending range (3.9, still the
system Python on macOS), program text with a list such as
['foo-bar', 'baz-qux'] made glob.glob raise re.error, and the guard
refused the harmless call as undecided. Such a word now names itself.
…rgets

These leaves change the project they name, yet a live run against a
maintenance or update project passed unjudged, where any other direct
write is refused. They now go through the same maintenance-project
rule; on a home: branch they still pass.
build check-sonames, build verdict, check install-conflicts and request
forward-check are reads, but as leaves the table lacked a --live run of
them asked as an unknown leaf. meta set takes --from-file, and
pull-request merge takes --comment and -m/--forward-message, not
--message, as geectl's help shows.
fd_target took any name a {name}> redirection allocated for a
descriptor, even when the same call then gave it a path, so
exec {fd}>&2; fd=~/.claude/settings.json; echo x >&$fd wrote the
harness settings unjudged. The value the call gives the variable now
decides; the allocation counts only when there is none.
geectl request file run in a home: working copy without --source-project
files from that checkout, yet the submit rules read only the options, so
such a filing skipped the link, target, forward and gate checks that a
pull-request submit from the same checkout gets. A source or package the
options leave out is now read from the working copy, as the submit path
does.
geectl 0.3.1, the skill's minimum, refuses a cleanup submit from a
non-home: source itself, so the help and the comment that said the rule
stands until it does were stale. A host may still run 0.3.0, which files
it, so the rule stays and the text now says so.
The stranded-update forward is filed from the devel project, which
cleanup would delete on accept; geectl 0.3.1 and the guard refuse that
filing as printed, so the command preflight gives to copy failed. Both
the file and the refile command now carry --without-cleanup.
pr-guard.py's help describes geectl forms it judges, and naming one of
their options (--live, --arch, --without-cleanup, ...) failed the check as
a flag the guard's synopsis lacks. Those options are now exempt whether
the help names them or not, so the help can say what a rule means.
The added-file scan looked at the top level only, so a new file below a
subdirectory showed as the directory, not by its name. A .osc/ checkout
tracks no subdirectory, so everything below one now counts as added, by
its path. The multi-login import split geectl's URL list on every comma,
breaking a URL that holds one, and the instance loop word-split its
aliases; both lists are now read one entry per line, on a separate
descriptor so the geectl calls in the loop cannot consume them.
A search answer whose pull_requests was an object iterated as an empty
set, so every PR in the baseline read as resolved. Anything but a list
now makes the Gitea leg unavailable for the run and keeps the baseline.
geectl pull-request search answers an object, {"pull_requests": [...],
"count", "skipped", "skipped_items"}, but target-gate.sh and preflight.sh
parsed a bare list, so target-gate refused every --build and --remote run
as an unparseable PR list and preflight refused every git devel project.
Their suites passed only because the fake geectl answered a list. Both
now read pull_requests from the object, and refuse an answer whose list
is not one or that skipped an arm or an item, as the list may then lack
a PR. The stubs answer the real shape; target-gate asks for JSON
explicitly so a text format in the config cannot break the read.
…hout its history

A staleness check whose source lookup fails reads STALE UNKNOWN for that
request, and nothing more: when it failed for every open request the
output was a column of quiet UNKNOWNs with the cause only in stderr noise.
When every lookup fails, one ERROR line now names the count and the first
failure's text, on stdout as well as stderr.

In --pr, one build whose job history could not be read turned a green
head into UNKNOWN. The results already say each build succeeded and the
obsinfo already pins the head; the job history only catches a build of
older sources. An unreadable history now leaves that build to its
results, named on its own line; only when no history reads is the check
unknown.
Old .changes entries are never rewritten (changes-guard enforces
insertion only), so a validator finding in an older entry left a real
update unfileable. Every rule's finding in an entry older than the
newest --entries N is now printed as pre-existing and not judged.

A finding with no entry line (line 0, or about a file other than a
.changes) is judged unless a validate run of the base tree reports it
too: the --git-base ref, a geectl working copy's base revision, the
upstream ref unless it is a pushed branch holding HEAD, or an osc
checkout's committed copy. A package without a base is judged in full,
and V2 (no .changes differs from the target) always is, since a base
can carry it without excusing a change that adds no entry.
OBS reads a _link without a package attribute (or project) as the
linking package's own; the scripts instead treated it as unreadable.
gate.sh --obs-build therefore could not record a verdict for such a
package, so a ready update could not be filed. gate.sh, sr-status.py,
changes-patches.sh and forward-check.py now default the missing target
to the linking package, hop by hop.
The review-self refusal said only "the changes-review agent", which
reads as satisfied by a general-purpose agent told to do the review.
The guard checks the harness agent type, so the message now says the
PASS must come from an agent of type changes-review.
…o link

A red already present in the target for the same repo/arch is not the
change's and still files (it is reported). --obs-build only compared
with a branch's link origin, so a package built without a link stayed
red on a result the target shows identically, and a ready update
could not be filed.

Without a link origin, a red is now compared with the stamp's target
when that is another package. Either way it is excused only on the
same code there, and an unresolvable one only with the same detail
text; a result green in the target stays red. A failed read of the
target excuses nothing.

@scarabeusiv scarabeusiv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the full diff. The gate's own-findings logic, the target comparison, the _link fallback in all four places, the guard hardening and the container up rewrite all hold up, and the new tests pin the claimed behaviour. Approving with three lows and two nits below, none blocking.

LOW — sr-status.py stale_all: SOURCE_TRIED/SOURCE_ERRORS are module globals that are never cleared, and main calls stale_all twice on one --summary run (summary, then the decline-note block). In the second call checked still holds the first call's rows, so len(failed) == len(checked) can fail even when every lookup in the second call failed, and the "every source lookup failed" line goes missing from that view. Clearing both at the top of stale_all() fixes it.

LOW — gate.sh validatebase: the removal pass lists untracked files with git ls-files --others --exclude-standard, which omits git-ignored files, while the copy pass takes every top-level file including ignored ones. An ignored, unreferenced file in the working tree (a *.obscpio a .gitignore covers) therefore survives into the rebuilt base, the base run reports the same V7, and the change's own V7 is excused as "also on the base". Listing ignored files too in the removal pass closes it.

LOW — sr-status.py older_builds: one unreadable job history is now judged by its results alone instead of making the check UNKNOWN. A build that is actually from older sources can show GREEN for one watch pass; the unread build is named in the output and the next pass re-checks, so this is a tradeoff worth naming, not a blocker.

NIT — the PR body says "the gate and target gate read geectl's pull-request search payload", but gate.sh reads no such payload; only target-gate.sh, preflight.sh and watch-submissions.sh parse it.

NIT — skill-container setprog: os.umask(0o022) followed immediately by os.umask(umask) reads and restores the umask before mkstemp runs, so the temporary change has no effect.

…s files

A file-level finding was excused when a run over a local base reported
it too: the working copy's first commit, the osc committed copy, or the
clone's upstream ref. Each of these can already hold the change (a
pushed topic or default branch, a re-checkout of a home branch that
carries it, a new package's first commit), so a finding the change
introduced was excused.

The base is now built from the target's files only, read from OBS: its
spec and .changes, the other files as empty stand-ins. Without a target
other than the checkout's own project, for a package the target lacks,
or when a read fails, there is no base and every finding is judged. An
explicit --git-base remains the caller's choice, and a ref that already
holds the change excuses it.
The PR list is parsed as JSON, but the call relied on geectl's default
format. A GEECTL_FORMAT=text environment or config setting made the
answer text and the Gitea leg CHECK-FAILED. target-gate.sh already
passes --format json; preflight now does too.
…tries

Every finding located in an older entry was excused, whatever its rule.
That included the validator's check that an older entry still matches
the target, which only a change rewriting that entry triggers, and the
end-of-file checks, which land on the last line of the oldest entry.
Neither is about a pre-existing format quirk the change cannot touch.

Only a V5 finding about an older entry's own header or order (one not
comparing with the target) is now left unjudged; the rest are judged
like any finding of the change.
The suites now run 35 to 45 minutes on the hosted runners, so the
45-minute limit cancels a job that would have passed.
Trailing blank lines at the end of a .changes lie in its oldest entry,
which changes-guard forbids touching, while the validator flags them.
When the target's own copy ends the same way, a package could not be
filed at all.

Such a finding is now excused when the validate run over the target's
files reports it too (its line moves with the new entry, so the line is
not compared) and the change's copy ends in no more blank lines than
the target's. Without a target base (the checkout's own project, a new
package, a failed read, no target) it is judged, as before.
Only the exit code of each target read was checked. A read that exits
0 with an empty, cut-short or error-page body built a base whose broken
spec reports the same findings a change introduces (no %changelog, no
Version), so those were excused.

Every .spec and .changes read for the base must now be non-empty and
match the md5 the target's listing gives for it; otherwise there is no
base and every finding is judged.
The own project came only from git config geectl.project. In a
checkout without it, one that names its project in .osc/_project, a
--target equal to that project was read as the base, although the
change may already be committed there, so a finding it introduced was
excused.

Such a checkout's .osc/_project now counts as its own project, and a
target equal to it gives no base. Without either, an explicit --target
is still taken as the base.
@plusky
plusky merged commit b1a38ad into main Dec 2, 2026
5 checks passed
@plusky
plusky deleted the release/4.0.1 branch December 2, 2026 16:37
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