Show a profile-grounding indicator on the planning screen

The planning view renders a quiet line for the standing-profile state
(loading/grounded/absent/unreadable) with a "change" affordance to
repoint the file via POST /knowledge/path. The profile text never
reaches the browser — only status, path, and size. Also updates the
README Status section to describe the M6 knowledge port.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-01 08:08:55 -04:00
parent b1b807590c
commit 5342da2755
3 changed files with 43 additions and 0 deletions
+25
View File
@@ -157,12 +157,35 @@ function updatePlanningTasks(tasks) {
});
}
// updatePlanningKnowledge renders the standing-profile grounding indicator and
// a small "change" affordance to repoint the file. idle/nil renders nothing;
// pending/ready/absent/error each show one quiet line. The profile text never
// reaches the browser — only status, path, and size.
function updatePlanningKnowledge(k) {
const el = document.getElementById('knowBand');
if (!el) return;
if (!k || k.status === 'idle') { el.innerHTML = ''; return; }
const base = (k.path || '').split('/').pop() || k.path || '';
let line;
if (k.status === 'pending') line = 'loading profile…';
else if (k.status === 'ready') line = `grounded by ${base} · ${k.chars} chars`;
else if (k.status === 'absent') line = `no profile (${k.path || 'unset'})`;
else line = 'profile unreadable';
el.innerHTML =
`<span class="knowline meta">${line}</span> <button type="button" class="link" id="knowChange">change</button>`;
document.getElementById('knowChange').onclick = () => {
const next = prompt('Profile file path (blank = default):', k.path || '');
if (next !== null) post('/knowledge/path', { path: next.trim() });
};
}
function render(state) {
setStateAttr(state);
const rs = state.runtime_state;
if (rs === 'planning' && renderedState === 'planning') {
updatePlanningCoach(state.coach);
updatePlanningTasks(state.tasks);
updatePlanningKnowledge(state.knowledge);
return;
}
if (rs === 'active' && renderedState === 'active') {
@@ -189,6 +212,7 @@ function render(state) {
<div id="coachStatus" class="meta"></div>
</div>
<div class="band" id="tasksBand"></div>
<div class="band" id="knowBand"></div>
<div class="band">
<label>Next action</label><input id="na" placeholder="What exactly will you do?">
<label>Success condition</label><input id="sc" placeholder="How do you know it's done?">
@@ -214,6 +238,7 @@ function render(state) {
};
updatePlanningCoach(state.coach);
updatePlanningTasks(state.tasks);
updatePlanningKnowledge(state.knowledge);
} else if (rs === 'active') {
const c = state.commitment || {};