Skip to content

fix: allow crystallize to approve own session proposals#49

Merged
plind-junior merged 3 commits into
vouchdev:mainfrom
Tet-9:fix/crystallize-self-approval-47
May 25, 2026
Merged

fix: allow crystallize to approve own session proposals#49
plind-junior merged 3 commits into
vouchdev:mainfrom
Tet-9:fix/crystallize-self-approval-47

Conversation

@Tet-9

@Tet-9 Tet-9 commented May 21, 2026

Copy link
Copy Markdown
Contributor

Problem

sessions.crystallize() calls approve(..., approved_by=approver)
where approver is _agent() — the same value recorded as
proposed_by on every proposal filed during the session. Since
approve() enforces the forbidden_self_approval guard, every
proposal hits the guard and is dumped into failures[]. Single-agent
crystallize silently approves nothing and returns an empty approved
list with all proposals in failures.

Fix

Drop the _trusted bypass entirely. Now that approve() supports
review.approver_role: trusted-agent as an explicit opt-out (landed
in #46), single-agent setups configure that key in config.yaml and
crystallize() calls approve() with no special flag — keeping the
public API clean.

Tests

  • Added test_crystallize_single_agent_succeeds in test_sessions.py:
    starts a session as alice, files a proposal as alice, sets
    review.approver_role: trusted-agent, calls crystallize(approver="alice"),
    asserts approved is non-empty and failures is empty
  • Updated the crystallize JSONL test to exercise the real single-agent
    scenario instead of switching to human-reviewer

104 tests pass, 4 deselected.

Fixes #47

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Single-agent sessions can now be crystallized successfully when review.approver_role is configured as trusted-agent, removing the previous self-approval restriction for this valid workflow.
  • Tests

    • Added validation tests for approval behavior, including self-approval prevention and trusted-agent configuration scenarios.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds test coverage and documentation for the self-approval bypass fix in crystallize(). Tests verify the guard rejects same-agent approval by default and allows it when review.approver_role is set to trusted-agent in config.yaml. Single-agent crystallization is tested across both JSONL server and sessions modules. CHANGELOG documents the fix.

Changes

Self-approval Guard and Crystallization Fix Tests

Layer / File(s) Summary
Self-approval guard behavior test cases
tests/test_jsonl_server.py
New test cases assert that approval fails with forbidden_self_approval when proposer and approver are identical, and succeeds when review.approver_role=trusted-agent is written to config.yaml.
Single-agent crystallization integration tests
tests/test_jsonl_server.py, tests/test_sessions.py
JSONL and sessions tests verify that crystallize() succeeds when review.approver_role=trusted-agent is configured. Test environment is adjusted to use distinct agents in test_jsonl_full_flow via VOUCH_AGENT, and imports are moved to local scope in sessions tests.
Changelog entry for self-approval fix
CHANGELOG.md
Documents that crystallize() now bypasses the forbidden_self_approval guard by setting review.approver_role: trusted-agent.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • vouchdev/vouch#46: Main PR that implements the self-approval guard in proposals.approve() and the config-based bypass via review.approver_role=trusted-agent.

Poem

🐰 Ah, the tests hop in to save the day,
Guarding against approval's crooked way—
Self-approval blocked, unless we say,
"trusted-agent" opens the doorway,
Crystallize now dances without dismay! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly summarizes the main change: allowing crystallize() to approve its own session proposals, which directly addresses the core issue being fixed.
Linked Issues check ✅ Passed All objectives from issue #47 are met: crystallize() can now approve single-agent sessions via review.approver_role configuration, the self-approval guard is preserved for normal usage, and comprehensive tests verify the fix works correctly.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the crystallize() self-approval issue: CHANGELOG entry, test updates covering the specific scenario, and documentation of the configuration-based escape hatch.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@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

🧹 Nitpick comments (1)
tests/test_jsonl_server.py (1)

69-83: ⚡ Quick win

Add explicit same-agent crystallize coverage.

With VOUCH_AGENT switched to human-reviewer before kb.crystallize, this test no longer validates the original regression (approved_by == proposed_by during crystallize). Please add/adjust a case where the same agent proposes and crystallizes.

✅ Minimal test tweak
 def test_jsonl_session_lifecycle(store: KBStore, monkeypatch) -> None:
     src = store.put_source(b"e")
     monkeypatch.chdir(store.root)
+    monkeypatch.setenv("VOUCH_AGENT", "session-agent")
     sess = handle_request({"id": "1", "method": "kb.session_start",
                            "params": {"task": "demo"}})
@@
-    monkeypatch.setenv("VOUCH_AGENT", "human-reviewer")
     cryst = handle_request({"id": "4", "method": "kb.crystallize",
                             "params": {"session_id": sid}})
🤖 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 `@tests/test_jsonl_server.py` around lines 69 - 83, The test currently sets
VOUCH_AGENT to "human-reviewer" only before calling kb.crystallize, which misses
validating the same-agent crystallize regression; update
test_jsonl_session_lifecycle to include a path where the proposer and
crystallizer are the same agent by setting monkeypatch.setenv("VOUCH_AGENT",
"human-reviewer") before making a propose_claim (or add an additional
propose_claim with VOUCH_AGENT set) and then call kb.crystallize while still
under that same VOUCH_AGENT to ensure approved_by == proposed_by is exercised
for the handle_request calls to kb.propose_claim and kb.crystallize.
🤖 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 `@CHANGELOG.md`:
- Around line 9-10: Update the changelog line to clarify that the new
forbidden-self-approval behavior in proposals.approve() (raising
ProposalError("forbidden_self_approval") when approved_by ==
proposal.proposed_by) is conditional: note that approve() still allows
self-approval when called with _trusted=True (used for session crystallization),
so the entry should state the enforcement applies except for the _trusted
bypass. Reference proposals.approve(), ProposalError("forbidden_self_approval"),
approved_by, proposal.proposed_by, and the _trusted parameter in the revised
wording.

---

Nitpick comments:
In `@tests/test_jsonl_server.py`:
- Around line 69-83: The test currently sets VOUCH_AGENT to "human-reviewer"
only before calling kb.crystallize, which misses validating the same-agent
crystallize regression; update test_jsonl_session_lifecycle to include a path
where the proposer and crystallizer are the same agent by setting
monkeypatch.setenv("VOUCH_AGENT", "human-reviewer") before making a
propose_claim (or add an additional propose_claim with VOUCH_AGENT set) and then
call kb.crystallize while still under that same VOUCH_AGENT to ensure
approved_by == proposed_by is exercised for the handle_request calls to
kb.propose_claim and kb.crystallize.
🪄 Autofix (Beta)

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8843a7e0-f7a8-40f4-ac08-d44ca87132cf

📥 Commits

Reviewing files that changed from the base of the PR and between 98e4e18 and 388d398.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • src/vouch/proposals.py
  • src/vouch/sessions.py
  • tests/test_jsonl_server.py

Comment thread CHANGELOG.md
@plind-junior

Copy link
Copy Markdown
Member

Thanks for picking this up! The _trusted idea makes sense for crystallize. A few things before this can merge:

Needs changes

  1. Overlaps with fix: enforce forbidden_self_approval gate in proposals.approve() #46. This PR also adds the forbidden_self_approval check itself, plus the same changelog line that fix: enforce forbidden_self_approval gate in proposals.approve() #46 introduces. Whichever lands second will conflict. Could you rebase on fix: enforce forbidden_self_approval gate in proposals.approve() #46 and drop:

    • the if approved_by == proposal.proposed_by ... block in proposals.py
    • the duplicate changelog bullet about raising forbidden_self_approval

    So this PR is purely the crystallize escape hatch.

  2. No test for the actual bug. "All existing tests pass" isn't quite enough here — the whole point of bug: crystallize() always raises forbidden_self_approval — single-agent sessions cannot be crystallized #47 is single-agent crystallize. Could you add a small test in tests/test_sessions.py that:

    • starts a session as alice
    • files a proposal as alice
    • calls crystallize(approver="alice")
    • asserts approved is non-empty and failures is empty
  3. One test line works against the fix. In tests/test_jsonl_server.py:80 you set VOUCH_AGENT=human-reviewer right before kb.crystallize. But that's exactly the case this PR is meant to make unnecessary. Dropping that line would let the test exercise the real bug: crystallize() always raises forbidden_self_approval — single-agent sessions cannot be crystallized #47 scenario.

Nice to have

  1. _trusted on the public approve() works, but the underscore is just a convention — any caller can pass it. A small internal helper like _approve_trusted(...) could keep the public API clean. Up to you.

Happy to re-review once #46 lands and this is rebased. Thanks again 🙏

@Tet-9

Tet-9 commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for picking this up! The _trusted idea makes sense for crystallize. A few things before this can merge:

Needs changes

  1. Overlaps with fix: enforce forbidden_self_approval gate in proposals.approve() #46. This PR also adds the forbidden_self_approval check itself, plus the same changelog line that fix: enforce forbidden_self_approval gate in proposals.approve() #46 introduces. Whichever lands second will conflict. Could you rebase on fix: enforce forbidden_self_approval gate in proposals.approve() #46 and drop:

    • the if approved_by == proposal.proposed_by ... block in proposals.py
    • the duplicate changelog bullet about raising forbidden_self_approval

    So this PR is purely the crystallize escape hatch.

  2. No test for the actual bug. "All existing tests pass" isn't quite enough here — the whole point of bug: crystallize() always raises forbidden_self_approval — single-agent sessions cannot be crystallized #47 is single-agent crystallize. Could you add a small test in tests/test_sessions.py that:

    • starts a session as alice
    • files a proposal as alice
    • calls crystallize(approver="alice")
    • asserts approved is non-empty and failures is empty
  3. One test line works against the fix. In tests/test_jsonl_server.py:80 you set VOUCH_AGENT=human-reviewer right before kb.crystallize. But that's exactly the case this PR is meant to make unnecessary. Dropping that line would let the test exercise the real bug: crystallize() always raises forbidden_self_approval — single-agent sessions cannot be crystallized #47 scenario.

Nice to have

  1. _trusted on the public approve() works, but the underscore is just a convention — any caller can pass it. A small internal helper like _approve_trusted(...) could keep the public API clean. Up to you.

Happy to re-review once #46 lands and this is rebased. Thanks again 🙏

Thanks for the detailed review. Working through all the points:

  1. Agreed on the overlap with fix: enforce forbidden_self_approval gate in proposals.approve() #46 — will rebase once fix: enforce forbidden_self_approval gate in proposals.approve() #46 merges and
    drop the duplicate forbidden_self_approval block and changelog
    entry so this PR is purely the crystallize escape hatch.

  2. Will add the single-agent crystallize test in tests/test_sessions.py.

  3. Will drop the VOUCH_AGENT=human-reviewer line from
    test_jsonl_server.py:80 to exercise the real bug: crystallize() always raises forbidden_self_approval — single-agent sessions cannot be crystallized #47 scenario.

  4. On the _trusted approach — since fix: enforce forbidden_self_approval gate in proposals.approve() #46 is now adding the
    review.approver_role: trusted-agent opt-out, I'll drop _trusted
    entirely and have crystallize() rely on that config path instead,
    which keeps the public API clean without needing a private convention.

Waiting for #46 to land before rebasing. Will update this PR immediately
after.

@Tet-9
Tet-9 force-pushed the fix/crystallize-self-approval-47 branch from 74ca299 to cbd0442 Compare May 21, 2026 22:28
@Tet-9

Tet-9 commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for picking this up! The _trusted idea makes sense for crystallize. A few things before this can merge:

Needs changes

  1. Overlaps with fix: enforce forbidden_self_approval gate in proposals.approve() #46. This PR also adds the forbidden_self_approval check itself, plus the same changelog line that fix: enforce forbidden_self_approval gate in proposals.approve() #46 introduces. Whichever lands second will conflict. Could you rebase on fix: enforce forbidden_self_approval gate in proposals.approve() #46 and drop:

    • the if approved_by == proposal.proposed_by ... block in proposals.py
    • the duplicate changelog bullet about raising forbidden_self_approval

    So this PR is purely the crystallize escape hatch.

  2. No test for the actual bug. "All existing tests pass" isn't quite enough here — the whole point of bug: crystallize() always raises forbidden_self_approval — single-agent sessions cannot be crystallized #47 is single-agent crystallize. Could you add a small test in tests/test_sessions.py that:

    • starts a session as alice
    • files a proposal as alice
    • calls crystallize(approver="alice")
    • asserts approved is non-empty and failures is empty
  3. One test line works against the fix. In tests/test_jsonl_server.py:80 you set VOUCH_AGENT=human-reviewer right before kb.crystallize. But that's exactly the case this PR is meant to make unnecessary. Dropping that line would let the test exercise the real bug: crystallize() always raises forbidden_self_approval — single-agent sessions cannot be crystallized #47 scenario.

Nice to have

  1. _trusted on the public approve() works, but the underscore is just a convention — any caller can pass it. A small internal helper like _approve_trusted(...) could keep the public API clean. Up to you.

Happy to re-review once #46 lands and this is rebased. Thanks again 🙏

Rebased on #46 and reworked the approach as suggested:

  • Dropped _trusted entirely — crystallize() now relies on the
    review.approver_role: trusted-agent opt-out from fix: enforce forbidden_self_approval gate in proposals.approve() #46 instead
  • Removed the duplicate forbidden_self_approval block and changelog
    entry — this PR is now purely the crystallize fix
  • Added test_crystallize_single_agent_succeeds in test_sessions.py
  • Updated the crystallize JSONL test to drop the human-reviewer
    switch and exercise the real single-agent scenario

104 tests pass.

@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.

🧹 Nitpick comments (1)
tests/test_sessions.py (1)

50-52: 💤 Low value

Remove redundant imports.

KBStore (line 11) and sess_mod (line 9) are already imported at module level. Only the yaml import is needed here.

♻️ Proposed fix
 def test_crystallize_single_agent_succeeds(tmp_path, monkeypatch) -> None:
     """Single-agent crystallize must succeed when trusted-agent is configured."""
     import yaml
-    from vouch.storage import KBStore
-    from vouch import sessions as sess_mod

     store = KBStore.init(tmp_path)

Also remove the local re-import of propose_claim at line 66:

-    from vouch.proposals import propose_claim
     propose_claim(
🤖 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 `@tests/test_sessions.py` around lines 50 - 52, Remove the redundant local
imports in tests/test_sessions.py: keep only the yaml import in the shown block
and delete the repeated module-level imports of KBStore and sess_mod; also
remove the later local re-import of propose_claim so the test uses the
module-level propose_claim. Ensure references to KBStore, sess_mod, and
propose_claim remain available from the top-level imports already present in the
file.
🤖 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.

Nitpick comments:
In `@tests/test_sessions.py`:
- Around line 50-52: Remove the redundant local imports in
tests/test_sessions.py: keep only the yaml import in the shown block and delete
the repeated module-level imports of KBStore and sess_mod; also remove the later
local re-import of propose_claim so the test uses the module-level
propose_claim. Ensure references to KBStore, sess_mod, and propose_claim remain
available from the top-level imports already present in the file.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 614b96e6-6109-4343-803c-b479d8a48652

📥 Commits

Reviewing files that changed from the base of the PR and between 74ca299 and cbd0442.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • src/vouch/proposals.py
  • tests/test_jsonl_server.py
  • tests/test_sessions.py

@plind-junior

Copy link
Copy Markdown
Member

Fix conflict

@Tet-9
Tet-9 force-pushed the fix/crystallize-self-approval-47 branch from cbd0442 to 1a8a623 Compare May 22, 2026 08:26

@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

🧹 Nitpick comments (1)
tests/test_jsonl_server.py (1)

159-162: ⚡ Quick win

Assert crystallize failures are empty in the JSONL lifecycle test.

This test currently only checks approved length; add a failures == [] assertion to lock in the no-failure contract for the single-agent trusted flow.

Suggested patch
     cryst = handle_request({"id": "4", "method": "kb.crystallize",
                             "params": {"session_id": sid}})
+    assert cryst["ok"]
     assert len(cryst["result"]["approved"]) == 1
+    assert cryst["result"]["failures"] == []
🤖 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 `@tests/test_jsonl_server.py` around lines 159 - 162, The test currently only
asserts that the crystallize response has one approved item; update the JSONL
lifecycle test by adding an assertion that failures are empty: after the call to
handle_request (which returns cryst), add assert cryst["result"]["failures"] ==
[] to ensure the single-agent trusted flow reports no failures.
🤖 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 `@CHANGELOG.md`:
- Line 11: Update the CHANGELOG entry to make clear that the bypass is enabled
by an explicit configuration opt-in (setting the system/config flag to
"trusted-agent") rather than being automatically set by crystallize(); state
that crystallize() still follows the normal approve() rules and only operates
with review.approver_role: trusted-agent when that config is explicitly
provided. Replace the current line referencing crystallize() setting
review.approver_role with wording that the config opt-in enables trusted-agent
behavior and crystallize() then proceeds under standard approve() logic.

---

Nitpick comments:
In `@tests/test_jsonl_server.py`:
- Around line 159-162: The test currently only asserts that the crystallize
response has one approved item; update the JSONL lifecycle test by adding an
assertion that failures are empty: after the call to handle_request (which
returns cryst), add assert cryst["result"]["failures"] == [] to ensure the
single-agent trusted flow reports no failures.
🪄 Autofix (Beta)

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5ffe1228-0195-4ae9-a84f-57d85c0573e1

📥 Commits

Reviewing files that changed from the base of the PR and between cbd0442 and 1a8a623.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • src/vouch/proposals.py
  • tests/test_jsonl_server.py
  • tests/test_sessions.py

Comment thread CHANGELOG.md

### Fixed
- Raise `ProposalError("forbidden_self_approval")` in `proposals.approve()` when `approved_by == proposal.proposed_by`, enforcing the review-gate guarantee documented in the README and CONTRIBUTING.
- `crystallize()` now sets `review.approver_role: trusted-agent` context so single-agent sessions can be crystallized without hitting the `forbidden_self_approval` guard (#47).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Clarify that trusted-agent is an explicit config opt-in, not an automatic crystallize() side effect.

Current wording implies crystallize() sets review.approver_role itself. Based on this PR’s behavior, the bypass is enabled when config is set to trusted-agent, and crystallize() then proceeds under normal approve() rules.

✏️ Suggested wording
-- `crystallize()` now sets `review.approver_role: trusted-agent` context so single-agent sessions can be crystallized without hitting the `forbidden_self_approval` guard (`#47`).
+- Single-agent `crystallize()` can proceed without `forbidden_self_approval` when `config.yaml` sets `review.approver_role: trusted-agent` (`#47`).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- `crystallize()` now sets `review.approver_role: trusted-agent` context so single-agent sessions can be crystallized without hitting the `forbidden_self_approval` guard (#47).
- Single-agent `crystallize()` can proceed without `forbidden_self_approval` when `config.yaml` sets `review.approver_role: trusted-agent` (`#47`).
🤖 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 `@CHANGELOG.md` at line 11, Update the CHANGELOG entry to make clear that the
bypass is enabled by an explicit configuration opt-in (setting the system/config
flag to "trusted-agent") rather than being automatically set by crystallize();
state that crystallize() still follows the normal approve() rules and only
operates with review.approver_role: trusted-agent when that config is explicitly
provided. Replace the current line referencing crystallize() setting
review.approver_role with wording that the config opt-in enables trusted-agent
behavior and crystallize() then proceeds under standard approve() logic.

@Tet-9

Tet-9 commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

No conflicts, 6 commits shown are correct (includes the #45 base
commits since this PR depends on that fix landing first). CI is
failing because the trusted-agent opt-out from #46 isn't in
upstream/main yet — tests will pass once #46 merges. Nothing to
fix here.

@plind-junior

Copy link
Copy Markdown
Member

Fix CI

Tet-9 added 2 commits May 25, 2026 20:52
… instead

Now that approve() supports the review.approver_role: trusted-agent
opt-out, crystallize() no longer needs a private _trusted bypass.
Single-agent setups configure the opt-out explicitly; crystallize()
calls approve() with no special flag.

Also:
- Add test_crystallize_single_agent_succeeds in test_sessions.py
- Update crystallize JSONL test to exercise the real single-agent
  scenario instead of switching to human-reviewer

Fixes vouchdev#47
@plind-junior

Copy link
Copy Markdown
Member

@Tet-9 Any update here?

@Tet-9

Tet-9 commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

@Tet-9 Any update here?

Yeah, sure,..... Working on it

@Tet-9
Tet-9 force-pushed the fix/crystallize-self-approval-47 branch from 1a8a623 to 199c7cc Compare May 25, 2026 20:38

@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 `@tests/test_sessions.py`:
- Around line 50-52: The import block in tests/test_sessions.py is flagged by
Ruff I001 for incorrect grouping/sorting; reorder the imports into three
standard groups (stdlib, third-party, local) and sort them alphabetically within
each group — e.g., place "import yaml" in the third-party section and "from
vouch.storage import KBStore" and "from vouch import sessions as sess_mod" in
the local/package section, and apply the same ordering/sorting fix to the other
import block around lines 78-81 so Ruff no longer reports I001.
🪄 Autofix (Beta)

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 612d066a-f3a9-4f4d-bdb1-dab68473ec37

📥 Commits

Reviewing files that changed from the base of the PR and between 1a8a623 and 199c7cc.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • tests/test_jsonl_server.py
  • tests/test_sessions.py
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md

Comment thread tests/test_sessions.py
@Tet-9

Tet-9 commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

@plind-junior , fixed man🫡

@Tet-9

Tet-9 commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

I guess it's good to go now 😄

@plind-junior

Copy link
Copy Markdown
Member

LGTM!

@plind-junior
plind-junior merged commit 8d70ffa into vouchdev:main May 25, 2026
5 checks passed
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.

bug: crystallize() always raises forbidden_self_approval — single-agent sessions cannot be crystallized

2 participants