Skip to content

Commit 2d81af3

Browse files
authored
host: abbreviate every home the report prints, so a long one keeps its reload advice (#2947)
Fixes #2944 Owner: Dev-1 Written-by: Dev-1 Reviewer: Birfy Claim-Id: caae840c7c1c43ed93884afb23503c9e Base: 6af7d04 Verified commit: 462e9bc13300707fcfe0382c07199ced532ae816 (tree 8a9733e) Pushed head: 23d885f Risk tier: T3 (`risk-gate (report only): PR #2947 tier T3; basis: the `.dsh`/`DSH_HOME` diff rule matched `core/src/host/diagnostics.js` and `core/test/diagnostics.test.js`; the change reads no `DSH_HOME`) ## What was wrong The report abbreviated only the **OS home**: `clean` (`core/src/host/diagnostics.js`) called `cleanText` with no `home`, so it fell back to `homedir()`, while `cleanPath` passed `rt.home`. A DSH home outside the OS home therefore stood in full in the `Read-only` row and in the log lines the report prints, while the `state file:` row on the same page said `~/state.json`. On a long home the row's 200 bound then cut the sentence before its advice — `close the other one and reload.` and `fix or move the file and reload.` disappeared. ## What changed - `core/src/host/diagnostics.js`: `cleanText` takes one folder or a **set** of them and abbreviates the longest first, so a team file under both the OS home and this host's own reads `~/state.json` whichever order the pair arrives in (`homeFolders`). `install` keeps its log/stderr cleaner as it was (the process's home), and adds `show` for what the report and the downloaded log print: the `Read-only` row, the log lines, the file rows (`cleanPath`), the journal sentence, the log-state sentence and the browser-client fields now all use both folders. Abbreviation still happens before `cut()`, so the bound measures the shortened text and the tail survives. - `core/test/diagnostics.test.js`: the probe (`realHost(t, { locked: true })` — no row may carry the home, the row names it `~`, and the reload advice is still there), the same claim for a log line the report prints, and the two `#2167` long-path fixtures now expect `~/state.json` with the whole sentence instead of a cut. A third case keeps `#2936` pinned: a sentence over the bound, with a path no home abbreviates, is still cut between words with one `…`. - `docs/subsystems/core-host.md`: the diagnostics sentence now says `cleanText` turns **every** home folder into `~` first. - `changelog.d/728-diagnostics-home-abbrev.fixed.md`: one fragment. - `patches/ds-bot/0001-core-fixes.patch` and `0007-version-and-tooling.patch`: generated once, after the edit, from the committed tree. `core/src/client/**`, `core/client.js` and `patches/ds-bot/0008-client-bundle.patch` are untouched. In the usual layout, where the DSH home sits inside the OS home, the same rule now shortens `~/.dsh/bot/state.json` to `~/state.json`: that is the intended consequence of abbreviating every home, not an unintended change to what the report says. ## Red first, on base `6af7d044` (tests in the tree, fix not yet written) 1. Probe — `TZ=UTC node --test --import ./test/harness-resolve.mjs --test-name-pattern='#2944' test/diagnostics.test.js`: ``` not ok 44 - no row of the report carries this host's home folder (#2944) error: |- no row carries the home folder: | | | |---|---| | FlyBot | 0.2.30 | | DSH | 0.2.1-rc.2 | | OS | linux 5.15.0-194-generic x64 | | Node | v22.23.2 | | Team | 0 Bots, 0 Main, 0 group chats | | Read-only | The Bot team in /tmp/ds-bot-diag-ro-tYeKTd is open in another dsh (Web or Desktop, pid 1 on bluefox). This window shows the team but cannot change it; close the other one and reload. | ... true !== false ``` 2. The CI false green the issue names — a self-invented long home, the file untouched at the base: ``` $ L=/tmp/$(printf 'h%.0s' {1..70}); TMPDIR=$L node --test --import ./test/harness-resolve.mjs test/diagnostics.test.js not ok 41 - the Read-only row keeps the other-dsh wording when a live lock names it (#2167) | Read-only | The Bot team in /tmp/hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh/ds-bot-diag-ro-7IbgpY is open in another dsh (Web or Desktop, pid 1 on bluefox). This window shows the team… | # tests 70 / # pass 69 / # fail 1 ``` Under the default `TMPDIR=/tmp` the same file at the same base is `# tests 70 / # pass 70 / # fail 0` — the home there is short, so only a long home exposes the cut. ## Mutations (each half of the change must go red alone) - `Read-only` fact cleaned with the log cleaner (the report loses the second home): `# tests 73 / # pass 70 / # fail 3` — cases 38 and 39 (the two `#2167` long-home fixtures) and 44 (the probe). - The report's log lines cleaned with the log cleaner: `# tests 73 / # pass 72 / # fail 1` — only `a log line the report prints names the home as ~ (#2944)`. - `homeFolders` sorted shortest first: `# tests 73 / # pass 72 / # fail 1` — only the `cleanText` ordering assertion. ## What I ran, at `462e9bc13300707fcfe0382c07199ced532ae816` (tree `8a9733e21c3f68ec35e3e95865c9fa8285abefbf`) - `TZ=UTC npm run verify` (`TMPDIR=/tmp`, `DSH_HARNESS=…`): core lint ok, `arch-docs: OK (6 changed file(s))`, plugin lint ok, `build-client.mjs --check` ok, `ds-bot-patches check` `ok core/ equals ds-bot/ + patches/ds-bot/`, `canonical` `ok patches/ds-bot/ is what generate writes (generate is a no-op)`, then core `# tests 3178 / # pass 3176 / # fail 2`. - The two core reds are `bench.sh refuses before writing the profile when pnpm is missing` and `bench.sh shows a failed pnpm install and leaves no half-built profile` in `core/test/bench-preflight.test.js`. They are this box, not this change: a clean detached worktree at base `6af7d044` runs the same file `# tests 7 / # pass 5 / # fail 2` with the same two names. - Because `npm run verify` stops at that suite, its later steps ran separately at the same commit: `plugins/social` 619/619, `plugins/tree` 149/149, `plugins/timeline` 172/172, `plugins/workflow` 531/531, `plugins/project` 147/147, `.github/scripts` + `policy` 675/675, `changelog.mjs check` `18 fragment(s) … well formed`, `lint:interop` exit 0, `test:interop` exit 0, `lint:live-e2e` exit 0, `test:live-e2e` exit 0 — all exit 0. - `core/test/diagnostics.test.js` on its own: `# tests 73 / # pass 73 / # fail 0`, and under the long home (`L=/tmp/$(printf 'h%.0s' {1..70})`, `TMPDIR=$L`) also `# tests 73 / # pass 73 / # fail 0`. ## Not run - The smoke bench (`dev/bench.sh smoke`) — this box's bench preflight is the known red above (`pnpm` missing), so a bench run would report the environment, not this card; nothing here changes start-up. - No browser/client build: `core/src/client/**` is untouched and `build-client.mjs --check` confirms `client.js` still is the build of `src/client`. ## Checkpoint <!-- flybot:checkpoint --> ```json { "pr": 2947, "claim": "Dev-1", "issue": 2944, "summary": "The report abbreviated only the OS home, so a DSH home outside it stood in full in the Read-only row and in the log lines the report prints, while the file rows beside it said ~/state.json; on a long home the 200 bound then cut the reload advice off the sentence. cleanText now takes one folder or a set of them, longest first, and the report and the downloaded log hand it both the process's home and this host's own, while the host's own log and stderr keep the folder a person can open. Abbreviation still happens before the bound, so a long home no longer loses the tail.", "files": ["core/src/host/diagnostics.js", "core/test/diagnostics.test.js", "docs/subsystems/core-host.md", "changelog.d/728-diagnostics-home-abbrev.fixed.md", "patches/ds-bot/0001-core-fixes.patch", "patches/ds-bot/0007-version-and-tooling.patch"], "checks": {"ran": "TZ=UTC npm run verify; plugins/social|tree|timeline|workflow|project test; node --test .github/scripts/*.test.mjs policy/*.test.mjs; lint:interop test:interop lint:live-e2e test:live-e2e; changelog check; ARCH_DOCS_BASE=6af7d044 npm run arch-docs; diagnostics 73/73 default and under a long TMPDIR", "result": "green", "at": "462e9bc13300707fcfe0382c07199ced532ae816"}, "next": "waiting for a Verdict naming the pushed head" } ``` <!-- /flybot:checkpoint -->
1 parent 1b2408e commit 2d81af3

6 files changed

Lines changed: 193 additions & 57 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The report behind Settings → About now shortens the whole home it prints, not half of it: a DSH home outside the OS home used to stand in full in the `Read-only` row (a lock held by another dsh, or a team file that could not be read) while the file rows beside it said `~/state.json`. Both folders now become `~` before the sentence's 200 bound is applied, so a long home no longer cuts the reload advice off the end of that row. See [#2944](https://github.com/ThinkFlowLab/FlyBot/issues/2944).

‎core/src/host/diagnostics.js‎

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ export const ISSUES_URL = 'https://github.com/ThinkFlowLab/FlyBot/issues/new'
2323

2424
const quote = value => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
2525

26+
// The folders one line may name, longest first (#2944): this host's own home can sit outside the
27+
// OS home, and a row that shortened one of them disagreed with the row beside it. The longer folder
28+
// goes first, so a team file under both reads `~/state.json`, not `~/.dsh/bot/.../state.json`.
29+
const homeFolders = home => [...new Set((Array.isArray(home) ? home : [home])
30+
.filter(folder => typeof folder === 'string' && folder.length > 1))]
31+
.sort((a, b) => b.length - a.length)
32+
2633
// Shapes of credentials that are not saved keys: provider keys, bearer tokens, and
2734
// token or key parameters in addresses (the Web login address carries one).
2835
const CREDENTIALS = [
@@ -42,16 +49,17 @@ const CREDENTIALS = [
4249
// The bound is taken here, after the home folder has been abbreviated to `~` (#2936): a bound taken
4350
// on the raw text measures a path that is about to shrink, so a sentence could end mid-word with no
4451
// mark at all. One function decides both, so the `…` has exactly one owner and never doubles.
52+
// `home` is one folder or the set this host prints under `~` (#2944).
4553
export function cleanText(text, { redact = value => value, home = homedir(), max = TEXT_MAX } = {}) {
4654
let out = redact(String(text ?? ''))
4755
for (const [pattern, replacement] of CREDENTIALS) out = out.replace(pattern, replacement)
48-
if (home && home.length > 1) {
49-
out = out.replace(new RegExp(quote(home), 'g'), '~')
56+
for (const folder of homeFolders(home)) {
57+
out = out.replace(new RegExp(quote(folder), 'g'), '~')
5058
// JSON and Windows paths spell the same folder with doubled or forward slashes.
51-
const slashes = home.replace(/\\/g, '/')
52-
if (slashes !== home) out = out.replace(new RegExp(quote(slashes), 'g'), '~')
53-
const doubled = home.replace(/\\/g, '\\\\')
54-
if (doubled !== home) out = out.replace(new RegExp(quote(doubled), 'g'), '~')
59+
const slashes = folder.replace(/\\/g, '/')
60+
if (slashes !== folder) out = out.replace(new RegExp(quote(slashes), 'g'), '~')
61+
const doubled = folder.replace(/\\/g, '\\\\')
62+
if (doubled !== folder) out = out.replace(new RegExp(quote(doubled), 'g'), '~')
5563
}
5664
const kept = cut(out, max)
5765
if (!kept.cut) return out
@@ -162,7 +170,14 @@ export function install(rt) {
162170
let fileFailed = false
163171
let fileFailure
164172

173+
// What this host writes to its own log and stderr is cleaned against the process's home alone:
174+
// that text is for the person at this machine, and a warning names the folder they can open.
165175
const clean = (text, options) => cleanText(text, { redact: rt.redactSecrets, ...options })
176+
// What the report and the downloaded log print is cleaned against both folders (#2944): this
177+
// host's own home can sit outside the OS home, and then one row of the report said `~` while the
178+
// row beside it carried the folder in full.
179+
const reportHomes = [homedir(), home]
180+
const show = (text, options) => cleanText(text, { redact: rt.redactSecrets, home: reportHomes, ...options })
166181

167182
// Entries from earlier runs, read once; new ones are kept apart until then. A read that failed
168183
// (`EACCES`, `EISDIR`, a name this host may not open) is not a log without errors (#2604): the
@@ -269,8 +284,8 @@ export function install(rt) {
269284
const old = (await earlier).filter(entry => entry.time > cleared)
270285
const list = [...old, ...fresh].slice(-KEEP).map(entry => ({
271286
...entry,
272-
text: clean(entry.text),
273-
...(entry.stack ? { stack: clean(entry.stack) } : {}),
287+
text: show(entry.text),
288+
...(entry.stack ? { stack: show(entry.stack) } : {}),
274289
}))
275290
// A log this host could not read is not an empty one (#2604): the answer carries the reason
276291
// beside the entries, so a caller that would show "no entries" can say why instead. It is a
@@ -311,9 +326,10 @@ export function install(rt) {
311326
return NOT_PLAIN
312327
}
313328
}
314-
// A path is cleaned with this host's own home, not the process's: a machine shows `~/.dsh/...`
315-
// and a test's temporary home shows `~/...`, so no report carries the folder a person lives in.
316-
const cleanPath = text => cleanText(text, { home, redact: rt.redactSecrets })
329+
// A path is cleaned like every other text (#2944): this host's own home first, the process's too,
330+
// so a machine shows `~/.dsh/...` and a test's temporary home shows `~/...` — no report carries
331+
// the folder a person lives in.
332+
const cleanPath = text => show(text)
317333
const fileFact = async (path, { missing, notPlain }) => {
318334
if (path === undefined) return undefined
319335
try {
@@ -434,7 +450,7 @@ export function install(rt) {
434450
// The store's own sentence (#2153): `stuck` (a team file that could not be read) and a
435451
// live state.lock are different faults, and the sidebar shows this same sentence, so the
436452
// report must not compress both into "another dsh holds the team".
437-
readOnly: readOnly ? clean(readOnly, { max: 200 }) : undefined,
453+
readOnly: readOnly ? show(readOnly, { max: 200 }) : undefined,
438454
plugins: plugins(),
439455
// The writer opens on the first save that got past `writable()` (#2351), so a window that
440456
// has not saved yet never read or repaired the file: `recording` there promises a line
@@ -444,7 +460,7 @@ export function install(rt) {
444460
stateJournal: journal === undefined ? undefined
445461
: journal.recording ? (readOnly ? 'paused (this window is read-only)'
446462
: journal.opened === false ? 'not started (opens with the first save)' : 'recording')
447-
: `stopped (${clean(journal.because)})`,
463+
: `stopped (${show(journal.because)})`,
448464
// The file that sentence is about, in the same shape (#2388): the path with the home as `~`
449465
// and its size and last write time, `none yet` before the first save creates it, or the one
450466
// sentence for a leaf this host would not read. A host without the journal says nothing.
@@ -456,15 +472,15 @@ export function install(rt) {
456472
// reasons are read as they stand now, not as the stderr latches left them (#2383). The
457473
// start-up read is the third (#2604): a log this host could not open leaves every earlier
458474
// line out of the list, so `recording` alone would claim a read that never happened.
459-
diagnosticsLog: !toFile ? undefined : logState(),
475+
diagnosticsLog: !toFile ? undefined : show(logState()),
460476
// The read's own reason, so the report's text can say the earlier lines are missing without
461477
// reading it back out of the sentence above (#2604).
462-
diagnosticsLogUnread: !toFile ? undefined : earlierFailure,
478+
diagnosticsLogUnread: !toFile ? undefined : (earlierFailure === undefined ? undefined : show(earlierFailure)),
463479
}
464480
}
465481

466482
const sanitizeClient = (client) => {
467-
const pick = (value, max) => (typeof value === 'string' ? clean(value, { max }) : undefined)
483+
const pick = (value, max) => (typeof value === 'string' ? show(value, { max }) : undefined)
468484
return {
469485
surface: pick(client?.surface, 40),
470486
language: pick(client?.language, 20),
@@ -473,7 +489,7 @@ export function install(rt) {
473489
}
474490
const sanitizeClientEntries = list => (Array.isArray(list) ? list : []).slice(-20).flatMap((item) => {
475491
if (typeof item?.text !== 'string' || typeof item.time !== 'number') return []
476-
return [{ time: item.time, level: item.level === 'warn' ? 'warn' : 'error', source: 'browser', text: clean(item.text, { max: 500 }), ...(typeof item.code === 'string' ? { code: clean(item.code, { max: 40 }) } : {}) }]
492+
return [{ time: item.time, level: item.level === 'warn' ? 'warn' : 'error', source: 'browser', text: show(item.text, { max: 500 }), ...(typeof item.code === 'string' ? { code: show(item.code, { max: 40 }) } : {}) }]
477493
})
478494

479495
async function report(body = {}) {

‎core/test/diagnostics.test.js‎

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ test('cleanText hides keys, tokens and the home folder', () => {
1818
const out = cleanText(text, { home, redact: value => value.replaceAll('VALUE1234', '[secret:DEMO]') })
1919
assert.equal(out, 'key sk-[hidden] and Bearer [hidden] at http://h:1/?token=[hidden]&x=1 in ~/.dsh/bot, "api_key": "[hidden]", saved [secret:DEMO]')
2020
assert.equal(cleanText('C:\\Users\\Shared\\x and C:/Users/Shared/y', { home: 'C:\\Users\\Shared' }), '~\\x and ~/y')
21+
// #2944: one line may abbreviate more than one folder, and the longer one wins, so a team file
22+
// under both the OS home and this host's own reads `~/state.json` whichever order they arrive in.
23+
assert.equal(cleanText('/home/user/.dsh/bot/state.json', { home: [home, '/home/user/.dsh/bot'] }), '~/state.json')
24+
assert.equal(cleanText('/srv/data/x and /home/user/y', { home: [home, '/srv/data'] }), '~/x and ~/y')
2125
assert.ok(cleanText('x'.repeat(5000)).length < 2100)
2226
})
2327

@@ -1022,26 +1026,41 @@ function assertCutBetweenWords(shown, sentence) {
10221026
}
10231027

10241028
test('the Read-only row says a newer team file needs an update, not that another dsh holds the team (#2167)', async (t) => {
1025-
const { statePath, readOnly, report } = await realHost(t, { saved: { version: 99 }, statePathLength: LONG_STATE_PATH })
1029+
const { home, statePath, readOnly, report } = await realHost(t, { saved: { version: 99 }, statePathLength: LONG_STATE_PATH })
10261030
assert.ok(statePath.length >= LONG_STATE_PATH, 'the fixture home is long enough to bound the sentence')
10271031
const sentence = `The Bot team file ${statePath} could not be read (saved by a newer FlyBot; update FlyBot). FlyBot does not change it; fix or move the file and reload.`
10281032
assert.equal(readOnly, sentence, 'the store still answers the whole sentence')
10291033
assert.match(readOnly, /update FlyBot/)
10301034
const shown = readOnlyRow(report)
1031-
assert.ok(shown.length <= 201, `the row keeps the 200 bound plus the mark: ${shown.length}`)
1032-
assert.match(shown, /update FlyBot/)
1033-
assertCutBetweenWords(shown, sentence)
1035+
// #2944: the sentence is abbreviated before the bound, so a long home no longer cuts its end; the
1036+
// fixture keeps its length to hold that, and the sentence reads `~/state.json` throughout.
1037+
assert.equal(shown, sentence.replace(statePath, '~/state.json'))
1038+
assert.equal(shown.includes(home), false, 'the row never carries the home folder')
1039+
assert.match(shown, /fix or move the file and reload\.$/, 'the advice survives the bound')
10341040
assert.doesNotMatch(report.markdown, /another dsh holds the team/)
10351041
})
10361042

10371043
test('the Read-only row says an unreadable team file could not be read, not that another dsh holds the team (#2167)', async (t) => {
1038-
const { statePath, report } = await realHost(t, { saved: 'dir', statePathLength: LONG_STATE_PATH })
1044+
const { home, statePath, report } = await realHost(t, { saved: 'dir', statePathLength: LONG_STATE_PATH })
10391045
const sentence = `The Bot team file ${statePath} could not be read (EISDIR). FlyBot does not change it; fix or move the file and reload.`
10401046
const shown = readOnlyRow(report)
1047+
assert.equal(shown, sentence.replace(statePath, '~/state.json'))
1048+
assert.equal(shown.includes(home), false, 'the row never carries the home folder')
1049+
assert.match(shown, /fix or move the file and reload\.$/, 'the advice survives the bound')
1050+
assert.doesNotMatch(report.markdown, /another dsh holds the team/)
1051+
})
1052+
1053+
// #2936 still holds for a path the report cannot shorten: a sentence over the bound is cut between
1054+
// two words with exactly one `…` at the end, whatever the text says.
1055+
test('a Read-only sentence over the bound is still cut between words (#2936)', async (t) => {
1056+
const { rt } = await realHost(t)
1057+
const elsewhere = `/srv/shared-team-data/${'a'.repeat(120)}/state.json`
1058+
const sentence = `The Bot team file ${elsewhere} could not be read (EISDIR). FlyBot does not change it; fix or move the file and reload.`
1059+
assert.ok(sentence.length > 200, 'the fixture sentence is over the bound')
1060+
rt.readOnly = () => sentence
1061+
const shown = readOnlyRow(await rt.diagnostics.report({}))
10411062
assert.ok(shown.length <= 201, `the row keeps the 200 bound plus the mark: ${shown.length}`)
1042-
assert.match(shown, /could not be read \(EISDIR\)/)
10431063
assertCutBetweenWords(shown, sentence)
1044-
assert.doesNotMatch(report.markdown, /another dsh holds the team/)
10451064
})
10461065

10471066
// The other half of the same rule: a sentence inside the bound is left exactly as it was written —
@@ -1062,6 +1081,28 @@ test('the Read-only row keeps the other-dsh wording when a live lock names it (#
10621081
assert.doesNotMatch(report.markdown, /could not be read/)
10631082
})
10641083

1084+
// #2944: the log lines the report prints agree with the rows above them. The host keeps the folder in
1085+
// its own log and stderr — a warning names a place the person can open — so the report is where the
1086+
// second home is abbreviated, and a line written before this change reads the same way.
1087+
test('a log line the report prints names the home as ~ (#2944)', async (t) => {
1088+
const { home, rt } = await realHost(t)
1089+
rt.warn('ds-bot: the log leaf is at %s', join(home, 'logs', 'diagnostics.jsonl'))
1090+
const report = await rt.diagnostics.report({})
1091+
assert.equal(report.markdown.includes(home), false, `the line never carries the home folder: ${report.markdown}`)
1092+
assert.match(report.markdown, /the log leaf is at ~\/logs\/diagnostics\.jsonl/)
1093+
})
1094+
1095+
// #2944: the report abbreviates this host's own home, not only the process's. A DSH home outside the
1096+
// OS home stood in full in the Read-only row while the file rows beside it said `~`, and on a long
1097+
// home the 200 bound then cut the reload advice off the sentence's end.
1098+
test('no row of the report carries this host\'s home folder (#2944)', async (t) => {
1099+
const { home, report } = await realHost(t, { locked: true })
1100+
const shown = readOnlyRow(report)
1101+
assert.equal(report.markdown.includes(home), false, `no row carries the home folder: ${report.markdown}`)
1102+
assert.ok(shown.includes('The Bot team in ~ is open in another dsh'), `the sentence names the home as ~: ${shown}`)
1103+
assert.match(shown, /close the other one and reload\.?$/, 'the advice survives the bound')
1104+
})
1105+
10651106
test('a writable window has no Read-only row', async (t) => {
10661107
const { report } = await realHost(t)
10671108
assert.equal(report.facts.readOnly, undefined)

‎docs/subsystems/core-host.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ has lines (#2790, `core/test/room-read-floor-clamp.test.js`).
466466

467467
### Diagnostics
468468

469-
- The report bounds a sentence after it abbreviates it ([#2936](https://github.com/ThinkFlowLab/FlyBot/issues/2936)): `cleanText` turns the home folder into `~` first and applies its `max` only then — the Read-only row's 200, a browser log line's 500 and its code's 40 — and a bound that fires backs off to the last whole word and closes with one `…`, so a long home can no longer leave a row that stops mid-word with no mark and the mark cannot double.
469+
- The report bounds a sentence after it abbreviates it ([#2936](https://github.com/ThinkFlowLab/FlyBot/issues/2936)): `cleanText` turns every home folder into `~` first — the process's and this host's own, which can sit outside it (#2944) — and applies its `max` only then — the Read-only row's 200, a browser log line's 500 and its code's 40 — and a bound that fires backs off to the last whole word and closes with one `…`, so a long home can no longer leave a row that stops mid-word with no mark and the mark cannot double.
470470
- The report also says which feature plugin the owner switched off ([#2940](https://github.com/ThinkFlowLab/FlyBot/issues/2940)): a `Plugins` row after `Read-only` names every id whose switch is off, in `FEATURE_PLUGINS` order and joined by `, `, ending ` off` (`project off`, `timeline, project off`), and appends ` (restart pending)` while one of those switches no longer answers the value this start read (`pluginSwitches` / `pluginSwitchesPending(rt.state, pluginSwitchesAtStart(statePath))`, the pair Settings → Plugins answers `pendingRestart` with). The row carries switch values only — never `loaded` or `installed`, which are other facts ([#2868](https://github.com/ThinkFlowLab/FlyBot/issues/2868)) — and a host whose switches are all on, or whose state has no `flybot.plugins` at all, draws no row: that report is byte for byte the one before this change.
471471
- Host diagnostics never depend on `ctx.logger`: DSH may export no logger, and a test or plugin-local host may carry one without `warn`. `rt.warn` still writes stderr and the diagnostics log in that case (`src/host/diagnostics.js`). Plugins reach the same log through `flybot.warn` (#68); see [plugin-runtime](plugin-runtime.md).
472472
- The `Read-only` row of a report repeats this host's own answer rather than one constant: `rt.readOnly()` is `undefined` while the window writes, a sentence about a live `state.lock` when another dsh holds the team, and a sentence about the team file when it is `stuck` (a newer version, a file that will not parse, an unreadable path). The report shows that sentence — `clean(cut(answer, 200))`, so saved keys, the home folder and `|` are handled like any other report text — the same one the sidebar shows, so a newer team file reads `update FlyBot` and an unreadable one reads `could not be read`, never `another dsh holds the team`; a writable window still adds no row ([#2167](https://github.com/ThinkFlowLab/FlyBot/issues/2167)).

0 commit comments

Comments
 (0)