Skip to content

Dedupe clones 2 - #332

Merged
senamakel merged 11 commits into
mainfrom
dedupe-clones-2
Oct 7, 2026
Merged

senamakel merged 11 commits into
mainfrom
dedupe-clones-2

Conversation

@senamakel

Copy link
Copy Markdown
Member

Summary

API Or Behavior Changes

Tests

  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo build --all-targets
  • cargo build --all-targets --all-features
  • cargo test
  • cargo test --all-features

Documentation

senamakel and others added 11 commits October 7, 2026 14:26
The snapshot write path now delegates to a write_turn_file helper instead of
inlining the tempfile, fsync, and directory sync logic. This keeps the store
method focused on migration and logging while the write mechanics live in one
place.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The store now fsyncs the parent directory after renaming the temp file into place, so a crash or power loss between persist and the next flush cannot drop the snapshot and defeat cold-boot recovery. The sync stays best-effort on platforms that do not support opening a directory for syncing.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Both tracing and logging middleware repeated the same lock-and-increment
boilerplate at every hook, so a private bump helper now applies the update
under the mutex. Behaviour is unchanged.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Removed an extra closing brace that had been left after the LoggingMiddleware impl block, which would have broken compilation.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The cancellation and drain boundaries duplicated the same settle, checkpoint,
status, and event sequence, so both now delegate to a single helper that
selects the marker, terminal status, event, and drained flag from a stop kind.
Behaviour is unchanged.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The duplicated inline conversions of edges, branches, and waiting sets in
CompiledGraph and GraphBuilder are replaced by shared edge_pairs,
conditional_routes, and waiting_sets helpers. This removes the copy-pasted
mapping logic without changing the resulting topology.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Move the edge, branch, and barrier map flattening into standalone helper
functions so the topology extraction can reuse them without duplicating
the conversion logic.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Extend the import list in the export module to bring in HashMap, HashSet, Branch, and NodeId, preparing the module for upcoming topology work that needs these types.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the vendored tinyinference submodule to a newer revision.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Record sha2 in Cargo.lock now that a crate in the workspace depends on it.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@coderabbitai

coderabbitai Bot commented Oct 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 5 billable files and costs up to $1.25.

Or wait 38 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e16c736f-3587-4b80-a0ed-7d45d1deeda0
📥 Commits

Reviewing files that changed from the base of the PR and between 6168016 and 9a3f20e.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • crates/tinyagents-graph/src/compiled/boundary.rs
  • crates/tinyagents-graph/src/export/mod.rs
  • crates/tinyagents-harness/src/middleware/library/observe.rs
  • crates/tinyagents-session/src/turn_state/store.rs
  • vendor/tinyinference
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 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-10-07T12:03:01.317952Z 9a3f20e PR opened
ℹ️ 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 commented Oct 7, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

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

State: Ready for maintainer review
Priority: medium
Reviewed head: 9a3f20ec60d4
Updated: 1791374536 (Unix time)

Review snapshot

Change surface Files Review signal Count
Production 4 Active findings 1
Tests 0 Noted findings 0
Documentation 0 Resolved findings 0
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

  • medium · description · Fill in the empty pull request description — The description is the untouched template: no summary, no API-change note, no commands run, and no checkbox ticked. The repository rules require a short summary, the commands run, (\(pull request description\))

Before merge

None.

How this fits together

flowchart LR
  n0["Result"]:::impacted
  n1["new"]:::impacted
  n2["read_thread_turns"]:::impacted
  n3["list"]:::impacted
  n2 -->|uses| n0
  n2 -->|calls| n1
  n3 -->|uses| n0
  n3 -->|calls| n1
  n3 -->|calls| n2
  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: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 4 files; 0 findings. _Code retrieval was unavailable (model: ladder embeddings returned 400 Bad Request: {"error":{"message":"unknown ladder vectors; known ladders are flash (also chat-v1, flash-v1), instant (also no-think, instant-v1), reasoning (also deepseek), max-reasoning (also max-reasoning-v1), deepseek-flash (also reasoning-v1, agentic-v1), deep (also luna), scribe, uncensored, vectors-oai3 (also embeddings-oai3-v1), vision (also vision-v1, multimodal-v1), image (also images-v1, image-v1), vi), so this review saw the diff alone._ _Memory was unavailable (model: cortex: v1/recall: error sending request for url (http://cortexdb:3141/v1/recall\)\), so this review ran without it._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 4 files; 0 findings. _Code retrieval was unavailable (model: ladder embeddings returned 400 Bad Request: {"error":{"message":"unknown ladder vectors; known ladders are flash (also chat-v1, flash-v1), instant (also no-think, instant-v1), reasoning (also deepseek), max-reasoning (also max-reasoning-v1), deepseek-flash (also reasoning-v1, agentic-v1), deep (also luna), scribe, uncensored, vectors-oai3 (also embeddings-oai3-v1), vision (also vision-v1, multimodal-v1), image (also images-v1, image-v1), vi), so this review saw the diff alone._ _Memory was unavailable (model: cortex: v1/recall: error sending request for url (http://cortexdb:3141/v1/recall\)\), so this review ran without it._

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: This change is pure refactoring: the cancellation and drain boundaries are deduplicated behind `finish_stop_boundary` with a `StopKind` enum that reproduces the exact per-kind marker, status, event, and `drained` flag; the export helpers and `bump` counters are line-for-line extractions; and `write_turn_file` moves the store's fsync sequence unchanged. No observable behaviour changed, so no new tests are required — the existing suite pins the boundaries' contract. Safe to merge. _Code retrieval was unavailable (model: ladder embeddings returned 400 Bad Request: {"error":{"message":"unknown ladder vectors; known ladders are flash (also chat-v1, flash-v1), instant (also no-think, instant-v1), reasoning (also deepseek), max-reasoning (also max-reasoning-v1), deepseek-flash (also reasoning-v1, agentic-v1), deep (also luna), scribe, uncensored, vectors-oai3 (also embeddings-oai3-v1), vision (also vision-v1, multimodal-v1), image (also images-v1, image-v1), vi), so this review saw the diff alone._ _Memory was unavailable (model: cortex: v1/recall: error sending request for url (http://cortexdb:3141/v1/recall\)\), so this review ran without it._

commits

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

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The change is a safe, behavior-preserving deduplication refactor across three crates, but the pull request description is entirely empty — every section of the template is left as placeholder comments and no test checkboxes are ticked. Per the repository's own rules, a PR needs a short summary and the commands run; the description needs work before merge. _Code retrieval was unavailable (model: ladder embeddings returned 400 Bad Request: {"error":{"message":"unknown ladder vectors; known ladders are flash (also chat-v1, flash-v1), instant (also no-think, instant-v1), reasoning (also deepseek), max-reasoning (also max-reasoning-v1), deepseek-flash (also reasoning-v1, agentic-v1), deep (also luna), scribe, uncensored, vectors-oai3 (also embeddings-oai3-v1), vision (also vision-v1, multimodal-v1), image (also images-v1, image-v1), vi), so this review saw the diff alone._ _Memory was unavailable (model: cortex: v1/recall: error sending request for url (http://cortexdb:3141/v1/recall\)\), so this review ran without it._
  • Evidence: \(pull request description\) — Fill in the empty pull request description

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: gpt-5.6-luna, glm-5.3-flash
  • Spend: $0.010683
  • Tokens: 211327 input · 7633 output · 24767 cached · 0 embedding
Head State Pass summary
9a3f20ec60d4 ready for maintainer review 1 active finding(s), 0 resolved finding(s) (at 1791374536)

tinysweeper 0.1.0

@senamakel
senamakel merged commit d1d6713 into main Oct 7, 2026
11 checks passed
@senamakel
senamakel deleted the dedupe-clones-2 branch October 7, 2026 12:01

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

tinysweeper found nothing blocking. Approving.

             $0.0107 · 211,327 in / 7,633 out · 24,767 cached (12%) · gpt-5.6-luna, glm-5.3-flash
critique:    $0.0044 · 90,291 in  / 2,988 out · 14,222 cached (16%) · gpt-5.6-luna
security:    $0.0060 · 94,747 in  / 2,772 out · 7,153 cached (8%)   · gpt-5.6-luna
tests:       $0.0001 · 9,189 in   / 229 out   · 1,792 cached (20%)  · glm-5.3-flash
description: $0.0001 · 8,678 in   / 556 out   · 1,472 cached (17%)  · glm-5.3-flash

@tinysweeper tinysweeper Bot added the priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later. label Oct 7, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9a3f20ec60

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vendor/tinyinference
@@ -1 +1 @@
Subproject commit fdffc2a454af2b04e5052eb38dd3add8a6db1b85
Subproject commit a32eec8138d7be0978dd232ec9f93af33945dbe6

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the newly merged tinyinference revision

This pointer moves vendor/tinyinference from fdffc2a back to a32eec81, exactly reversing the dependency upgrade in the immediate parent: PR #326's 2a3ffe0d explicitly advances a32eec81 to fdffc2a as the latest revision and removes the obsolete sha2 dependency, while this patch restores both the old pointer and that lockfile entry. Consequently every workspace crate using the vendored inference packages silently loses the just-merged tinyinference #65 changes; keep fdffc2a unless this commit is intentionally reverting that PR. This dependency rollback is also unrelated to the clone-deduplication refactor.

AGENTS.md reference: AGENTS.md:L100-L102

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant