hooks transfer: --mode is inert (merge/replace/additive/nonsense all identical), counts don't reconcile (transferred=50 from a 45-pattern source; 4-5 lost with skipped=0), text prints [object Object]
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 812
- Forks
- 175
- Avg merge
- 2m
- Merged PRs (30d)
- 3
Description
Summary
hooks transfer does real work — patterns move between projects and re-running is idempotent — but --mode is completely inert, the reported counts do not reconcile with what lands on disk (or with the source), and the text output prints [object Object] and undefined.
Version: agentic-flow 2.1.2, Node v22.23.0, macOS 15.
What works
- Patterns genuinely transfer: a fresh target goes from 0 → 28 patterns.
- Re-running is idempotent — three consecutive merges leave the target at 28, not 84.
--min-confidencebehaves correctly and monotonically:
-c 0.0 transferred=50 landed=45
-c 0.5 transferred=39 landed=35
-c 0.7 transferred=32 landed=28 (default)
-c 0.99 transferred=31 landed=27
1. --mode has no effect, and invalid values are accepted
Fresh target for each run, same source:
--mode merge transferred=32 skipped=0 targetTotal=28
--mode replace transferred=32 skipped=0 targetTotal=28
--mode additive transferred=32 skipped=0 targetTotal=28
--mode nonsense transferred=32 skipped=0 targetTotal=28
All four are byte-identical in outcome. replace in particular should differ from merge — the documented modes imply different merge semantics — and nonsense is not a documented mode but is accepted silently and echoed back as "mode": "nonsense" in the JSON.
2. The counts do not reconcile
Two separate problems, visible in the table above.
transferred exceeds what the source contains. At -c 0.0:
source store: patterns 45, sequences 2, memories 6, dirPatterns 41, errorPatterns 0
reported: transferred.patterns = 50
50 patterns cannot be transferred out of a 45-pattern store. The JSON field is specifically transferred.patterns, alongside separate memories, sequences and errorPatterns counters, so it is not an aggregate.
transferred never equals what lands, while skipped is always 0. Across every configuration, 4–5 patterns go unaccounted:
| transferred | landed | skipped | |
|---|---|---|---|
| -c 0.0 | 50 | 45 | 0 |
| -c 0.5 | 39 | 35 | 0 |
| -c 0.7 | 32 | 28 | 0 |
| -c 0.99 | 31 | 27 | 0 |
If those patterns were deduplicated or rejected, skipped should reflect it. As it stands the report claims a clean transfer of N with none skipped, and N−4 arrive.
Re-runs report the same 32 while adding nothing. Runs 2 and 3 against an already-populated target still report transferred=32, skipped=0, with the target unchanged at 28. So transferred appears to mean "considered", not "written" — which is defensible as an internal name but misleading as 📥 Patterns transferred: in the output.
3. Text output is broken
✅ Transfer Complete!
📥 Patterns transferred: [object Object]
🔄 Patterns adapted: undefined
🎯 Mode: merge
transferred is an object ({patterns, memories, sequences, errorPatterns}) being interpolated into a string. adapted does not exist in the JSON at all — the closest field is skipped.
The documented output also includes a line that never appears:
🛠️ Target stack: TypeScript, React, Node.js
Reproduce
mkdir -p /tmp/xfer/{source,target} && cd /tmp/xfer/source
printf 'def f():\n return 1\n' > a.py && git init -q . && git add -A && git commit -qm init
npx agentic-flow hooks pretrain
# copy a store with real content into source/.agentic-flow/intelligence.json for a non-degenerate test
cd /tmp/xfer/target && npx agentic-flow hooks pretrain
npx agentic-flow hooks transfer ../source --mode merge
npx agentic-flow hooks transfer ../source --mode merge --json
python3 -c "import json;print(len(json.load(open('.agentic-flow/intelligence.json'))['patterns']))"
A near-empty source makes this untestable — every mode and threshold reports 0 and the outcomes are indistinguishable. The source needs enough patterns for the thresholds to separate.
Suggested fix
- Implement
--mode, or remove it. Validate the value and exit non-zero on anything outsidemerge|replace|additive. - Reconcile
transferredwith what is written, and useskippedfor the difference — or rename the field toconsideredand add awrittencount. - Investigate
transferred.patterns = 50from a 45-pattern source. - Format
transferredby field rather than interpolating the object; drop or implementadaptedandTarget stack.
Related
- #198 —
hooks explainprints[object Object]for its reasons; same renderer defect. - #201 —
hooks metricsprintsundefinedin text while--jsoncarries correct values; also--detailedis inert like--modehere. - #199 —
hooks pretrain --depthis accepted and ignored, same shape as--mode.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the hooks transfer CLI entry point and run the supplied reproduction against a populated intelligence.json source. Compare merge, replace, additive and invalid modes, then compare JSON, text output, source counts, and target contents. Done means modes are validated and distinct where documented, counts reconcile with written or skipped patterns, and text output uses fields that exist.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100