Skip to content

fix: config-editor lint warnings and stale cargo test artifacts - #4

Merged
whatobiplays merged 2 commits into
mainfrom
codex/config-editor-warnings-and-cargo-freshness
Aug 21, 2026
Merged

fix: config-editor lint warnings and stale cargo test artifacts#4
whatobiplays merged 2 commits into
mainfrom
codex/config-editor-warnings-and-cargo-freshness

Conversation

@whatobiplays

@whatobiplays whatobiplays commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Summary

Two independent fixes, validated together:

  1. Stale Cargo test artifacts: make test now runs a content-digest freshness gate for the backend crate (crates/emuchef-rust-backend). When the digest of build inputs changes, the Makefile performs a package-scoped cargo clean -p emuchef-rust-backend before cargo test, so a preserved-mtime checkout cannot silently run an outdated test executable. The pending/stamp protocol is interruption-safe, unchanged sources skip the clean, and no TLS behavior is modified.

  2. Config-editor lint warnings: stabilized the functions captured by the two useEffect hooks in App.tsx with useCallback (declared above the effects, generic contract preserved), and moved the non-component exports out of ResizableEditorLayout.tsx into resizableEditorLayout.logic.ts with focused node:test coverage registered in test:logic.

Validation

  • make test passes (fresh run on this exact tree)
  • Config-editor lint reports zero warnings
  • npm --prefix apps/config-editor run typecheck passes
  • npm --prefix apps/config-editor run test:logic passes (149/149)

Summary by cubic

Prevents stale backend Cargo test binaries and resolves config‑editor lint warnings. Previously, preserved mtimes could let make test run an outdated emuchef-rust-backend test binary; now a content‑digest freshness gate cleans the package before cargo test when inputs change, while unchanged sources skip the clean.

  • Adds a test freshness gate to make test: runs tools/cargo-test-freshness.mjs for emuchef-rust-backend; on digest change or pending marker, runs cargo clean -p emuchef-rust-backend before tests. Script and its node:test are wired via cargo-test-freshness-check.
  • Stabilizes App.tsx effect dependencies by hoisting handlers to useCallback, eliminating React lint warnings without changing runtime behavior.
  • Extracts non-React logic from ResizableEditorLayout.tsx into resizableEditorLayout.logic.ts and adds focused unit tests; updates test:logic to include the new logic and tests.

Written for commit 3797092. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 8 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="tools/cargo-test-freshness.test.mjs">

<violation number="1" location="tools/cargo-test-freshness.test.mjs:167">
P2: The "unreadable build input fails closed" test relies on chmod 0o000 making src/lib.rs unreadable, which is not guaranteed: when the test runs as root (common in CI containers), on filesystems that do not enforce permission bits (overlayfs/rootless containers), or on Windows, the read still succeeds and the script exits 0. In such environments this test fails and breaks the cargo-test-freshness-check stage of `make test`. Trigger the read failure with a mechanism that does not depend on mode-bit enforcement, or guard/skip the test when the mode is not honored (e.g., detect that the file is still readable after chmod and skip).</violation>
</file>

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

Re-trigger cubic

fs.rmSync(crateDir, { recursive: true, force: true });
});
const stampFile = path.join(crateDir, "target", ".fixture-source.sha256");
fs.chmodSync(path.join(crateDir, "src", "lib.rs"), 0o000);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: The "unreadable build input fails closed" test relies on chmod 0o000 making src/lib.rs unreadable, which is not guaranteed: when the test runs as root (common in CI containers), on filesystems that do not enforce permission bits (overlayfs/rootless containers), or on Windows, the read still succeeds and the script exits 0. In such environments this test fails and breaks the cargo-test-freshness-check stage of make test. Trigger the read failure with a mechanism that does not depend on mode-bit enforcement, or guard/skip the test when the mode is not honored (e.g., detect that the file is still readable after chmod and skip).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tools/cargo-test-freshness.test.mjs, line 167:

<comment>The "unreadable build input fails closed" test relies on chmod 0o000 making src/lib.rs unreadable, which is not guaranteed: when the test runs as root (common in CI containers), on filesystems that do not enforce permission bits (overlayfs/rootless containers), or on Windows, the read still succeeds and the script exits 0. In such environments this test fails and breaks the cargo-test-freshness-check stage of `make test`. Trigger the read failure with a mechanism that does not depend on mode-bit enforcement, or guard/skip the test when the mode is not honored (e.g., detect that the file is still readable after chmod and skip).</comment>

<file context>
@@ -0,0 +1,174 @@
+    fs.rmSync(crateDir, { recursive: true, force: true });
+  });
+  const stampFile = path.join(crateDir, "target", ".fixture-source.sha256");
+  fs.chmodSync(path.join(crateDir, "src", "lib.rs"), 0o000);
+
+  const result = runFreshness(crateDir, stampFile);
</file context>

@whatobiplays
whatobiplays merged commit 1e584f7 into main Aug 21, 2026
3 checks passed
@whatobiplays
whatobiplays deleted the codex/config-editor-warnings-and-cargo-freshness branch August 21, 2026 21:50
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