ruvnet / ruvnet/agentic-flow

hooks pretrain --depth is ignored: depths 1, 5, 200 and 1000 give identical results, and the no-flag default differs from any explicit depth; Languages line never printed

Open
#199 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
812
Forks
175
Avg merge
2m
Merged PRs (30d)
3

Description

Summary

hooks pretrain --depth <n> ignores <n> entirely. Depths of 1, 3, 5, 200 and 1000 all produce byte-for-byte identical results. Only the presence of the flag changes anything — and it changes the result substantially versus omitting it, which suggests the default path and the explicit-depth path are different code, not the same code with a default of 50.

Separately, the documented 🌐 Languages: output line is never printed.

Version: agentic-flow 2.1.2, Node v22.23.0, macOS 15.

Reproduce

Each run against a freshly deleted store, so the memories duplication in #185 does not confound the numbers:

run() {
  rm -f .agentic-flow/intelligence.json
  npx agentic-flow hooks pretrain "$@" 2>&1 | grep -oE 'Co-edits found: [0-9]+'
  python3 -c "import json;print('sequences=',len(json.load(open('.agentic-flow/intelligence.json'))['sequences']))"
}
run                 # no flag
run --depth 1
run --depth 5
run --depth 200
run --depth 1000
(no flag)        Co-edits found: 2     sequences=2
--depth 1        Co-edits found: 100   sequences=15
--depth 5        Co-edits found: 100   sequences=15
--depth 200      Co-edits found: 100   sequences=15
--depth 1000     Co-edits found: 100   sequences=15
-d 3             Co-edits found: 100   sequences=15

A depth of 1 and a depth of 1000 cannot legitimately yield the same co-edit analysis of the same repository. 100 also looks like a fixed cap rather than a measurement.

patterns (45), memories (6) and dirPatterns (41) are identical across every run, as expected — only the git-derived fields move.

The default path differs from --depth 50

The documented default is 50. But omitting the flag yields 2 co-edits, while any explicit --depth yields 100. If the flag simply defaulted to 50, --depth 50 and no flag should agree. They do not, so the two paths appear to be independent implementations.

--skip-git and --skip-files do work

For contrast, the sibling flags behave correctly:

--skip-git      Co-edits found: 0     sequences=0    patterns=45  dirPatterns=41
--skip-files    Files analyzed: 0     patterns=0     sequences=2  dirPatterns=18

--skip-git zeroes exactly the git-derived fields; --skip-files zeroes the file analysis. (Minor oddity: --skip-files still reports dirPatterns=18 after analysing 0 files.)

So the option-parsing layer is fine — it is specifically the depth value that never reaches the git analysis.

Languages: is never emitted

The documented output includes:

🌐 Languages: TypeScript, JavaScript, Python

grep -c 'Languages' over the output of a plain pretrain returns 0, and the field is absent from --json too. Either the feature is unimplemented or the docs describe a different version.

For completeness, the same output still shows ⏱️ Duration: undefinedms, noted in #185.

Suggested fix

  1. Thread the --depth value through to the git-history analysis, and make the no-flag path use the documented default of 50 so that --depth 50 and no flag agree.
  2. If 100 is an intentional cap on co-edits, surface it — a user asking for depth 1000 and receiving a capped 100 has no way to tell that from a genuine measurement.
  3. Emit Languages: or drop it from the docs.

A test asserting that two sufficiently different depths produce different co-edit counts would pin item 1 permanently.

Related

  • #185 — pretrain duplicates memories on every run against an existing store. Every measurement above used a fresh store to avoid it.
  • #196 — the store this command produces makes hooks pre-edit routing worse than no store at all.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the fresh-store shell reproduction for hooks pretrain, comparing omitted, --depth 50, and widely different depth values. Trace the CLI entry point and git-history analysis to verify that the depth reaches the analysis, the documented default is consistent, and any cap is reported. Check normal and --json output for the documented Languages: line, and add the suggested regression test for differing depths.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, typescript
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.