镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

feat(agents): add dormant config history with gaps, diff and revert - #1208

Merged
wpfleger96 merged 2 commits into
mainfrom
hayt/agent-config-history
Oct 16, 2026
Merged

wpfleger96 merged 2 commits into
mainfrom
hayt/agent-config-history

Conversation

@wpfleger96

@wpfleger96 wpfleger96 commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

🤖 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-core artifact.rs, MAX_OFFSET = 10000). Type-only; filters already pass through to /query as JSON.
  • agent-config-history.ts
    • loadOlder reads {"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.
    • segments builds 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) or unavailable (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) and settingsDiff (by field).
    • revisionProblem checks a revision with the store's artifactProblem, plus the plugin settings schema (syncedSettings) for buzz.agent.settings. Settings with no schema to check against are never valid.
    • revertTemplate publishes the old snapshot as op=update with prev = current head, and refuses unless the built snapshot passes revisionProblem, 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's restore, 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's Delivery: 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-system Button and InlineHeader, semantic tokens only; diff lines pair --affordance-success / --affordance-danger fills 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

  • Pages are 100 revisions, not the relay's maximum 1,000, so each "Load older" stays a short list. The relay's offset ceiling then caps visible history at 10,100 revisions instead of 11,000; the capped row says so.
  • A redaction between pages shifts offsets the other way and can skip one revision; that link then shows as unavailable until history reloads.

@wpfleger96
wpfleger96 force-pushed the hayt/agent-config-history branch from fba7699 to ed64d51 Compare October 15, 2026 20:29
@wpfleger96
wpfleger96 force-pushed the hayt/agent-config-store branch 2 times, most recently from adc59d6 to 49f95f4 Compare October 16, 2026 00:18
@wpfleger96
wpfleger96 force-pushed the hayt/agent-config-history branch from ed64d51 to 7710ccb Compare October 16, 2026 01:33

@wpfleger96 wpfleger96 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-101 reloads only when its reader/subject or head?.id changes. 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.

@wpfleger96
wpfleger96 force-pushed the hayt/agent-config-store branch from 49f95f4 to a11650c Compare October 16, 2026 15:02
@wpfleger96
wpfleger96 force-pushed the hayt/agent-config-history branch from 7710ccb to 056a15a Compare October 16, 2026 15:19
Base automatically changed from hayt/agent-config-store to main October 16, 2026 15:55
@wpfleger96
wpfleger96 force-pushed the hayt/agent-config-history branch from 056a15a to 6cd54b9 Compare October 16, 2026 16:03
Hayt added 2 commits October 16, 2026 14:32
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>
@wpfleger96
wpfleger96 force-pushed the hayt/agent-config-history branch from 6cd54b9 to b108aa7 Compare October 16, 2026 18:40
@wpfleger96
wpfleger96 marked this pull request as ready for review October 16, 2026 19:29
@wpfleger96
wpfleger96 requested a review from a team as a code owner October 16, 2026 19:29

@kalvinnchau kalvinnchau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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.

@wpfleger96
wpfleger96 merged commit f91f77c into main Oct 16, 2026
32 checks passed
@wpfleger96
wpfleger96 deleted the hayt/agent-config-history branch October 16, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants