Repository navigation
feat(agents): add dormant config history with gaps, diff and revert - #1208
Conversation
fba7699 to
ed64d51
Compare
adc59d6 to
49f95f4
Compare
ed64d51 to
7710ccb
Compare
wpfleger96
left a comment
There was a problem hiding this comment.
Independent source review — dormant history view
Reviewed 7710ccbd3acd43f1587f3345beba1baed462702e against #1185 at 49f95f48f; origin and GitHub matched. Source pass for the explicitly dormant component. Minimalism 9/10, elegance 9/10, correctness 9/10 within that scope. This is not flag-on or readiness approval.
Evidence: traced channel-scoped offset reads, event-id deduplication, failed-page retry at the same offset, bounded 10,100-revision ceiling and its matching notice, disconnected chain segments and cause-specific gaps. The history model is display-only. Revert produces a new update on the supplied current head, validates its snapshot with the relevant schema, preserves current team name when valid, refuses deleted heads/targets, and distinguishes refusal from uncertain delivery in the UI. The line diff bounds its LCS allocation. Colocated tests exercise these contracts; I did not rerun CI-owned suites.
Integration observations / explicit flag-on gates:
AgentConfigHistory.tsx:92-101reloads only when its reader/subject orhead?.idchanges. Redacting an older revision leaves the head unchanged; this component has no explicit history invalidation input, so a parent must recreate it or supply a new reader identity. The live history callback in PR C is not connected. Add an explicit reload generation or equivalent tested integration before activation; prove redaction during offset paging clears the disclosed skipped-link result.- There is still no production mount in PR C at
464913923. That is reported as a PR C completeness blocker, not a new claim that this dormant PR should be reachable by itself. - Deleted instructions need restore, deliberately not revert. The integrated History destination must supply it before telling a blocked user to “restore from History.”
- The real system-channel deletion-head/history/refused-or-uncertain-revert checks, native writer integration and mounted UI checks (both themes, sizes, enlarged text, keyboard/pointer and diff contrast) are not established by these fixtures. Those remain the agreed flag-on gates rather than evidence this view has shipped.
CI is not clean at the inspection: WebKit shard 4/9 failed in tests/browser/buzz-links.spec.mjs:416 (the hovered-preview closeDelayEnded assertion); aggregate CI required failed in run 38835816504. This is outside this six-file history diff, but its cause must be resolved or explicitly dispositioned before readiness; I am not calling it a flake without evidence. Other broad checks inspected passed.
Read-only source review; no tests, live probes, repository edits or pushes. Keep draft. The combined feature does not pass because of PR C's production integration findings.
49f95f4 to
a11650c
Compare
7710ccb to
056a15a
Compare
056a15a to
6cd54b9
Compare
Config history pages one artifact's revisions by offset, builds every chain segment and labels each missing predecessor by cause, so a redacted or expired link is never called removed before every page loaded. Revert publishes the old snapshot as op=update on the current head; nothing mounts the panel until config sync ships. Signed-off-by: Hayt <211b96e6a2b7f45fd4047988976c7bbbeeda0c15f3ae7b32eec20834b5a55118@buzz.block.builderlab.xyz>
History pages now name the config channel in #h, without which the relay returns nothing from a system channel. Revert republishes only a snapshot that passes artifact and settings validation, so a malformed old revision can't become current; an invalid head still takes a valid revert. A refused or unconfirmed revert is shown beside its revision. Signed-off-by: Hayt <211b96e6a2b7f45fd4047988976c7bbbeeda0c15f3ae7b32eec20834b5a55118@buzz.block.builderlab.xyz>
6cd54b9 to
b108aa7
Compare
kalvinnchau
left a comment
There was a problem hiding this comment.
🤖 Approved with a non-blocking P3: empty-text diffs show a spurious removed blank line (src/features/agents/agent-config-history.ts:135–136). Treat empty text as zero lines and add a create-diff test. Full-suite timeout failures and browser validation remain unresolved; this approval covers the dormant scope only.
🤖 Dormant history view for an agent's or team's config artifacts (NIP-AP config channels): every revision the relay returns, the gaps between them labeled by cause, diffs, and revert.
Stack: this PR → #1226 → #1281
What it does
ReadFilter.offset(src/features/relay/events.ts): the NIP-AR page offset the relay already accepts (buzz-coreartifact.rs,MAX_OFFSET = 10000). Type-only; filters already pass through to/queryas JSON.agent-config-history.tsloadOlderreads{"artifact":"history","#h":[channel],"#d":[d]}in offset pages of 100. Every page names the config channel in#h, because the relay leaves system channels out of any read that doesn't (NIP-CL), members included. Repeats are dropped by event ID, so a revision accepted between pages doesn't show twice. A failed page keeps what loaded and retries the same offset. History is display only and never decides artifact state.segmentsbuilds every chain segment in the loaded revisions, not just the one from the current head, and labels each missing predecessor:unloaded(more pages exist),capped(the relay's offset ceiling is reached),failed(the last page read failed) orunavailable(every page loaded and the predecessor still isn't there). "Removed" is never claimed before history is complete.lineDiff(instructions and team instructions, LCS after trimming shared ends, bounded table) andsettingsDiff(by field).revisionProblemchecks a revision with the store'sartifactProblem, plus the plugin settings schema (syncedSettings) forbuzz.agent.settings. Settings with no schema to check against are never valid.revertTemplatepublishes the old snapshot asop=updatewithprev= current head, and refuses unless the built snapshot passesrevisionProblem, so a malformed or unsupported old revision is never republished as current config. The current head's title, team name and preserved tags carry over when the head is valid; when it isn't, they come from the target, so a valid older revision can still repair a broken head. It refuses a deleted head or target (that'srestore, not revert), and never redacts.AgentConfigHistory.tsx: the history list, gap rows with "Load older" / "Retry", per-revision "Show changes" and "Revert to this". An invalid revision stays listed, marked "Not valid", with an explanation in place of its diff and no Revert. Revert takes a writer that resolves to the relay'sDelivery: a refusal shows "Not reverted" beside the revision, while an uncertain delivery or a thrown error says it couldn't confirm the save, without claiming it failed. History stays loaded and Revert can be retried. Reloads from the newest page when the head changes. Design-systemButtonandInlineHeader, semantic tokens only; diff lines pair--affordance-success/--affordance-dangerfills with--text-success/--text-danger.Unreachable until config sync
Nothing imports
AgentConfigHistory. No route, tab or flag mounts it; config sync (#1226) adds the only caller, alongside the relay snapshot reader, writer and settings schema it takes as props.Notes
cappedrow says so.unavailableuntil history reloads.