Skip to content
This repository was archived by the owner on Aug 17, 2026. It is now read-only.

test(hive): make the full suite pass under evaos-teams-managed - #104

Merged
100yenadmin merged 1 commit into
mainfrom
fix/93-managed-feature-test-fixtures
Aug 4, 2026
Merged

test(hive): make the full suite pass under evaos-teams-managed#104
100yenadmin merged 1 commit into
mainfrom
fix/93-managed-feature-test-fixtures

Conversation

@100yenadmin

Copy link
Copy Markdown
Member

Closes #93. Test-only — no production behaviour changes. With this, desktop-tauri-managed-check runs the full desktop suite under the feature instead of just the adapter module, which was the point of the issue.

Before / after

Configuration Before After
cargo test (default) 1910 passed, 0 failed 1910 passed, 0 failed
cargo test --features evaos-teams-managed 1928 passed, 9 failed 1940 passed, 0 failed

Group A — six fixtures never established a managed session

They failed with "Hive access is not authorized; complete Electric Sheep sign-in first" where a signature was expected. That comes from require_managed_authorization (evaos_teams/authorization.rs:104) via AppState::signing_keys (app_state.rs:305).

The managed build is right to refuse signing without an authorized session. These tests are exercising signing behaviour, not the gate — they simply predate it. So they now authorize the fixture; no assertion was weakened and the gate is not bypassed. It reuses the authorize_managed_signing_test helper that already existed in app_state::tests (made pub(crate)) rather than inventing a new one.

Group B — three app_state tests encoded an intended behaviour difference

An identity.key that disagrees with the keyring resolves differently by design (app_state.rs:501):

  • Unmanaged adopts the file's key. This auto-heals installs stuck in the re-onboarding loop, where the keyring holds the shadow key from first launch and identity.key holds a later import that only reached the file — the file is the user's explicit intent.
  • Managed keeps the Keychain authoritative, because the canonical identity is server-selected, so a divergent file is stale by definition and is removed.

Both outcomes are now pinned. I used a single KEYRING_AUTHORITATIVE constant plus a small expected_key helper rather than scattering #[cfg] pairs through the assertions — it reads better and, not incidentally, keeps app_state_tests.rs inside its size ratchet (that file is grandfathered at 1418 lines and may not grow; it lands at 1417).

One case worth a reviewer's eye. In present_keyring_mismatched_file_adoption_store_failure_boots_with_file_key, managed removes identity.key even though the fake store rejects writes. I checked the production path rather than assuming: managed takes the ensure_marker_then_cleanup branch and attempts no adoption write at all, so a failing store cannot strand data. Correct, not a defect.

Review note on process

Codex authored the mechanical change; I reviewed it and made two corrections rather than passing it through:

  1. It had deleted the comments explaining why unmanaged adopts the file key — the pre-fix re-onboarding-loop history. That is a constraint the code cannot show, so I restored it (compressed to fit the ratchet).
  2. It reported "file-size ratchet PASS" on the first pass of this work by running the ratchet's unit tests rather than the ratchet itself. Same slip as in fix(hive): route mismatched local identity to managed recovery #91. Worth knowing when reading any worker-reported acceptance.

Both configurations, verified locally on this branch: cargo fmt --check · just desktop-tauri-clippy · just desktop-tauri-managed-check (full suite, 1940/0) · cargo test (1910/0) · file-size ratchet — all pass.

Related: #92 (canary now builds the adapter), #96 (a ratchet failure skips every Rust step — the reason none of this was visible).

Nine tests passed under default features and failed once the Electric adapter
was compiled in, invisible because no CI job enabled the feature. Two distinct
causes, both test-side; no production behaviour changes.

Six tests failed with 'Hive access is not authorized; complete Electric Sheep
sign-in first'. The managed build is right to refuse signing without an
authorized session - the fixtures simply predate that gate and are exercising
signing, not the gate. They now authorize the session through the existing
app_state::tests helper rather than weakening any assertion.

Three app_state tests asserted the unmanaged outcome of an identity.key that
disagrees with the keyring. Managed deliberately keeps the Keychain
authoritative and removes the stale file, because the canonical identity is
server-selected. Both outcomes are now pinned via a KEYRING_AUTHORITATIVE
constant instead of scattered cfg pairs, which reads better and keeps the file
inside its size ratchet.

The store-failure case deserves a note: managed removes identity.key even when
the fake store rejects writes. That is correct rather than a defect - managed
attempts no adoption write at all, so a failing store cannot strand data.

With all nine green, desktop-tauri-managed-check drops its evaos_teams filter
and runs the full suite under the feature, which was the point of the issue.

Closes #93
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 96d29a2d-62c5-42fb-ba6c-946a2074373e

📥 Commits

Reviewing files that changed from the base of the PR and between 73c2ee3 and b6f286e.

📒 Files selected for processing (7)
  • Justfile
  • desktop/src-tauri/src/app_state.rs
  • desktop/src-tauri/src/app_state_tests.rs
  • desktop/src-tauri/src/commands/channels_tests.rs
  • desktop/src-tauri/src/commands/profile.rs
  • desktop/src-tauri/src/managed_agents/persona_events/tests.rs
  • desktop/src-tauri/src/relay_admission.rs
📜 Recent review details
⏰ Context from checks skipped due to timeout. (13)
  • GitHub Check: Desktop E2E Integration (2/2)
  • GitHub Check: Desktop E2E Integration (1/2)
  • GitHub Check: Desktop Smoke E2E (4)
  • GitHub Check: Windows Rust (x86_64-pc-windows-msvc)
  • GitHub Check: Desktop Build (macOS)
  • GitHub Check: Desktop Smoke E2E (2)
  • GitHub Check: Desktop Smoke E2E (3)
  • GitHub Check: Desktop Smoke E2E (1)
  • GitHub Check: Desktop Core
  • GitHub Check: Rust Lint
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (rust)
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

**/*.rs: Do not introduce unsafe Rust code.
Do not introduce new unwrap() or expect() calls in production Rust paths; use ? and proper error types.
Add doc comments to every new public Rust API.

Files:

  • desktop/src-tauri/src/relay_admission.rs
  • desktop/src-tauri/src/commands/profile.rs
  • desktop/src-tauri/src/managed_agents/persona_events/tests.rs
  • desktop/src-tauri/src/commands/channels_tests.rs
  • desktop/src-tauri/src/app_state.rs
  • desktop/src-tauri/src/app_state_tests.rs
🧠 Learnings (1)
📚 Learning: 2026-07-30T11:25:18.286Z
Learnt from: 100yenadmin
Repo: electricsheephq/evaOS-Hive PR: 82
File: desktop/src-tauri/src/shutdown.rs:258-294
Timestamp: 2026-07-30T11:25:18.286Z
Learning: When reviewing code that concerns the Hive Internal Canary supported architecture, use the supported-release-path model as the baseline: it is a single company, single relay/community, single VM, and single Hermes gateway. Do not treat multi-community runtime-pair behavior (e.g., a single local managed-agent record spanning multiple communities) as a “release-path regression” in review—this multi-community pattern is not a supported release path, so its presence should not trigger regression warnings.

Applied to files:

  • desktop/src-tauri/src/relay_admission.rs
  • desktop/src-tauri/src/commands/profile.rs
  • desktop/src-tauri/src/managed_agents/persona_events/tests.rs
  • desktop/src-tauri/src/commands/channels_tests.rs
  • desktop/src-tauri/src/app_state.rs
  • desktop/src-tauri/src/app_state_tests.rs
🔇 Additional comments (7)
Justfile (1)

212-215: LGTM!

desktop/src-tauri/src/app_state.rs (1)

1084-1084: LGTM!

desktop/src-tauri/src/app_state_tests.rs (1)

588-589: LGTM!

Also applies to: 603-614, 632-632, 646-663, 710-710, 904-924

desktop/src-tauri/src/commands/channels_tests.rs (1)

224-225: LGTM!

desktop/src-tauri/src/commands/profile.rs (1)

424-425: LGTM!

desktop/src-tauri/src/managed_agents/persona_events/tests.rs (1)

855-856: LGTM!

Also applies to: 916-917

desktop/src-tauri/src/relay_admission.rs (1)

294-295: LGTM!

Also applies to: 472-473


📝 Walkthrough

Priority Level: P4/NIT

No actionable P0–P3 findings identified.

The changes update test setup and managed-feature coverage only. They authorize managed signing sessions before signing tests and align app_state expectations with keyring-authoritative behavior. Reported default and managed suites pass.

Confidence: 92%

Walkthrough

The managed Tauri check now runs the full feature-enabled test suite. Identity recovery tests distinguish managed and unmanaged authority. Signing-related fixtures authorize managed signing before key and relay operations. Confidence: 99%.

Changes

Managed Tauri test coverage

Layer / File(s) Summary
Managed-feature suite command
Justfile
desktop-tauri-managed-check now runs the complete Tauri test suite with evaos-teams-managed.
Managed identity recovery expectations
desktop/src-tauri/src/app_state.rs, desktop/src-tauri/src/app_state_tests.rs
Identity recovery tests select keyring authority for managed builds and file authority otherwise. Failure assertions cover file retention and keyring persistence.
Managed-signing test setup
desktop/src-tauri/src/commands/*, desktop/src-tauri/src/managed_agents/persona_events/tests.rs, desktop/src-tauri/src/relay_admission.rs
Feature-gated setup authorizes managed signing before tests configure keys or issue relay requests.

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

Possibly related PRs

Suggested reviewers: wpfleger96, tlongwell-block, wesbillman

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states that the full test suite now passes under the managed feature. Confidence: 99%.
Description check ✅ Passed The description directly explains the test fixes, managed behavior, verification results, and test-only scope. Confidence: 99%.
Linked Issues check ✅ Passed The changes address all nine failures in issue #93 and enable full-suite managed-feature testing without changing production behavior. Confidence: 98%.
Out of Scope Changes check ✅ Passed The changes are limited to test setup, managed-feature expectations, test visibility, and the related Justfile command. Confidence: 98%.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/93-managed-feature-test-fixtures

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


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

@evaos-code-review-bot evaos-code-review-bot 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.

Walkthrough

PR: #104 - test(hive): make the full suite pass under evaos-teams-managed
Head: b6f286e0b2aa64bfe14f3c92c1bda18ec051bdb6 into main. Review event: COMMENT.
Provider: Codex CLI (existing OAuth session) (codex-cli-oauth, codex-cli, model gpt-5.6-luna).

Estimated review effort: 2/5 (~34 min)

Changed Files

File Status Churn Purpose Risk
Justfile modified +2/-6 Changed file Low
desktop/src-tauri/src/app_state.rs modified +1/-1 Changed file Low
desktop/src-tauri/src/app_state_tests.rs modified +30/-30 Changed file Low
desktop/src-tauri/src/commands/channels_tests.rs modified +2/-0 Changed file Low
desktop/src-tauri/src/commands/profile.rs modified +2/-0 Changed file Low
desktop/src-tauri/src/managed_agents/persona_events/tests.rs modified +4/-0 Test coverage Low
desktop/src-tauri/src/relay_admission.rs modified +4/-0 Changed file Low

Review Signal

No validated inline findings.
Dropped findings before posting: 0. High-severity findings: 0.

Risk Taxonomy

No finding categories.

Validation and Proof

No required validation recommendation selected; rely on existing GitHub checks and human review.
Proof status: not_applicable - No required behavior proof selected for this changed surface.
Profile validation hints: Prefer correctness, security, data-loss, release, and regression findings over style-only feedback.
Profile proof expectations: Look for focused validation, rollback notes, and evidence appropriate to the changed surface.

Related Context

Related issues/PRs: #93, #91, #92, #96.
Suggested labels: tests.
Suggested reviewers: none from current metadata.

Review Settings Preview

  • Profile: assertive
  • Enabled sections: Review summary (inline_review); Walkthrough (inline_review); Changed-files table (walkthrough); Effort estimate (walkthrough); Related issues/PRs (walkthrough); Review status comment (sticky_status)
  • Path instructions: none
  • Label suggestions: none
  • Reviewer suggestions: none
  • Suggestion behavior: suggestions only; labels and reviewers are not auto-applied.
  • Roadmap-only settings: auto-apply labels; auto-request reviewers; required status checks

Pre-merge checklist

  • Inline comments target current RIGHT-side diff lines.
  • No secret-like content survived into posted inline comments.
  • REQUEST_CHANGES is only used when eligible P0/P1 findings survive validation.
  • Required behavior proof is present or not applicable.
  • Labels and reviewers are suggestions only; the bot did not auto-apply them.

@evaos-code-review-bot

Copy link
Copy Markdown

evaOS review status: completed

PR: #104 - test(hive): make the full suite pass under evaos-teams-managed
Head: b6f286e0b2aa64bfe14f3c92c1bda18ec051bdb6
Updated: 2026-08-03T17:05:45.546Z

evaOS review completed for this PR head.

Automation note: agents should wait for this comment to reach completed, stale_head, closed_or_merged_before_review, skipped, or failed before treating evaOS review as settled for this head. provider_deferred means evaOS still intends to retry.

PR URL: #104

Review URL: #104 (review)

@100yenadmin

Copy link
Copy Markdown
Member Author

Program sign-off for merge (cross-model review satisfied). Author side: Codex implementation. Review side (Claude, Lane E — documented in the lane record, restated here so the review lives on the PR per hub convention): (1) the 6 signing-gate failures were fixed with an authorized fixture rather than weakening the assertion — the gate itself stays strict; (2) the 3 keyring failures pin both outcomes via KEYRING_AUTHORITATIVE instead of masking either; (3) reviewer restored the pre-fix re-onboarding-loop rationale comments Codex had deleted; (4) verified that managed-mode removing identity.key on a store-write failure is correct (managed attempts no write — nothing can be stranded). CI: full desktop suites green under evaos-teams-managed (1940/0; default 1910/0), coderabbit APPROVED. Merging now so this lands before the repo's owner-gated archive (#106) freezes it read-only — the suite-green state stays recoverable in history per the Mattermost decision's disposition.

@100yenadmin
100yenadmin merged commit a441d34 into main Aug 4, 2026
30 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 tests fail when evaos-teams-managed is compiled in — the shipped configuration has never been tested

1 participant