Skip to content

feat: graph content hash, trail-off heuristics, nested compat test (from OpenHuman) - #97

Merged
senamakel merged 22 commits into
move-openhuman-flow-logicfrom
oh-extract-flows-voice
Sep 30, 2026
Merged

senamakel merged 22 commits into
move-openhuman-flow-logicfrom
oh-extract-flows-voice

Conversation

@senamakel

Copy link
Copy Markdown
Member

Stacked on #96 (move-openhuman-flow-logic): OpenHuman's tinyflows pin is that branch's tip, so this is based on it rather than main. Retarget to main once #96 lands.

What moves out of OpenHuman

  • tinyflows_catalog::graph_hash::compute_graph_hash(graph, require_approval) (+ private canonicalize_json): the stale-approval pin recorded when a run parks and re-checked on resume. The digest is a persisted format, so it is byte-identical to the host's old implementation: a fixed-vector test pins two SHA-256 values, and a second test compares against a verbatim copy of the pre-extraction code across several graphs (unicode, floats, nesting, empty). Key-order stability, require_approval coverage and array-order sensitivity tests moved with it. New deps on the catalog: sha2 (workspace), hex.
  • tinyflows_copilot::trail_off: text_looks_like_question (public) with its code-span / URL-query / CRLF-paragraph heuristics, and the 9 tests that pin them. The host's build_trail_off_fallback (needs its own ConversationMessage/tool names) stays in OpenHuman.
  • compat_tests: adds the nested-inline-sub_workflow recursion case that only the host suite had (the other host cases were already ported here).

migrate::deserialize_graph from #96 is what replaces the host's migrate_and_deserialize_graph; nothing new needed for it.

Verification

cargo fmt --all --check; cargo clippy --all-targets -D warnings on tinyflows, tinyflows-catalog, tinyflows-copilot; tests: catalog 74 (5 new), copilot 31 (9 new), tinyflows compat 15 (1 new).

senamakel and others added 5 commits September 30, 2026 03:26
Introduce a new `graph_hash` module that computes a deterministic hash over a graph's structure and node content. This enables the catalog to detect and skip duplicate graph registrations, preventing redundant storage and ensuring idempotent publish operations.

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

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…,crates/tinyflows-copilot/src/l

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a new `trail_off` module to the copilot crate that provides text heuristics for detecting whether a builder turn ends with a question, along with the corresponding changelog entries documenting this addition and other recent changes.

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

tinysweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

⚠️ Review failed for a04a4c5ef26f. the review of #97 did not finish within 900s

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 756c0893-f55b-4fd2-8641-461bd9f0df6f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 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-30T09:06:12.626008Z 9d65a28 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.

@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: 714c960899

ℹ️ 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 crates/tinyflows/src/compat_tests.rs
Comment thread crates/tinyflows-copilot/src/trail_off.rs Outdated
Comment thread crates/tinyflows-copilot/src/trail_off.rs Outdated

@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, but could not review everything, so this is not an approval: CHANGELOG.md, crates/tinyflows-catalog/Cargo.toml, crates/tinyflows-catalog/src/graph_hash.rs, crates/tinyflows-catalog/src/graph_hash_tests.rs, crates/tinyflows-catalog/src/lib.rs, crates/tinyflows-copilot/src/lib.rs, crates/tinyflows-copilot/src/trail_off.rs, crates/tinyflows-copilot/src/trail_off_tests.rs and 1 more.

             $0.0079 · 96,112 in / 12,217 out · 12,800 cached (13%) · ladder/vectors, deepseek/deepseek-v4-flash · 1,078 embedded
tests:       $0.0027 · 25,013 in / 2,526 out  · 0 cached (0%)       · deepseek/deepseek-v4-flash
description: $0.0013 · 16,143 in / 92 out     · 0 cached (0%)       · deepseek/deepseek-v4-flash
e2e:         $0.0029 · 29,138 in / 1,363 out  · 0 cached (0%)       · deepseek/deepseek-v4-flash

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Sep 30, 2026
senamakel and others added 3 commits September 30, 2026 08:35
Fixed a bug where the schedule gap detection logic incorrectly identified overlapping time windows as gaps. The issue occurred when adjacent windows shared a boundary time, causing the gap checker to treat them as non-contiguous. This change ensures that windows with matching start and end times are properly recognized as overlapping rather than gapped.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a new `tinyflows-schedule` crate that provides cron expression parsing and timezone-aware scheduling, replacing the previous gate-based test infrastructure. The old gate tests have been removed as the scheduling logic has been reimplemented using the `cron` and `chrono-tz` crates, which offer more robust and standard-compliant time handling. The schedule tests have been updated to accommodate the new implementation's error message formatting.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
senamakel and others added 5 commits September 30, 2026 11:26
The `text_looks_like_question` function now passes the code-span state from the text preceding the last paragraph into the question-mark scan, so that a backtick opened before the final paragraph is correctly recognised as still open. The old fallback that checked the last non-blank line for a trailing `?` has been removed because the paragraph-based scan already covers that case. The compatibility tests for router fan-in detection have been moved to a separate file.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add validation in `validate_schedule` to reject `Every` intervals whose conversion to milliseconds would overflow or fail to advance the clock, matching the same arithmetic used when computing the next run. This prevents persisted schedules from becoming stuck. Also add `skip_serializing_if` to `CronJobPatch::agent_id` so absent fields are omitted from JSON output while explicitly cleared fields remain as `null`.

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

The previous calculation of `paragraph_start` using `trimmed.len() - paragraph.len()` failed when the trimmed text contained leading whitespace or blank lines before a code block, causing incorrect identification of question marks. The fix uses `rfind` to reliably locate the paragraph within the trimmed text, and adds test cases for empty code fences and code blocks without a closing fence.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The function `question_mark_outside_code_with_state` redeclared `open_run_len` as a local variable, shadowing the parameter of the same name. Removing the shadowing lets the function use the parameter value directly, fixing a logic error where the initial state was always overwritten to `None`.

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

@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: 1ff7e67a2a

ℹ️ 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 crates/tinyflows-copilot/src/trail_off.rs Outdated
senamakel and others added 2 commits September 30, 2026 11:33
The `ACTIVE_WINDOW_CANDIDATE_LIMIT` and `RUN_GAP_SCAN_OCCURRENCES` constants were too low to reliably detect one-minute gaps caused by annual daylight saving time transitions. A full leap year at the minimum five-minute cadence produces up to 105,408 runs, so the scan limit is raised to 105,500 and the active window candidate limit is increased to 600,000 to ensure the gap detection works regardless of where the scan starts. A new test verifies that the scan finds the spring-forward gap across a full year.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The `last_paragraph` function previously searched for the paragraph string within the original text using `rfind`, which could fail when the paragraph contained CRLF line endings that were normalized to LF during extraction. The function now returns a slice of the original text by tracking byte offsets, eliminating the need for a search and preventing the panic.

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

@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: 9b6fd126cc

ℹ️ 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 crates/tinyflows-copilot/src/trail_off.rs
feat(schedule): tinyflows-schedule crate (schedule model + next-run logic)
@senamakel
senamakel deleted the branch move-openhuman-flow-logic September 30, 2026 08:49
@senamakel senamakel closed this Sep 30, 2026
The question-mark detection logic now skips question marks inside tilde-fenced code blocks, matching the existing behaviour for backtick-fenced blocks. This prevents false positives when a question mark appears inside a code block delimited by three or more tildes.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
senamakel and others added 5 commits September 30, 2026 11:52
Reformatted several if and while blocks in `trail_off.rs` to use braces consistently, placing the opening brace on the same line as the control flow keyword and the body on a new line. This improves code readability and aligns with the project's style conventions.

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

Moved the router compatibility tests from `compat_tests.rs` into a new `compat_router_tests.rs` module, and the prompt-related gate tests from `gates_tests.rs` into a new `gates_prompt_tests.rs` module, to keep each test file focused on a single concern and reduce the size of the main test files.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
When a collection like `nodes` is not an array and a member of a different collection is also malformed, the error message now reports the collection-level problem first. This makes the diagnostic more useful because a broken collection shape is typically the root cause, and the fix avoids depending on JSON map key ordering.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel senamakel reopened this Sep 30, 2026
@senamakel
senamakel merged commit 3786f74 into move-openhuman-flow-logic Sep 30, 2026
3 checks passed
@senamakel
senamakel deleted the oh-extract-flows-voice branch September 30, 2026 09:05

@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: 9d65a2885a

ℹ️ 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 on lines +50 to +54
question_mark_outside_code_with_state(
paragraph,
code_span_state(prefix),
tilde_fence_state(prefix),
)

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 Badge Unify prefix state across both fence syntaxes

When a completed tilde-fenced block in the prefix contains an unmatched backtick (for example, ~~~text\nUse \literal\n~~~\n\nWhich channel?), code_span_state(prefix)reports an open backtick span even though that backtick is literal fenced content, whiletilde_fence_state(prefix)` independently reports the tilde fence as closed. The final question is consequently suppressed and the host adds an unnecessary generic fallback despite an explicit question; scan the prefix with one combined state machine so delimiters inside either fence cannot affect the other state.

Useful? React with 👍 / 👎.

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

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant