Skip to content

Browse: stage view shows 0 units when units exist on the remote ref #247

Description

@jwaldrip

Summary

The browse view at https://haikumethod.ai/browse/<provider>/<project>/intent/<slug>/stage/<stage>/ renders "No units in this stage yet" even when the unit .md files are committed to the remote at the canonical path.

Reproduced on

twelve-week-plan-accountability-app intent on gitlab.com/gigsmart/projects/monorepo, product stage. Other stages on the same intent (e.g. design with 9 units) render correctly. Direct GitLab UI link confirms the files exist:

https://gitlab.com/gigsmart/projects/monorepo/-/tree/haiku/twelve-week-plan-accountability-app/main/.haiku/intents/twelve-week-plan-accountability-app/stages/product/units

What rules out the obvious causes

Verified via git ls-tree -r origin/haiku/twelve-week-plan-accountability-app/main:

  • 11 product unit .md files committed at .haiku/intents/twelve-week-plan-accountability-app/stages/product/units/unit-{01..11}-*.md
  • 149 total blobs in the intent tree (well under the GraphQL blobs(first: 500) cap) ✓
  • 21 tree nodes, 0 nesting weirdness ✓
  • Files byte-identical between haiku/<slug>/main and haiku/<slug>/development (the active stage branch) ✓
  • No haiku//product branch exists, which is correct — discrete mode keeps only one active stage branch at a time ✓

So the bug is NOT pagination, NOT cache staleness, NOT three-level merge logic, NOT FM parser rejection.

Hypothesis

GitLab's GraphQL tree(path:, ref:, recursive: true).blobs(first: 500) may have undocumented depth or breadth limits, OR the parser's blob-prefix filter mishandles something specific about the product unit FM (long quoted outputs: list using YAML folded scalars >- ...).

First diagnostic step

Add temporary logging in website/lib/browse/gitlab-provider.ts:497 (fetchIntentTreeFromRef) to dump:

  • treeData.project.repository.tree.blobs.nodes.length
  • The first/last 5 blob paths
  • Whether any path under stages/product/units/ is in the response

If the GraphQL response does include the product unit paths → parser bug in parseStageFromBlobs at gitlab-provider.ts:567-584.

If the GraphQL response doesn't include them → GraphQL truncation; switch to GitLab REST repository/tree?recursive=true&per_page=100 with explicit pagination.

Affected files

  • website/lib/browse/graphql/gitlab/operations.tsGitLabIntentTreeQuery (line 62)
  • website/lib/browse/gitlab-provider.tsfetchIntentTreeFromRef (line 482), parseStageFromBlobs (line 549)

Acceptance criteria

  • Browse view renders all 11 product units for twelve-week-plan-accountability-app
  • Add a unit-level test for the GitLab provider that seeds 11+ units in a stage and asserts the browse parser surfaces all of them
  • If root cause is GraphQL truncation, the fix replaces the recursive tree query with paginated REST so the bug can't recur on larger intents

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions