Skip to content

fix(ci): repair Kyber activation and main checks - #2274

Merged
shunkakinoki merged 2 commits into
mainfrom
codex/kyber-activation-ci
Aug 6, 2026
Merged

fix(ci): repair Kyber activation and main checks#2274
shunkakinoki merged 2 commits into
mainfrom
codex/kyber-activation-ci

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • inject the Nix-provided gawk path into the Kyber firewall activation script
  • keep CI dotagents sync deterministic by skipping ephemeral external skill installation while retaining repository-managed sync
  • make the CI dev shell provide ripgrep and isolate FishTape from host CAAM rotation state
  • suppress only intentional literal ShellSpec fixture warnings and add firewall substitution coverage

Validation

  • make shell-check
  • make shell-test-dev (1,931 ShellSpec examples; 447 FishTape tests)
  • nixfmt --check home-manager/services/firewall/default.nix
  • CI dotagents sync dry-run contains no external skill installer
  • Kyber activation package build is delegated to the Linux Nix CI runner because this workstation is aarch64-darwin and Kyber is x86_64-linux

Summary by cubic

Repairs Kyber firewall activation by injecting Nix gawk, stabilizes main checks by making dotagents sync deterministic in CI, and applies repository formatting to scripts and specs.

  • Bug Fixes

    • Inject Nix gawk into the firewall activation script; add substitution coverage in tests.
    • Skip external dotagents skill installation in CI while keeping repo-managed sync.
    • Improve test stability: isolate FishTape from host CAAM rotation, apply formatter output, and add shellcheck directives for intentional literal fixtures.
  • Dependencies

    • Add ripgrep to the dev shell.

Written for commit 56e4ce4. Summary will update on new commits.

Review in cubic

@indent-zero

indent-zero Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
PR Summary

Repairs two independent CI failures on main: the Kyber home-manager firewall activation referenced bare awk (not in the activation closure), and make sync was invoking the full dotagents sync which pulls external skills and writes into $HOME. The firewall script now resolves awk via pkgs.gawk (matching the k3s activation pattern), dotagents-sync branches on $CI to run only the safe sub-targets, and a few environmental / lint gaps are filled so shell/fish tests stay green.

  • Makefile: dotagents-sync runs ruler-prepare commands-sync skills-sync mcp-sync ruler-dotdirs-sync with DOTAGENTS_SKIP_SYNC=1 when CI=true, keeping the full dotagents sync for local runs.
  • Makefile: fish-test now exports CAAM_ROTATION_ENABLED= alongside the temp HOME/XDG_* vars so fishtape isn't polluted by the developer's shell.
  • home-manager/services/firewall/{activate.sh,default.nix}: substitutes @awk@${pkgs.gawk}/bin/awk at both awk call sites; file-scope # shellcheck disable=SC2016 added.
  • devenv.nix: adds pkgs.ripgrep (required by spec/openclaw_hydrate_spec.sh).
  • spec/activate_firewall_spec.sh: new assertion that activate.sh contains @awk@.
  • spec/activate_roborev_spec.sh: adds # shellcheck disable=SC2016 for intentional literal $… fixtures.

Issues

3 potential issues found:

  • dotagents-sync guards on $CI = "true" exactly, so runners that set CI=1/True/yes (CircleCI, some GitLab jobs) will fall through to $(MAKE) -C dotagents sync and hit the same failure this PR just repaired; consider [ -n "$$CI" ] or a case match. → Autofix
  • The new It 'uses nix-substituted awk' in spec/activate_firewall_spec.sh calls grep directly, while every other assertion in the same Describe uses bash -c "grep ..."; align it with the surrounding style for consistency. → Autofix
  • The new # shellcheck disable=SC2016 at the top of home-manager/services/firewall/activate.sh disables the check file-wide; scope it to the two @awk@ '...' blocks that actually need it so future single-quoted $VAR typos elsewhere still get flagged. → Autofix

CI Checks

Waiting for CI checks...


⚡ Autofix All Issues

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Improvements

    • CI synchronization now skips external skill installation while continuing other component updates.
    • Fish test runs no longer rotate CAAM keys.
    • Firewall activation now reliably locates the required text-processing tool across environments.
    • Development environments include ripgrep for faster project searching.
  • Tests

    • Added coverage for firewall activation and its configured tool path.
    • Updated shell test checks and formatting without changing existing test behavior.
  • Maintenance

    • Improved shell-script checks and consistency across setup and synchronization workflows.

Walkthrough

The PR updates CI-specific dotagents synchronization, adds ripgrep to the development shell, adjusts CAAM shell conditions, substitutes the firewall’s Awk path through Nix, and updates ShellSpec lint directives and assertions.

Changes

Tooling and shell services

Layer / File(s) Summary
Synchronization and development environment
Makefile, devenv.nix
CI uses a synchronization path without external skill installation. Fish tests disable CAAM rotation. The development environment includes ripgrep.
CAAM shell conditions and specifications
home-manager/services/caam/*, spec/caam_sync_service_spec.sh
CAAM scripts adjust shell quoting and condition formatting without changing control flow. The CAAM specification is reindented without behavior changes.
Firewall Awk substitution
home-manager/services/firewall/*, spec/activate_firewall_spec.sh
Firewall Awk calls use the Nix-substituted executable. The package wiring and specification cover this path.
ShellSpec lint and literal assertions
spec/activate_roborev_spec.sh, spec/dotfiles_updater_spec.sh
ShellCheck directives identify Bash fixtures and suppress literal-expression warnings. The canonical-host assertion matches literal interpolation syntax.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Poem

A rabbit checks the shell at night,
Awk paths now point to what is right.
CI skips skills, tests breathe free,
Ripgrep joins the dev burrow tree.
Safe sync hops from branch to branch.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the Kyber activation and CI check repairs in the changeset.
Description check ✅ Passed The description clearly explains the Kyber, CI synchronization, development shell, testing, and ShellSpec changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/kyber-activation-ci

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread Makefile
.PHONY: dotagents-sync
dotagents-sync: ## Sync dotagents (commands, skills, MCP configuration).
@$(MAKE) -C dotagents sync
@if [ "$$CI" = "true" ]; then \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Latent — CI detection is too strict: GitHub Actions sets CI=true so this works today, but other CI providers set CI=1 (CircleCI) or other truthy values. On those, the guard falls through to $(MAKE) -C dotagents sync, which is exactly what was failing before this PR. Safer to check [ -n "$$CI" ] (or a case for known truthy values) so the skip triggers on any CI runner.

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
# shellcheck disable=SC2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: This disable is file-wide, so any future single-quoted $VAR typo elsewhere in the script won't be flagged. The only lines that legitimately need SC2016 suppressed are the two @awk@ '...' blocks (lines 46 and 77). Scoping the disable to those specific lines keeps the rest of the file lint-covered.

End

It 'uses nix-substituted awk'
When run grep '@awk@' "$SCRIPT"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: Every other assertion in this Describe wraps its command in bash -c "..." (see lines 52-77). Using bash -c "grep '@awk@' '$SCRIPT'" here keeps the file uniform — both forms work in ShellSpec, but consistency avoids future confusion.

Suggested change
When run grep '@awk@' "$SCRIPT"
When run bash -c "grep '@awk@' '$SCRIPT'"

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 6 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="home-manager/services/firewall/activate.sh">

<violation number="1" location="home-manager/services/firewall/activate.sh:2">
P3: This `shellcheck disable=SC2016` is applied file-wide, which disables the single-quoted variable check for the entire script rather than just the two `@awk@ '...'` blocks that legitimately need it (around lines 46 and 77). This means a genuine typo elsewhere in the file (e.g. an unintended literal `$VAR` inside single quotes) would no longer be flagged. Scope the disable directive to just the two awk lines instead.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
# shellcheck disable=SC2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: This shellcheck disable=SC2016 is applied file-wide, which disables the single-quoted variable check for the entire script rather than just the two @awk@ '...' blocks that legitimately need it (around lines 46 and 77). This means a genuine typo elsewhere in the file (e.g. an unintended literal $VAR inside single quotes) would no longer be flagged. Scope the disable directive to just the two awk lines instead.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At home-manager/services/firewall/activate.sh, line 2:

<comment>This `shellcheck disable=SC2016` is applied file-wide, which disables the single-quoted variable check for the entire script rather than just the two `@awk@ '...'` blocks that legitimately need it (around lines 46 and 77). This means a genuine typo elsewhere in the file (e.g. an unintended literal `$VAR` inside single quotes) would no longer be flagged. Scope the disable directive to just the two awk lines instead.</comment>

<file context>
@@ -1,4 +1,5 @@
 #!/usr/bin/env bash
+# shellcheck disable=SC2016
 # Converge Kyber WAN firewall on every activation (IPv4 + IPv6).
 # Public SSH is denied on the WAN NIC; access is via Tailscale (and Latitude SG).
</file context>

@shunkakinoki
shunkakinoki merged commit f20808e into main Aug 6, 2026
31 of 32 checks passed
@shunkakinoki
shunkakinoki deleted the codex/kyber-activation-ci branch August 6, 2026 05:11

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@spec/activate_firewall_spec.sh`:
- Around line 79-82: Strengthen the “uses nix-substituted awk” test by verifying
replaceVars wiring rather than only checking the `@awk`@ token in the source
template. Add an assertion covering the awk configuration in the firewall
service definition, or instead run the generated activation script and verify
its substituted awk path; keep the existing template-token check only as
supplemental coverage.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e4cc0fd5-9dc5-49ac-a99b-05425d166e1e

📥 Commits

Reviewing files that changed from the base of the PR and between 28a762a and 56e4ce4.

📒 Files selected for processing (10)
  • Makefile
  • devenv.nix
  • home-manager/services/caam/setup.sh
  • home-manager/services/caam/sync.sh
  • home-manager/services/firewall/activate.sh
  • home-manager/services/firewall/default.nix
  • spec/activate_firewall_spec.sh
  • spec/activate_roborev_spec.sh
  • spec/caam_sync_service_spec.sh
  • spec/dotfiles_updater_spec.sh

Comment on lines +79 to +82
It 'uses nix-substituted awk'
When run grep '@awk@' "$SCRIPT"
The output should include '@awk@'
End

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Test the replaceVars wiring, not only the template token.

SCRIPT points to the source template, so this assertion passes whenever @awk@ remains in activate.sh. It does not detect removal or misconfiguration of awk = "${pkgs.gawk}/bin/awk" in home-manager/services/firewall/default.nix. Add an assertion for that wiring or test the generated activation script.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@spec/activate_firewall_spec.sh` around lines 79 - 82, Strengthen the “uses
nix-substituted awk” test by verifying replaceVars wiring rather than only
checking the `@awk`@ token in the source template. Add an assertion covering the
awk configuration in the firewall service definition, or instead run the
generated activation script and verify its substituted awk path; keep the
existing template-token check only as supplemental coverage.

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