Skip to content

[Bug]: fix(codex): B3 chunk merge can discard semantic extraction results #4311

Closed

Description

@vibhanshu-mishra

Pre-flight checks

  • I have checked the Troubleshooting section in the README

What happened?

Summary

After installing Graphify's Codex integration in my repository, Cubic identified a potential data-loss bug in the semantic extraction pipeline.

In SKILL.md, Step B2 instructs Codex to collect semantic extraction results in memory and write them to .graphify_semantic_new.json.

However, Step B3 expects individual .graphify_chunk_NN.json files, which the Codex B2 workflow does not create.

As a result, B3 may treat valid extraction chunks as missing and overwrite the collected semantic results with an empty graph fragment.

Affected file

.codex/skills/graphify/SKILL.md

Location: Approximately line 291

Steps to reproduce

1. Install Graphify's Codex integration in a test repository.
2. Run `/graphify` on a corpus containing documents that require semantic extraction.
3. Follow the Codex-specific Step B2 workflow, collecting subagent results in memory and writing `.graphify_semantic_new.json`.
4. Continue to Step B3.
5. Observe that B3 attempts to validate and merge `.graphify_chunk_NN.json` files that Codex B2 did not generate.

These steps describe the suspected failure path identified through static review. I have not independently reproduced the issue at runtime.

Error output or graph output

## Expected behavior

Semantic extraction results collected by Codex should be preserved and merged into the final graph.

## Actual behavior / suspected failure

B3's file-based validation and merge logic does not match Codex's in-memory extraction workflow.

This can cause valid semantic extraction results to be discarded, potentially producing an incomplete graph.

## Suggested fix

- Add a Codex-specific B3 branch that uses the already-collected semantic results.
- Skip file-based chunk validation and merging when running the Codex in-memory workflow.
- Preserve `.graphify_semantic_new.json` instead of overwriting it with an empty result.
- Add a regression test verifying that semantic nodes and edges survive the B2-to-B3 transition.
- Implement the change in Graphify's authoritative skill-generation sources and regenerate the distributed skill files.

Graphify version

No response

Operating System

macOS

Python Version

3.1

Installation Method

uv tool install (recommended)

Additional Environment Details

No response

Additional context

This issue was identified by Cubic while reviewing Graphify-generated files in a downstream repository.

Activity

  1. added
    bug
    on Oct 11, 2026
  2. github-actions commented on Oct 11, 2026

    @github-actions

    Thanks for opening this issue, @vibhanshu-mishra. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

  3. added a commit that references this issue on Oct 11, 2026
    7a8dfff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions