Repository navigation
Description
Summary
better-harness harness analyze resolves the Qoder agent home through a function that
accepts only a directory whose basename is exactly .qoder or qoder. Qoder CN
(the China product line) uses ~/.qoder-cn, which fails that check, so the tool falls
back to ~/.qoder. On a machine that has never run the international Qoder Desktop,
~/.qoder exists but contains none of the session roots — so every enabled source root
reports as missing, the session-evidence facet degrades to 0 of 0 sessions with
confidence: Low, and the five-dimension chart in the Canvas report renders empty.
There is no user-facing way to override this: --qoder-home is read in the code but is
not exposed on any harness subcommand.
Environment
- better-harness 0.2.20 (Qoder marketplace distribution, single-file bundle at
scripts/better-harness.mjs) - Host: Qoder CN.app 0.4.8 / Qoder CN IDE 1.34.0 on macOS 26 (arm64)
- Actual agent home:
~/.qoder-cn
Observed
The report's own session facet states it plainly:
"Analyzed 0 of 0 sessions; 0/6 enabled source roots exist."
with selection: { eligibleCount: 0, analyzedCount: 0, confidence: "Low" },
episodeCoverage: { episodeCount: 0, ... }, and
warningCodes: ["missing-optional-root", "disabled-source-root"].
Meanwhile the same run's lanes.sessionEvidence.data.scope reports
{ platform: "qoder", workspace: "<workspace>", eligibleSessions: 44, selectedSessions: 44 }. So one collector finds 44 sessions and the other finds zero —
the disagreement is the symptom of the two paths resolving the home differently.
The data is demonstrably on disk under the CN home (this workspace's slug):
~/.qoder-cn/logs/sessions/-Users-<user>-Projects-<workspace> -> 958 files
~/.qoder-cn/projects/-Users-<user>-Projects-<workspace> -> 468 files
while the directory the tool actually looks in has none of the six roots:
~/.qoder -> contains only .auth/ browser-connector/ skills/
Root existence count under each candidate home, using the tool's own root list:
| home | roots present |
|---|---|
~/.qoder (what the tool uses) |
0 / 6 |
~/.qoder-cn (where the data is) |
4 / 6 |
Root cause
De-obfuscated from scripts/better-harness.mjs (0.2.20):
// default: hardcoded to the international home
function oh() { return path.join(os.homedir(), ".qoder") }
// whitelist: basename must be exactly ".qoder" or "qoder"
function rh(e) {
const t = path.basename(String(e ?? "")).toLowerCase()
return t === ".qoder" || t === "qoder"
}
// resolution order: explicit opt -> QODER_HOME (gated by whitelist) -> default
function ah(e = {}) {
const t = e.qoderHome ?? e["qoder-home"]
if (t) return path.resolve(we(t))
const n = process.env.QODER_HOME
return n && rh(n) ? path.resolve(we(n)) : oh()
}Every session source root is built from that single resolved home:
audit/audit.jsonl · logs/runs · logs/sessions/<slug> · projects/<slug> · sessions · cache/projects · projects
So on a Qoder CN install:
QODER_HOMEis either unset or points at~/.qoder-cn;rh("~/.qoder-cn")returns false (basename is.qoder-cn, not.qoder);ah()therefore falls through tooh()=~/.qoder;~/.qoderexists but is not a session store → all roots reportmissing-optional-root;- the session lane yields zero episodes and
confidence: Low.
Why this is worse than a warning
The failure is silent and partial. The run still completes, still emits
bundle.json / canvas.json / findings.json with bundle.err empty, and the findings
cards are still produced (they come from the Project lane, which doesn't need sessions).
But the five-dimension chart has no data, so a reader sees a report that looks
"reviewed" while its session-evidence half is empty. The tool's own design principle —
that missing evidence should be labelled rather than converted into a score — is
satisfied, yet nothing tells the user why the evidence is missing, and the message
("0/6 enabled source roots exist") points at a directory that is not the one their
product writes to.
No CLI workaround
ah() honours e.qoderHome ?? e["qoder-home"], but that option is not surfaced.
Checked on 0.2.20 — --qoder-home appears in --help output 0 times for:
harness analyze · harness evidence-bundle · harness task-loop-report · harness checkup · harness render
harness analyze --help lists only:
--workspace <path> --language <locale> --since <ISO> --until <ISO>
--format <text|json> --canvas-out <file> --replace-canvas --include-global-capabilities
So a CN user cannot point the tool at their own agent home by any supported means.
Steps to reproduce
- On macOS, install Qoder CN (agent home
~/.qoder-cn) without ever installing the
international Qoder Desktop. - Ensure
~/.qoderexists but has nologs//projects//sessions/subdirectories. - In a workspace that has real session history under
~/.qoder-cn, run
/better-harness(orbetter-harness harness analyze --workspace <path> --format json). - Inspect
canvas.json→summary.semanticFacetsshows
Analyzed 0 of 0 sessions; 0/6 enabled source roots exist, and the dimension chart
has no data.
Expected
The tool should resolve the agent home of the host that is actually running it, or at
minimum expose --qoder-home on the harness subcommands so the CN home can be
selected. When zero enabled roots exist, it should distinguish "this host has no session
history" from "I looked in the wrong directory" — e.g. by reporting the resolved home
path and the host it detected.
Suggested fixes (any one is enough to unblock)
- Widen the whitelist in
rh()to accept the CN variants (.qoder-cn,qoder-cn)
— or drop the basename gate entirely and validate that the directory actually looks
like an agent home (containslogs/orprojects/) instead of matching its name. - Expose
--qoder-homeonharness analyze/evidence-bundle/task-loop-report
/checkup/render, sinceah()already honours it. - Print the resolved home in the
missing-optional-rootwarning text, so
0/6 enabled source roots existbecomes actionable rather than ambiguous.
Notes on evidence quality
Verified directly: the oh() / rh() / ah() source (de-obfuscated from the shipped
0.2.20 bundle), the root list built off a single home, the 0/6 string and its
surrounding selection / episodeCoverage fields in a real canvas.json, the
44 vs 0 disagreement inside one bundle.json, the file counts under both candidate
homes, and the absence of --qoder-home from all five subcommand help texts.
Not verified: whether the international Qoder Desktop on a CN-configured machine hits
the same path (it legitimately owns ~/.qoder), and exactly which home the
sessionEvidence lane resolved when it reported 44 sessions — that lane may read via a
different code path than ah(). The claim being made is narrow: ah() cannot select
~/.qoder-cn, and the session-root scan driven by it finds nothing on this install.
Activity
fix(analysis): address host discovery and evidence review
fix(analysis): repair host discovery and evidence coverage