Repository navigation
Pin the syberlabs CLI surface Syber's SyberWork builder calls (contract 2's receiving end today) - #175
Pin the syberlabs CLI surface Syber's SyberWork builder calls (contract 2's receiving end today)#175sykosyber wants to merge 3 commits into
Conversation
…ct 2's receiving end today) SyberLabs/syber lib/factory/syberwork-builder.mjs runs each job as a Build Thread by shelling out to syberlabs: start --class R, propose --claude-code --bare --lane provider_3p, status --json, check --json, diff, accept, export. Nothing in this repository named that consumer, so a change to a JSON field or a new propose refusal would surface in Syber first. Three tests pin exactly the fields and argv Syber relies on: a passing candidate end to end, a failing one, and Syber's propose line building the provider it asks for (no Claude Code runs; the executable answers --version only and the search is stopped before any call). Test-only; no behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0f292baf0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| self.assertEqual((provider.name, provider.revision, provider.max_calls), ("syber-line0", "1", 2)) | ||
| self.assertIs(provider.githits, False) | ||
| self.assertEqual(provider.mcp_config, None) | ||
| self.assertFalse(any(re.match(r"^(Bash|PowerShell|WebSearch|WebFetch)$", t) for t in provider.allowed_tools), |
There was a problem hiding this comment.
Reject scoped shell and web tool entries
If the default tool list later includes a scoped entry such as Bash(git log *), this exact-name regex will not recognize it, so the seam test can pass despite allowing a shell tool. Check the base tool names (or otherwise cover scoped forms) so the test catches that access widening.
AGENTS.md reference: AGENTS.md:L212-L215
Useful? React with 👍 / 👎.
| self.assertFalse(any(re.match(r"^(Bash|PowerShell|WebSearch|WebFetch)$", t) for t in provider.allowed_tools), | ||
| "Syber's builder relies on the default tools: no shell, no web lookups") |
There was a problem hiding this comment.
Scoped shell tools escape detection
The assertion only rejects exact tool names. An entry such as Bash(git *) passes, but built_in_tools() turns it into Bash when building the command. The constructor permits shell tools on this path because neither GitHits nor an MCP config is enabled.
Check scoped entries too, or assert the expected tool list explicitly. Otherwise, adding restricted shell access could leave this no-shell test green.
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_syber_builder_seam.py
Line: 146-147
Comment:
**Scoped shell tools escape detection**
The assertion only rejects exact tool names. An entry such as `Bash(git *)` passes, but `built_in_tools()` turns it into `Bash` when building the command. The constructor permits shell tools on this path because neither GitHits nor an MCP config is enabled.
Check scoped entries too, or assert the expected tool list explicitly. Otherwise, adding restricted shell access could leave this no-shell test green.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.|
Independent review (OpenAI gpt-6-astra): CHANGES REQUESTED at The change is focused and adds useful success, failure, and provider-construction coverage without changing runtime code. However, it does not fully pin the invocation contract it documents: every test supplies repository and home options that Syber explicitly omits. Review is based on the supplied diff; tests were not independently run.
Response |
… worktree Review finding on #175: run_cli always passed --repo, --home and --actor, but Syber's builder (syberwork-builder.mjs:350-370) runs the CLI in the job worktree with none of them. SyberBuilderDefaults runs the steps as subprocesses in a temporary worktree with Syber's environment, a temporary HOME, USERPROFILE and XDG directories, an empty global git config and no system config: the disposable repository as Syber makes it, init, start --class R, status --json, check --json, accept, status --json and export. It asserts the default home, repository discovery and the default actor. Fails first: --repo default '.' -> '..' fails it at init (exit 2), --home default moved fails the default-home assertion, and the actor fallback renamed fails the actor assertion; all three reverted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…git config Independent read of the previous commit: syberlabs drops every GIT_* variable before running git (gitspace.Repo._env), so GIT_CONFIG_NOSYSTEM did not reach its `git config user.email`. The precondition now asks git with the same environment syberlabs gives it, and the docstring says the host's system config is in that view, as on a Syber host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| self.assertEqual((done.returncode, done.stdout.strip()), (1, ""), | ||
| "no git identity in syberlabs' view (a host system gitconfig with user.email would set one)") |
There was a problem hiding this comment.
Machine settings break the test
If the host has a system-level user.email, this assertion fails before any CLI step runs, even though the CLI behaves correctly. Repo._env() removes GIT_CONFIG_NOSYSTEM and GIT_CONFIG_GLOBAL, so the temporary home does not isolate that setting.
Make the fixture independent of system Git settings while keeping the CLI defaults under test.
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_syber_builder_seam.py
Line: 210-211
Comment:
**Machine settings break the test**
If the host has a system-level `user.email`, this assertion fails before any CLI step runs, even though the CLI behaves correctly. `Repo._env()` removes `GIT_CONFIG_NOSYSTEM` and `GIT_CONFIG_GLOBAL`, so the temporary home does not isolate that setting.
Make the fixture independent of system Git settings while keeping the CLI defaults under test.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.…t (B2-2) Two tests from #175 (tests/test_syber_builder_seam.py at 7d08a7f) that #176 did not cover: - SyberBuilderDefaults, ported whole: Syber's steps as subprocesses in a job worktree made the way Syber makes it, in Syber's environment, with no --repo/--home/--actor and no inherited git identity. Asserts the default home is the worktree's .syberlabs, the thread branch is in the worktree's repository, the default actor is "developer", and nothing is written beside the worktree. Keeps #175's precondition that fails on a host whose system gitconfig sets user.email. - The proposer-provider test, observed on real stand-in runs instead of by mocking Thread.propose (the unit under test): bare, provider_3p with cost basis estimated, at most --max-calls calls, default tools without Bash/PowerShell/WebSearch/WebFetch, no --mcp-config, no GitHits signal. Each fails against a deliberate break (local, reverted): provider_3p billed, Bash in DEFAULT_TOOLS, --max-calls ignored, default actor changed, default home moved out of the worktree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Superseded by #176 (B2-2, gestalt plan): its unique tests are ported there. |
Admission
Class: R
Agent-platform: claude
Reviewed-by: pending: needs a reviewer on a platform other than claude
Admitted-by: self (Class R)
Evidence: tested
Summary
This PR pins, inside SyberWork, the exact
syberlabsCLI surface that Syber's SyberWork builder depends on. That surface is the Syber → SyberWork half of contract 2 as it runs today. SyberLabs/syberlib/factory/syberwork-builder.mjs(read at5a4667f) runs these steps in the job worktree, with Syber's own environment and no--repo,--homeor--actor:init(:399),start <objective> --class R(:402),propose --claude-code --bare --lane provider_3p …(:408),status --json(:411),check <id> --json(:435),diff <id>(:446),accept <id>(:455),status --json(:460) andexport(:417). Before this PR, no SyberWork test named that consumer.tests/test_syber_builder_seam.pyhas two classes:SyberBuilderSeam(3 tests, in-process). It checks every JSON field and argv Syber reads:ClaudeCodeProvider(bare,provider_3p, no GitHits, no MCP config, no shell or web tool). No Claude Code runs: the executable only answers--version, and the search is stopped before any call.SyberBuilderDefaults(1 test, added for the review finding atc0f292b). It runs each step as a subprocess withcwdset to a temporary job worktree:HOME,USERPROFILEand XDG directories and no inherited git identity;init,start --class R,status --json,check --json,accept,status --jsonandexport, with no injected options.It asserts:
.syberlabs;target;developerwhen there is nouser.email, rather than the commit's inline identity;Acceptance criteria
PYTHONPATH=. python -m unittest tests.test_syber_builder_seam -vRan 4 tests … OK--repo,--homeor--actor, frominitthrough the later state readsSyberBuilderDefaults.test_the_steps_run_on_the_defaults_from_the_job_worktreegit config user.emailwith the same environment syberlabs gives git (gitspace.Repo._envdropsGIT_*)--repodefault"."to".."insyberlabs/cli.py, run AC1's command, then revertFAIL … AssertionError: 2 != 0 : syberwork-builder.mjs:399(the other 3 tests stay green)--homedefault changed to.syberlabs-moved; actor fallback"developer"changed to"anonymous"; both revertedAssertionError: False is not true : the default home is the worktree's .syberlabs;AssertionError: 'anonymous' != 'developer'in_scoperenamed inThread.status;ClaudeCodeProvidermade to refuse--barewithprovider_3p; both revertedThreat model
The change is test-only, and no runtime code changes. The surface it pins includes:
provider_3pthrough Syber's key proxy);The tests read no credential and print no environment value. The subprocess environment is built from scratch, not copied from the caller.
Tests
tests/test_syber_builder_seam.py(new). No existing test, fixture or gate was edited.GIT_CONFIG_NOSYSTEMnever reached syberlabs' own git calls, becausegitspace.Repo._envdropsGIT_*. Fixed in7d08a7f: the precondition now asks git with syberlabs' view, and the docstring states that the host's system config is part of that view. It also noted that propose uses--from-worktreein the defaults test. That stays as is:_kitresolves repo, home and actor the same way for every propose source, and Syber's propose argv is pinned inSyberBuilderSeam.CI
See the checks tab for head
7d08a7f, which runs the full suite, the gates andadmit.Rollback
Revert the PR. It adds one test file and changes no runtime behavior.
Not verified
python -m syberlabs, while Syber runs thesyberlabsconsole script..gitor.syberlabsalready exists (mjs:390, 398).user.emailfails AC3 loudly instead of passing silently.Files outside the allowlist
None. The only file touched is
tests/test_syber_builder_seam.py.Review-tier is critical even though the change is test-only, because it pins the contract 2 (S0) seam, the proposer's lane and tool list, and default actor attribution.
Class: R (
policy.jsonfloors overgit diff --name-only origin/main...HEAD:tests/test_syber_builder_seam.py→auto (unmatched); AGENTS.md §1: a new unit test is R)Agent-platform: claude
Reviewed-by: pending: needs a reviewer on a platform other than claude
Review-tier: critical
🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge, with non-blocking test reliability and coverage issues.Fix with agent prompt
Summary
Adds tests for the CLI commands and fields Syber's builder uses.
Reviews (2) · Last reviewed commit: "Seam test: check the identity preconditi..." · Reviewed by Greptile