Skip to content

Bound DataFlow dataset setup and update the workflow to the current DataFlow API - #49969

Merged
pelikhan merged 5 commits into
mainfrom
copilot/dataflowfix-dataflow-install-timeout
Aug 3, 2026
Merged

Bound DataFlow dataset setup and update the workflow to the current DataFlow API#49969
pelikhan merged 5 commits into
mainfrom
copilot/dataflowfix-dataflow-install-timeout

Conversation

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

The DataFlow dataset workflow could spend the full Actions job budget in dependency installation, and even successful installs still fell back because the pipeline targeted obsolete DataFlow modules and FileStorage behavior. This change bounds setup, validates the exact runtime API up front, and makes the workflow report whether it ran in dataflow, mixed, or fallback mode.

  • Bound and pin the pre-agent DataFlow setup

    • Replace the unbounded pip install open-dataflow path with pinned uv bootstrap + pinned open-dataflow install under explicit timeouts.
    • Persist runtime status and install logs for downstream reporting.
    • Treat install/API validation failure as a warning so the dataset pipeline can still complete via fallback.
  • Validate the current DataFlow API instead of import-only success

    • Smoke-test the exact APIs used by the workflow:
      • dataflow.utils.storage.FileStorage
      • dataflow.operators.general_text.CharNumberFilter
      • MinHashDeduplicateFilter
      • HashDeduplicateFilter
    • Gate DataFlow mode on successful end-to-end operator execution, not package import alone.
  • Update the pipeline to the current storage/operator model

    • Remove obsolete assumptions such as len(storage), iterating FileStorage, and storage.save().
    • Use explicit FileStorage.step() transitions and materialize output records directly to dataset_clean.jsonl.
    • Keep the existing contract:
      • 50–100,000 character bound
      • 0.25 alphabetic-character ratio
      • near-dedup with exact-hash fallback
  • Avoid hidden NLTK downloads

    • Keep the alpha-ratio stage in deterministic Python rather than using AlphaWordsFilter, which can trigger implicit NLTK fetches.
    • Use DataFlow only for the supported bounded stages.
  • Make execution mode and reporting honest

    • Add explicit execution_mode reporting: dataflow, mixed, or fallback.
    • Record only operators that actually ran.
    • Update discussion/report content to distinguish successful DataFlow execution from fallback behavior.
    • Keep repo-memory out of the success path so dataset production is not conflated with signed-commit branch initialization.
if timeout 5m "$VENV/bin/pip" install "uv==0.8.3" &&
   timeout 20m env UV_HTTP_TIMEOUT=60 UV_HTTP_RETRIES=3 \
     "$VENV/bin/uv" pip install --python "$VENV/bin/python3" "open-dataflow==1.0.10" &&
   timeout 2m "$VENV/bin/python3" smoke_test.py; then
  dataflow_ready=true
else
  echo "::warning::DataFlow installation or API validation failed; using fallback path"
fi

run: https://github.com/github/gh-aw/actions/runs/30815680828

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 9.88 AIC · ⌖ 4.97 AIC · ⊞ 8.3K ·
Comment /souschef to run again


Run: https://github.com/github/gh-aw/actions/runs/30820387900

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 13.2 AIC · ⌖ 5.18 AIC · ⊞ 8.3K ·
Comment /souschef to run again


branch-refresh requested by PR Sous Chef run: https://github.com/github/gh-aw/actions/runs/30830929419

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 12 AIC · ⌖ 5.86 AIC · ⊞ 8.3K ·
Comment /souschef to run again

Copilot AI and others added 2 commits August 3, 2026 12:20
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix DataFlow dataset workflow compatibility with current API Bound DataFlow dataset setup and update the workflow to the current DataFlow API Aug 3, 2026
Copilot AI requested a review from pelikhan August 3, 2026 12:43
@pelikhan
pelikhan marked this pull request as ready for review August 3, 2026 12:53
Copilot AI review requested due to automatic review settings August 3, 2026 12:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Bounds DataFlow setup, updates the dataset pipeline to DataFlow 1.0.10, and improves fallback reporting.

Changes:

  • Pins and time-bounds dependency installation.
  • Updates storage, filtering, deduplication, and execution-mode handling.
  • Removes repo-memory finalization and regenerates the workflow lock file.
Show a summary per file
File Description
.github/workflows/dataflow-pr-discussion-dataset.md Updates installation, pipeline, fallback, and reporting logic.
.github/workflows/dataflow-pr-discussion-dataset.lock.yml Regenerates the compiled workflow.
.github/skills/agentic-workflows/SKILL.md Adds the observability optimization reference.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/3 changed files
  • Comments generated: 4
  • Review effort level: Balanced

Comment on lines +470 to +473
if dataflow_ops_used and python_ops_used:
stats["execution_mode"] = "mixed"
elif dataflow_ops_used:
stats["execution_mode"] = "dataflow"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 8a6f6ee. python_alpha_ratio_filter is now added directly to operators_used but is not tracked in python_ops_used. Mode is computed solely from dataflow_ops_used vs python_ops_used (the DataFlow-eligible fallback stages), so a run where both DataFlow stages succeed reports dataflow correctly.

Comment on lines +478 to +480
with open(OUTPUT, "w") as fh:
for record in records_after_dedup:
fh.write(json.dumps(record, ensure_ascii=False) + "\n")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 8a6f6ee. Added _DATAFLOW_INTERNAL_KEYS = frozenset({"char_number_filter_label", "minhash_deduplicated_label", "hash_deduplicated_label"}) and strip those keys before writing each record, so the output schema is uniform regardless of execution path.

Comment on lines +422 to +425
CharNumberFilter(threshold=50).run(storage=storage, input_key="text")
storage.step() # step 1 = length-filter output
records_after_length = storage.read("dict")
dataflow_ops_used.append("CharNumberFilter")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 8a6f6ee. After reading storage.read("dict") from the CharNumberFilter step, an explicit [r for r in records_after_length if len(r.get('text', '')) <= 100_000] cap is applied before proceeding, enforcing the full 50–100,000 character bound on the DataFlow path.

Comment on lines +448 to +449
MinHashDeduplicateFilter(threshold=0.85).run(storage=storage, input_key="text")
dataflow_ops_used.append("MinHashDeduplicateFilter")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 8a6f6ee. Removed MinHashDeduplicateFilter entirely from the pipeline, smoke test, and selected_operators. The pipeline now uses only HashDeduplicateFilter, which is deterministic and fully exercised end-to-end by the smoke test. The open-insertion-session inconsistency no longer applies.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ PR Code Quality Reviewer failed during code quality review.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. Test Quality Sentinel skipped. PR only contains workflow changes (.github/workflows/dataflow-pr-discussion-dataset.md and .lock.yml).

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR does not have the implementation label and has 0 new lines of code in business logic directories.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot sous-chef triage:

Please refresh the branch if needed and then run the pr-finisher skill.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 9.88 AIC · ⌖ 4.97 AIC · ⊞ 8.3K ·
Comment /souschef to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Skills-Based Review 🧠

Applied /diagnosing-bugs — requesting changes on three correctness gaps in the new setup and pipeline.

📋 Key Themes & Highlights

Key Themes

  • Smoke test doesn't exercise MinHash: MinHashDeduplicateFilter is instantiated but .run() is never called, so the smoke gate doesn't validate the operator that is most likely to regress.
  • selected_operators is static: The runtime JSON hardcodes all three operators even when some weren't validated, giving the downstream agent a false confidence signal.
  • Missing upper-bound in DataFlow path: CharNumberFilter(threshold=50) only enforces the lower bound; the 100,000-character cap is absent from the DataFlow and mixed execution paths.

These three issues (plus the four already flagged by prior review: mode misclassification, label field leakage, missing upper bound in smoke test, and MinHash LSH session ordering) collectively mean the dataflow and mixed execution paths can produce different output from fallback for the same input.

Positive Highlights

  • ✅ Explicit timeout bounds on each install step — a clear improvement over the unbounded previous approach.
  • ✅ Graceful degradation with ::warning:: annotations keeps the workflow useful even when DataFlow is unavailable.
  • ✅ Three-way execution mode reporting (dataflow / mixed / fallback) is a good observability addition.
  • ✅ Avoiding AlphaWordsFilter to prevent implicit NLTK downloads is a sound defensive choice.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 37.5 AIC · ⌖ 12.9 AIC · ⊞ 7.1K
Comment /matt to run again

Comments that could not be inline-anchored

.github/workflows/dataflow-pr-discussion-dataset.md:478

[/diagnosing-bugs] The smoke test instantiates MinHashDeduplicateFilter but never calls .run() — so MinHash is never actually exercised. If MinHash's API is broken, the smoke test still passes and dataflow_ready=true, deferring the failure to the production pipeline.

<details>
<summary>💡 Suggested fix</summary>

Replace the dead assignment with a real round-trip:

storage.write(after_length)
storage.step()
MinHashDeduplicateFilter(threshold=0.85).run(storage=storage, input</details>

<details><summary>.github/workflows/dataflow-pr-discussion-dataset.md:499</summary>

**[/diagnosing-bugs]** `selected_operators` in the runtime status file is hardcoded to all three operators regardless of which ones the smoke test actually exercises. This contradicts the PR goal of &quot;record only operators that actually ran&quot; and misleads the production pipeline about what was validated.

&lt;details&gt;
&lt;summary&gt;💡 Suggested fix&lt;/summary&gt;

Build `selected_operators` dynamically based on what the smoke test confirmed:

```python
validated = []
if ...:  # CharNumberFilter passed
    val</details>

<details><summary>.github/workflows/dataflow-pr-discussion-dataset.md:750</summary>

**[/diagnosing-bugs]** `CharNumberFilter(threshold=50)` only applies a lower bound. The PR description requires a 100,000-character upper bound, but there is no `max_threshold` or equivalent argument here. Records over 100 K characters pass the DataFlow path but would be caught by the Python fallbackcreating an inconsistency between execution modes.

&lt;details&gt;
&lt;summary&gt;💡 Suggested fix&lt;/summary&gt;

Check whether `CharNumberFilter` accepts a `max_threshold` keyword and pass it:

```python
CharN</details>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review: Bound DataFlow dataset setup

The changes are well-structured overall. The timeout-bounded install, pinned open-dataflow==1.0.10, and graceful fallback path are solid improvements.

Existing inline comments already cover the main correctness concerns. One structural note: in the smoke test, MinHashDeduplicateFilter is instantiated but .run() is never called, so a broken .run() API would not be caught at setup time. The graceful try/except in the main pipeline mitigates this.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 45.4 AIC · ⌖ 7.53 AIC · ⊞ 5.4K

…ema, upper-bound filter, MinHash

- Fix mode reporting: exclude intentional Python alpha-ratio stage from
  python_ops_used; mode is now computed from DataFlow-eligible stages only
  (CharNumberFilter + HashDeduplicateFilter). Pure DataFlow success reports
  as `dataflow`, partial fallback reports as `mixed`.

- Strip DataFlow internal label fields (char_number_filter_label,
  minhash_deduplicated_label, hash_deduplicated_label) before writing
  output so the dataset schema is uniform regardless of execution path.

- Add explicit upper-bound cap (100,000 chars) after DataFlow
  CharNumberFilter output; CharNumberFilter(threshold=50) only enforces
  the lower bound.

- Replace MinHashDeduplicateFilter with HashDeduplicateFilter in the
  pipeline. The 1.0.10 MinHash implementation queries its LSH index
  while an insertion_session is still open (datasketch inconsistency);
  HashDeduplicateFilter is deterministic and already validated by the
  smoke test. Remove MinHash import, instantiation, and reference from
  the smoke test and selected_operators list.

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🔍 PR Triage

Category: bug · Risk: medium · Total score: 60/100

Impact Urgency Quality
30/50 17/30 13/20

Bounds/pins DataFlow dataset setup to avoid budget exhaustion and updates pipeline to current DataFlow API with honest execution-mode reporting. CI pending.

Recommended action: fast_track — fixes a workflow reliability issue with clear scoping.

Generated by 🔧 PR Triage Agent · auto · 55.7 AIC · ⌖ 4.24 AIC · ⊞ 8K ·

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@copilot sous-chef triage:

Please refresh the branch if needed and then run the pr-finisher skill....

Done. Addressed all four review issues in commit c0203f7's follow-up:

  1. Mode reportingpython_alpha_ratio_filter is now tracked separately (it's an intentional Python stage, not a fallback). python_ops_used only tracks fallback ops, so the dataflow / mixed / fallback modes compute correctly.

  2. Schema consistency — Added _DATAFLOW_INTERNAL_KEYS stripping (char_number_filter_label, minhash_deduplicated_label, hash_deduplicated_label) before writing each output record. The dataset schema is now uniform regardless of execution path.

  3. Upper-bound filter — Added an explicit <= 100_000 cap after reading DataFlow CharNumberFilter output. CharNumberFilter(threshold=50) only enforces the lower bound; the upper bound is now always applied on both paths.

  4. MinHash session inconsistency — Removed MinHashDeduplicateFilter from the pipeline, smoke test imports, and selected_operators. HashDeduplicateFilter is used directly; it's deterministic and already fully exercised by the smoke test. The inner try/except for MinHash fallback is also removed since it's no longer needed.

Local validation: make fmt ✅ · make lint ✅ · make test-unit ✅ · make recompile (269/269) ✅

Copilot AI requested a review from gh-aw-bot August 3, 2026 13:29
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot sous-chef triage:

Please refresh the branch if needed and then run the skill.

Generated by 👨🍳 PR Sous Chef · run: https://github.com/github/gh-aw/actions/runs/30820387900

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 13.2 AIC · ⌖ 5.18 AIC · ⊞ 8.3K ·
Comment /souschef to run again

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@copilot sous-chef triage:

Please refresh the branch if needed and then run the skill....

All four review threads have been addressed in commit 8a6f6ee and replied to. Local validation passes: make fmt ✅ · make lint ✅ · make test-unit-all ✅ · make recompile 269/269 ✅. PR is ready for human CI re-trigger and merge.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot sous-chef triage:

All review threads appear addressed in the latest branch state; please run the pr-finisher skill and summarize any remaining blockers for maintainer review.

Generated by 👨🍳 PR Sous Chef · run: https://github.com/github/gh-aw/actions/runs/30830929419

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 12 AIC · ⌖ 5.86 AIC · ⊞ 8.3K ·
Comment /souschef to run again

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@copilot sous-chef triage:

All review threads appear addressed in the latest branch state; please run the pr-finisher skill and summarize any remaining blockers for maintainer review....

PR finisher summary:

  • Reviews — All 4 copilot-pull-request-reviewer threads are outdated (code changes landed in 8a6f6ee) and have been replied to with fix details. They remain unresolved in GitHub's UI because thread resolution requires a maintainer to click "Resolve" — the agent has no API access to resolve threads.
  • Checks (local)make fmt, make lint, make test-unit-all, and make recompile (269/269) all pass. No changes since the last validated push.
  • Checks (CI) — Stale on the agent's HEAD; the prior copilot job (run 30821097613) completed with success. CI must be re-triggered by a maintainer before merge.
  • Mergeable — Branch is OPEN, not draft, up to date with main (merged via c0203f7). mergeable_state: blocked will clear once threads are resolved and CI is re-triggered.

Still needed (human actions):

  1. Resolve the 4 review threads in the GitHub PR UI (they are all outdated/fixed).
  2. Re-trigger CI (close/reopen the PR or push a trivial commit) to get a fresh green check run before merging.

@pelikhan
pelikhan merged commit af48759 into main Aug 3, 2026
3 checks passed
@pelikhan
pelikhan deleted the copilot/dataflowfix-dataflow-install-timeout branch August 3, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the DataFlow dataset workflow bounded and compatible with the current API

4 participants