Skip to content

Split run-ledger operations and trim provider dependencies - #173

Merged
senamakel merged 5 commits into
mainfrom
analyzer_cleanup
Sep 20, 2026
Merged

senamakel merged 5 commits into
mainfrom
analyzer_cleanup

Conversation

@senamakel

Copy link
Copy Markdown
Member

Summary

  • split run-ledger operations into focused agent-team and SQLite row-decoding modules without changing the public API
  • add module-level documentation for the operation layout
  • update the TinyInference submodule to remove unused provider dependencies

TinyInference dependency cleanup: tinyhumansai/tinyinference#23

Validation

  • cargo fmt --check
  • cargo check --workspace --all-targets
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace
  • cargo test -p tinyinference-providers
  • cargo machete (TinyInference)

senamakel and others added 3 commits September 20, 2026 01:40
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@tinysweeper

tinysweeper Bot commented Sep 19, 2026

Copy link
Copy Markdown

Tiny Sweeper review

Tiny Sweeper reviewed this change across 6 lane(s) and found 9 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below.

State: Changes requested
Priority: high
Reviewed head: d2ae2b7f3a25
Updated: 1789859087 (Unix time)

Review snapshot

Change surface Files Review signal Count
Production 4 Active findings 5
Tests 1 Noted findings 0
Documentation 1 Resolved findings 51
Configuration 0 Pending checks/questions 0

Completeness: Complete
Test assessment: No supported feature-to-test mapping was available; this does not mean tests are absent or passed.

What changed

The review could not produce a supported behavioral summary; inspect the cited changed surface and lane details below.

Features

None identified with supported citations.

Tests

No supported feature-to-test mapping was produced. Test execution is not inferred.

Findings

  • high · critique · Fence stale workers before marking members idle — The idle transition is unconditional for a matching member and team. A late completion from an older worker can therefore clear `current_task_id` and mark a stopped member idle, or (crates/tinyagents\-session/src/run\_ledger/ops/team\.rs:796)
  • high · security · Restrict task claims to active team members — The claim path does not check the claimant's member status. A member that has been stopped can still claim a todo task by supplying its ID, allowing stale workers or stopped agents (crates/tinyagents\-session/src/run\_ledger/ops/team\.rs:459)
  • high · description · Reject stale workers from reviving stopped members — The claim function does not verify that the member is active (not stopped). A stopped member can successfully claim a task, which revives it. Validate that the member's status is ' (\(pull request description\))
  • high · description · Authorize claims against active team members — The claim function accepts any member_id without checking whether the member is in an active state. A stopped or idle member should not be allowed to claim tasks. Add a member stat (\(pull request description\))
  • high · description · Authorize the member before claiming a task — The claim function does not verify that the member is authorized to claim tasks (e.g., that the member is in an active or idle state). A stopped member should not be able to claim. (\(pull request description\))

Resolved this pass

  • Reject stale workers from reviving stopped members
  • Authorize claims against active team members
  • Medium — Return the count of teams in the response
  • Validate the task team before updating an existing row
  • Remove the unused AgentRunKind import
  • Critical — Add the declared rows and team modules
  • Authorize the member before claiming a task
  • Import required types explicitly in submodule rows.rs
  • Import required types and functions explicitly in submodule team.rs
  • Remove the unused AgentRunKind import
  • Import required types explicitly in submodule rows.rs
  • Return the count of teams in the response
  • Remove the unused AgentRunKind import
  • Add the declared rows and team modules
  • Import required types explicitly in submodule rows.rs
  • Import required types and functions explicitly in submodule team.rs
  • Reject stale workers from reviving stopped members
  • Authorize claims against active team members
  • Return the count of teams in the response
  • Remove the unused AgentRunKind import
  • Add the declared rows and team modules
  • Authorize the member before claiming a task
  • Import required types explicitly in submodule rows.rs
  • Import required types and functions explicitly in submodule team.rs
  • Return the count of teams in the response
  • Remove the unused AgentRunKind import
  • Import required types explicitly in submodule rows.rs
  • Reject stale workers from reviving stopped members
  • Return the count of teams in the response
  • Remove the unused AgentRunKind import
  • Add the declared rows and team modules
  • Import required types explicitly in submodule rows.rs
  • Import required types and functions explicitly in submodule team.rs
  • Reject stale workers from reviving stopped members
  • Remove the unused AgentRunKind import
  • Add the declared rows and team modules
  • Import required types explicitly in submodule rows.rs
  • Import required types and functions explicitly in submodule team.rs
  • Return the count of teams in the response
  • Validate the task team before updating an existing row
  • Add the declared rows and team modules
  • Import required types explicitly in submodule rows.rs
  • Return the count of teams in the response
  • Add the declared rows and team modules
  • Import required types explicitly in submodule rows.rs
  • Import required types and functions explicitly in submodule team.rs
  • Return the count of teams in the response
  • Remove the unused AgentRunKind import
  • Import required types explicitly in submodule rows.rs
  • Import required types and functions explicitly in submodule team.rs
  • Add the declared rows and team modules

Before merge

  • Address Fence stale workers before marking members idle (crates/tinyagents\-session/src/run\_ledger/ops/team\.rs).
  • Address Restrict task claims to active team members (crates/tinyagents\-session/src/run\_ledger/ops/team\.rs).
  • Address Reject stale workers from reviving stopped members (\(pull request description\)).
  • Address Authorize claims against active team members (\(pull request description\)).
  • Address Authorize the member before claiming a task (\(pull request description\)).

How this fits together

flowchart LR
  n0["list_workflow_runs<br/>changed"]:::changed
  n1["team_members_and_tasks_list_back<br/>changed"]:::changed
  n2["test_workspace"]:::impacted
  n3["init_run_ledger_schema"]:::impacted
  n4["seed_team"]:::impacted
  n5["claim_agent_team_task"]:::impacted
  n6["...ember_running_then_idle_keeps_run_pointer"]:::impacted
  n7["..._the_claim_when_a_task_leaves_in_progress"]:::impacted
  n0 -->|calls| n3
  n1 -->|calls| n2
  n1 -->|tests| n2
  n1 -->|calls| n4
  n1 -->|tests| n4
  n5 -->|calls| n3
  n6 -->|calls| n2
  n6 -->|tests| n2
  n6 -->|calls| n4
  n6 -->|tests| n4
  n6 -->|calls| n5
  n6 -->|tests| n5
  n7 -->|calls| n2
  n7 -->|tests| n2
  n7 -->|calls| n4
  n7 -->|tests| n4
  n7 -->|calls| n5
  n7 -->|tests| n5
  classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
  classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
  classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
  classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Loading
Agent review details

critique

  • Conclusion: Failure
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 5 files; 3 findings. (2 already reported on an earlier push) _The code index is behind this pull request (indexed at `dc6c0e253a19`), so retrieved context may be out of date._ _3 memory call(s) failed (model: cortex: v1/answer answered 502 Bad Gateway), so this review saw part of what the engine holds._
  • Evidence: crates/tinyagents\-session/src/run\_ledger/ops/team\.rs — Fence stale workers before marking members idle

security

  • Conclusion: Failure
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 5 files; 2 findings. (1 already reported on an earlier push) (1 earlier finding(s) still open) _The code index is behind this pull request (indexed at `dc6c0e253a19`), so retrieved context may be out of date._ _3 memory call(s) failed (model: cortex: v1/answer answered 502 Bad Gateway), so this review saw part of what the engine holds._
  • Evidence: crates/tinyagents\-session/src/run\_ledger/ops/team\.rs — Restrict task claims to active team members

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: This PR structurally refactors run_ledger/ops.rs into submodules rows.rs and team.rs, moves team coordination logic verbatim, corrects the doc comment on AgentTeamListResponse.count to match the actual pre-pagination behavior, and adds a regression test. The change is safe to merge: no behavior is altered, the refactor is clean, and the doc fix resolves a previously rejected finding. (5 earlier finding(s) still open) _The code index is behind this pull request (indexed at `dc6c0e253a19`), so retrieved context may be out of date._ _3 memory call(s) failed (model: cortex: v1/answer answered 502 Bad Gateway), so this review saw part of what the engine holds._

commits

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: Nothing sensitive found in what this pull request commits.

description

  • Conclusion: Failure
  • Scope reviewed: all assigned evidence
  • Lane summary: The pull request refactors the run-ledger operations into submodules without changing public API, adds documentation, fixes a documentation inconsistency in the pagination count, and adds a regression test. The structural changes are sound. However, several pre-existing authorization concerns about member and task claims remain unaddressed in the moved code. (1 earlier finding(s) still open) (2 observation(s) grouped into shared inline comments) _The code index is behind this pull request (indexed at `dc6c0e253a19`), so retrieved context may be out of date._ _3 memory call(s) failed (model: cortex: v1/answer answered 502 Bad Gateway), so this review saw part of what the engine holds._
  • Evidence: \(pull request description\) — Reject stale workers from reviving stopped members
  • Evidence: \(pull request description\) — Authorize claims against active team members
  • Evidence: \(pull request description\) — Authorize the member before claiming a task

e2e

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: No end-to-end harness in this repository: no e2e test files and no e2e workflow.
Evidence and run details
  • Models: ladder/vectors, gpt-5.6-luna, deepseek-v4-flash
  • Spend: $0.032008
  • Tokens: 671646 input · 40333 output · 43527 cached · 1198 embedding
Head State Pass summary
2a6b17403f68 changes requested 9 active finding(s), 0 resolved finding(s) (at 1789858039)
dc6c0e253a19 changes requested 3 active finding(s), 12 resolved finding(s) (at 1789858590)
d2ae2b7f3a25 changes requested 5 active finding(s), 51 resolved finding(s) (at 1789859087)

tinysweeper 0.1.0

@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

Warning

Review paused — included plan limit reached

Keep your review moving with free on-demand reviews.

  • Run this review for free

On-demand reviews are free for one more day.

Promotion and pricing details

On-demand reviews are free for one more day. After that, they cost $0.25 per reviewed file.

Review limit details

Or wait 43 minutes for your next included review.

Check out review usage here.

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 6c00d950-0acf-46ea-80ff-46b968cdf191

📥 Commits

Reviewing files that changed from the base of the PR and between 9483a56 and d2ae2b7.

📒 Files selected for processing (7)
  • crates/tinyagents-session/src/run_ledger/ops.rs
  • crates/tinyagents-session/src/run_ledger/ops/README.md
  • crates/tinyagents-session/src/run_ledger/ops/rows.rs
  • crates/tinyagents-session/src/run_ledger/ops/team.rs
  • crates/tinyagents-session/src/run_ledger/test.rs
  • crates/tinyagents-session/src/run_ledger/types.rs
  • vendor/tinyinference

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 19, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-19T23:01:41.939483Z d2ae2b7 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Requesting changes: 3 lane(s) blocking, worst finding is critical.

Fix or reply to the findings below and push. The next review clears this automatically once they are gone — you should not need to dismiss anything by hand.

             $0.0291 · 614,804 in / 27,386 out · 30,258 cached (5%) · ladder/vectors, gpt-5.6-luna, deepseek-v4-flash · 1,182 embedded
critique:    $0.0141 · 276,203 in / 13,398 out · 22,966 cached (8%) · gpt-5.6-luna, deepseek-v4-flash
security:    $0.0125 · 224,260 in / 5,640 out  · 7,292 cached (3%)  · gpt-5.6-luna
tests:       $0.0009 · 44,510 in  / 1,244 out  · 0 cached (0%)      · deepseek-v4-flash
description: $0.0008 · 35,661 in  / 4,328 out  · 0 cached (0%)      · deepseek-v4-flash

Comment thread crates/tinyagents-session/src/run_ledger/ops/team.rs
Comment thread crates/tinyagents-session/src/run_ledger/ops/team.rs
Comment thread crates/tinyagents-session/src/run_ledger/ops/team.rs
Comment thread crates/tinyagents-session/src/run_ledger/ops/team.rs
Comment thread crates/tinyagents-session/src/run_ledger/ops.rs Outdated
Comment thread crates/tinyagents-session/src/run_ledger/ops.rs
Comment thread crates/tinyagents-session/src/run_ledger/ops/team.rs
@tinysweeper tinysweeper Bot added the priority: p0 Drop what you are doing. Data loss, a live break, or an exploitable hole. label Sep 19, 2026
Co-authored-by: Medulla <medulla@tinyhumans.ai>

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

Requesting changes: 1 lane(s) blocking, worst finding is high.

Fix or reply to the findings below and push. The next review clears this automatically once they are gone — you should not need to dismiss anything by hand.

             $0.0100 · 249,257 in / 17,353 out · 8,664 cached (3%) · ladder/vectors, gpt-5.6-luna, deepseek-v4-flash · 1,182 embedded
critique:    $0.0036 · 67,168 in  / 1,476 out  · 4,064 cached (6%) · gpt-5.6-luna
security:    $0.0038 · 66,690 in  / 1,951 out  · 3,576 cached (5%) · gpt-5.6-luna
tests:       $0.0011 · 45,030 in  / 6,940 out  · 0 cached (0%)     · deepseek-v4-flash
description: $0.0008 · 36,167 in  / 4,597 out  · 1,024 cached (3%) · deepseek-v4-flash

Comment thread crates/tinyagents-session/src/run_ledger/ops/rows.rs Outdated
Comment thread crates/tinyagents-session/src/run_ledger/ops/team.rs Outdated
Comment thread crates/tinyagents-session/src/run_ledger/ops/team.rs
@tinysweeper tinysweeper Bot added priority: p1 Next. Wrong behaviour a user will hit, or a security weakness behind a condition. and removed priority: p0 Drop what you are doing. Data loss, a live break, or an exploitable hole. labels Sep 19, 2026
Co-authored-by: Medulla <medulla@tinyhumans.ai>

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

Requesting changes: 3 lane(s) blocking, worst finding is high.

Fix or reply to the findings below and push. The next review clears this automatically once they are gone — you should not need to dismiss anything by hand.

             $0.0320 · 671,646 in / 40,333 out · 43,527 cached (6%) · ladder/vectors, gpt-5.6-luna, deepseek-v4-flash · 1,198 embedded
critique:    $0.0164 · 333,009 in / 23,604 out · 29,574 cached (9%) · gpt-5.6-luna, deepseek-v4-flash
security:    $0.0132 · 220,842 in / 9,287 out  · 12,929 cached (6%) · gpt-5.6-luna
tests:       $0.0009 · 45,733 in  / 1,216 out  · 0 cached (0%)      · deepseek-v4-flash
description: $0.0008 · 36,934 in  / 3,890 out  · 1,024 cached (3%)  · deepseek-v4-flash

Comment thread crates/tinyagents-session/src/run_ledger/ops/team.rs
Comment thread crates/tinyagents-session/src/run_ledger/ops/team.rs
@senamakel
senamakel merged commit 2cedd17 into main Sep 20, 2026
7 of 10 checks passed
@senamakel
senamakel deleted the analyzer_cleanup branch September 22, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p1 Next. Wrong behaviour a user will hit, or a security weakness behind a condition.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant