Skip to content

feat!: drop Knowledge and Chat from the DataSource contract, keep Skills (#2206) - #139

Merged
jerryfane merged 3 commits into
mainfrom
phobos/2206-datasource-narrowing
Sep 17, 2026
Merged

jerryfane merged 3 commits into
mainfrom
phobos/2206-datasource-narrowing

Conversation

@jerryfane

Copy link
Copy Markdown
Collaborator

Prerequisite for gitmoot/gitmoot#2206, phase 5 of the gitmoot/gitmoot#2201 scope-narrowing campaign. Owner-authorized (workflow note 173279 on gitmoot/scope-narrowing).

gitmoot currently satisfies this module's DataSource with empty stubs for Knowledge and ChatThreads/ChatThread, because the interface requires them and dropping a method breaks compilation. This removes that requirement, plus six contract fields no real data source can set.

8 files, +124 / −5,572. web/dist/index.html accounts for 4,338.

What goes, and why each

removed why
Knowledge + 5 types, /api/learning/knowledge gitmoot returns dashboard.Knowledge{} hard-empty since #2202 retired the brain
ChatThreads/ChatThread + 4 types, 2 routes gitmoot retired native chat in #1754 and returns an empty slice
the Brain page it fetched /api/brain/events and /api/brain/fact — routes this module never registered, so it was broken against any data source, not just gitmoot's
ConfigAgent.ChatAutorespond, ConfigAgent.Memory rendered as permanently-false Config columns; projectDashboardConfigAgents never sets either
AgentSummary.MemoryEnabled, AgentConfigInfo.Memory, AgentDetail.MemoryFacts, AgentDetail.MemoryObservations served but structurally always zero: grep -rn "MemoryEnabled|MemoryFacts|MemoryObservations|Memory:" internal/cli/dashboard_web*.go in gitmoot returns nothing

Each field removal is a visible lie on a KEPT page, which is why they belong here rather than in a follow-up. The Config table went 8 → 6 columns and its meta line went 4 agents · 3 memory-enrolled · 1 auto-respond → 4 agents.

Skills STAYS — the one judgement call

gitmoot serves Skills from a real implementation over agent_templates/agent_template_versions, and 17 templates render on the live dashboard today. Campaign phase 3 (#2204) removes template authoring while explicitly keeping those tables and the dispatch read path, and the Learning page is read-only — version history, current version, a copyable promote command. Nothing on it authors anything.

Removing a working view of live data would be a regression dressed as a narrowing.

Consequence: #2206's gitmoot-side work removes only the Knowledge and Chat stubs. dashboard_web_skills.go is untouched.

Tasks is untouched

Verified it lives on the separate optional TasksDataSource, type-asserted in api.go, left byte-identical. It backs the "Needs a human" surface and still renders (26 tracked / 5 blocked in the demo).

Verification — served and driven, not compiled and assumed

Module gate (its own documented go build ./... && go vet ./... && go test ./...): all clean, ok github.com/gitmoot/gitmoot-dashboard, gofmt -l . empty.

Then go run ./cmd/gitmoot-dashboard-dev with real Chromium:

  • Nav rail renders exactly Overview, Tasks, Workflows, Jobs, Pipelines, Agents, Org, Galaxy, Charts, Learning, Needs a human, Health, Config — Chat and Brain absent.
  • All 13 clicked: every one mounts with real content, 17 distinct /api/* responses all 200, zero pageerror / console error / requestfailed across the sweep.
  • Galaxy draws its force graph, Charts its 30d series, Tasks its 4-column board, Learning/Skills its template list.
  • Retired URLs degrade instead of breaking: /chat, /brain, /learning/knowledge each return the SPA shell and the client normalizes to / (verified landedPath="/", title="gitmoot · overview").
  • Mobile 390×780: tab bar is Overview/Tasks/Workflows/More; the More sheet lists exactly the 12 kept surfaces.

Dangling-reference greps: knowledge|chatthread|/api/chat|/api/brain|showChat|showBrain|_chat|_know|_brain over index.html → no matches; over the Go files → one hit, an explanatory comment on Skills.

Re-pin risk, measured because it was worth knowing early

The pinned rev gitmoot uses (510fdc8) versus this base (68ef5a4) is purely additive — identical nav sets, identical client views, identical required DataSource methods, nothing deleted from datasource.go. So the eventual re-pin drops no live page.

One consequence to know: 68ef5a4 added WakeDataSource and three /api/wakes* routes, which gitmoot does not implement. Both sides already handle it — api.go type-asserts and 404s, and the client maps that 404 to an unsupported wake panel. The Overview page degrades gracefully.

Filed separately, not folded

[skillopt] knobs (auto_promote, pace_gate) in the fake Config fixture: #1752 removed the SkillOpt loop, so whether gitmoot still projects that section is #1752's question, not this campaign's.

Reviewer, please attack

  1. Skills staying — is keeping a required method for a page whose authoring half is being removed elsewhere the right call, or should the interface shed it and let gitmoot keep serving it optionally?
  2. The six field removals are contract-breaking. Any consumer other than gitmoot would fail to compile. Is that acceptable for a module with one known consumer, or should they be deprecated first?
  3. index.html lost 4,338 lines of a 12.8k hand-rolled file. The browser sweep covers the 13 nav entries; look for anything reachable another way — deep links, the mobile sheet, pull-to-refresh selector lists.

Not verified: this module against real gitmoot data — the sweep used the demo fake feed, which is the only data source this repo can serve on its own.

…lls (#2206)

gitmoot satisfies this module's DataSource with EMPTY STUBS for Knowledge,
ChatThreads and ChatThread because the interface requires them and dropping a
method breaks compilation (internal/cli/dashboard_web.go:202-226). This removes
that requirement so those stubs can go.

Skills DECISION: Skills STAYS on the interface and the Learning page stays.
Knowledge and Chat were the only two surfaces whose gitmoot-side data is gone:
#2202 removed the memory brain and #1754 retired chat, so both can only ever
answer empty, and the Brain page additionally fetched /api/brain/events and
/api/brain/fact - endpoints this module never registered. Skills is different:
gitmoot serves it from a REAL implementation over the agent_templates /
agent_template_versions tables (internal/cli/dashboard_web_skills.go), 17
templates on the live dashboard, and campaign phase 3 (#2204) keeps both tables
and the dispatch read path while removing only template AUTHORING. A read-only
overview of live template versions is not dead, so removing the page would
delete a working view. Consequence: #2206's gitmoot-side work removes only the
Knowledge and ChatThreads/ChatThread stubs; Skills keeps its implementation.

Removed from the DataSource interface:
  Knowledge(ctx) (Knowledge, error)
  ChatThreads(ctx) ([]ChatThreadSummary, error)
  ChatThread(ctx, id) (*ChatThreadDetail, error)
Removed payload types: Knowledge, KnowledgeAgent, KnowledgeCluster,
KnowledgeFact, KnowledgeEdge, ChatThreadSummary, ChatThreadDetail, ChatMessage,
ChatRef, the ErrChatThreadNotFound sentinel, and ConfigAgent.ChatAutorespond
(gitmoot never populated it - projectDashboardConfigAgents does not set the
field, so it was permanently false on the Config page).
Routes removed: GET /api/learning/knowledge, /api/chat/threads, /api/chat/thread.
Kept and verified untouched: Tasks on the optional TasksDataSource, which backs
the "Needs a human" surface.

web/dist/index.html (-4262 lines): removed the Chat nav entry, the Brain nav
entry, their mobile tab-bar/more-sheet entries, the Chat three-pane page, the
Knowledge force-graph and Brain changelog pages, their CSS, their fetch calls,
the /chat, /chat/<id>, /brain and /learning/knowledge routes (now normalized to
Overview), the learning sub-tab machinery (one surface left), and the Config
page's dead "Auto-resp" agent column. Verified by serving the demo binary
(go run ./cmd/gitmoot-dashboard-dev) and driving a real browser: the nav rail is
exactly Overview/Tasks/Workflows/Jobs/Pipelines/Agents/Org/Galaxy/Charts/
Learning/Needs a human/Health/Config, every entry renders with a 200 on its API
call, zero page/console errors, and Galaxy, Charts, Tasks and Learning/Skills
all render.

fakefeed.go: dropped fakeKnowledge, fakeKnowledgeWithSubclusters,
fakeChatThreadDetails, fakeChatThreads, chatSnippet, the flatKnowledgeFixture
constructor variant (and the dev harness's -knowledge-flat flag) and the retired
[chat] config knob. Tests whose subject was a removed surface are deleted; every
surviving test keeps its real assertions.

Gate: go build ./... && go vet ./... && go test ./... all pass; gofmt clean.
…2206)

Follow-up to 9083235, same defect class as ChatAutorespond, one step later.

ConfigAgent.Memory is never populated by any real data source: #2202 deleted
config.AgentType.Memory, so gitmoot's projectDashboardConfigAgents
(internal/cli/dashboard_web_config.go:180-216) sets Name/Runtime/Model/
Capabilities/AutonomyPolicy/MaxBackground and nothing else. The Config page
therefore rendered a permanently-false "Memory" column and a "N memory-enrolled"
counter that only the fake feed could ever make non-zero. Removed the contract
field, the table column, the card badge, the section-meta counter, the now-unused
`bool()` cell helper and its four dead .cfg-bool CSS rules.

Also removed the fake Config fixture's [memory] knob section (9 knobs): gitmoot's
[memory] config section does not exist after #2202, so a demo advertising those
knobs documents a feature that cannot be configured. The multi-section ordering
assertion in TestHandleConfig is unweakened - [github], [orchestrate] and
[skillopt] remain, three sections in strictly ascending name order, so no
substitute section was needed.

[skillopt] is left alone: it is #1752 territory, not this campaign's.
Untouched for the same reason: the AGENTS surface's memory fields
(AgentSummary.MemoryEnabled, AgentConfig.Memory, AgentDetail.MemoryFacts /
MemoryObservations), which gitmoot also no longer populates - filed as a separate
finding rather than folded in here.

Gate: go build ./... && go vet ./... && go test ./... pass; gofmt clean.
Config page re-verified in a real browser against the demo server: per-agent
header row is Agent/Runtime/Capabilities/Policy/Max bg/Model (6 th, 6 cells in
every row), section meta reads "4 agents", and the sections rail is
Feature flags / Keychain / Github / Orchestrate / Skillopt / Per-agent / Unknown
with no Memory entry. Zero page/console errors.
Third and last of the brain leftovers in this module's contract, folded in so
Config and Agents tell the same truth: after 6225c5c the Config page no longer
claims anything about memory, while the Agents contract still served
memoryEnabled / memoryFacts / memoryObservations and config.memory that no real
data source can populate. One page truthful and its neighbour not is worse than
either state alone.

Removed: AgentSummary.MemoryEnabled, AgentConfigInfo.Memory,
AgentDetail.MemoryFacts, AgentDetail.MemoryObservations, and the fake feed's
fakeAgent.memory / .memFacts / .memObs fields and values. gitmoot populates none
of them - `grep -rn "MemoryEnabled|MemoryFacts|MemoryObservations|Memory:"
internal/cli/dashboard_web*.go` returns nothing - because #2202 deleted
config.AgentType.Memory and the memory tables the counts came from.

web/dist/index.html needed NO change, and that is the finding: no UI ever read
these three fields. All 36 "memor" hits at origin/main 68ef5a4 were Brain /
Knowledge page code (gone in 9083235) and the Config page's a.memory column
(gone in 6225c5c); `grep -c -i memor web/dist/index.html` is now 0. The
AgentSummary.MemoryEnabled doc comment claiming "the Agents page renders a small
'memory' chip for it" was stale - the chip does not exist. Verified by rendering
the pre-change tree and this one side by side: the Agents list rows and the
detail CONFIG block (runtime / model / concurrency / timeout / avg duration) are
identical, and neither shows a memory row, chip or count.

Tests, per the reduction rule:
  - TestHandleAgentMemoryWithConfig: DELETED. Its subject was the removed pair
    (MemoryEnabled implies a non-nil Config, plus a non-empty pool); stripping
    the memory assertions would leave only a duplicate config-non-nil check, so
    it is class 1, not class 2.
  - TestHandleAgents: memory block stripped (and the byName map it existed for).
    Still asserts name/runtime non-empty, exactly one Ephemeral rollup row, and a
    non-zero registered count.
  - TestHandleAgent: memory assertions stripped. Still asserts the template, its
    id, the config section, the pool knobs, the multi-line prompt body and the
    three-version history with its Current/canary markers.
  - TestHandleAgentNoTemplate: memory assertions stripped, and the "no config
    section" assertion kept (it was inside the same block).

Gate: go build ./... && go vet ./... && go test ./... pass; gofmt clean.
@jerryfane

Copy link
Copy Markdown
Collaborator Author

Agent: galaxy-review
Runtime: omp
Job: local-review-review-router-18d626248ba54b99-1

Decision: approved
Summary: Reviewed PR #139 at head 9756ec3 (diff vs base 68ef5a4). The narrowing is a clean cutover: Knowledge/Chat removed from the DataSource interface, mux routes, handlers, sentinels, fakefeed fixtures, dev-harness flag, and tests; six memory/chat contract fields dropped from AgentSummary/AgentConfigInfo/AgentDetail/ConfigAgent; index.html sheds the brain/chat surfaces with no reachable leftovers. CGO_ENABLED=0 go build/vet/test all pass; live dev-server probes confirm surviving endpoints serve correct JSON and removed fields are absent from the wire. On the requester's three points: (1) keeping Skills REQUIRED is correct — the Skills read surface still exists in this UI and gitmoot serves it from surviving agent-template tables; the sibling PR removes authoring, not the read path, and the interface comment at datasource.go:1201-1205 documents exactly this; (2) the six field removals are acceptable for a single-consumer module — all were omitempty (silent wire removal) and the interface method drops are already breaking, so deprecation buys nothing for a consumer updating in lockstep under gitmoot#2206; (3) hunted index.html beyond the 13 nav entries — router table, mobile more-sheet, pull-to-refresh selector lists, nav-group/section maps, every generated href, all 108 template bindings, all this._x() call sites, and all queried DOM ids resolve to surviving code; stale deep links (/brain, /chat/*, /learning/knowledge) normalize to '/' gracefully. One informational note: removed API endpoints return the SPA index.html (200) rather than 404 — consistent with the pre-existing unknown-path fallback, and a stale JSON consumer fails on parse either way. No prior verdicts exist for PR #139. Browser-based visual sweep was not possible (sandbox EACCES spawning Chrome); substituted systematic static verification plus live API probes against the fake feed.

Findings

  • P3
    • detail: Removed endpoints /api/learning/knowledge, /api/chat/threads, /api/chat/thread now return 200 with text/html via the SPA fallback rather than 404. Consistent with existing unknown-path behavior and harmless for the single consumer (gitmoot updates in lockstep); a stale JSON client fails on parse either way. Informational only — no change needed.
    • file: server.go:85-105

Tests Run

  • CGO_ENABLED=0 go build ./... -> exit 0 (plain go build fails on sandboxed /usr/include/stdc-predef.h EACCES, unrelated to PR)
  • CGO_ENABLED=0 go vet ./... -> exit 0
  • CGO_ENABLED=0 go test ./... -> ok github.com/gitmoot/gitmoot-dashboard 0.153s (79 test funcs across api/server/datasource/sse)
  • go run ./cmd/gitmoot-dashboard-dev -addr :18099 + curl probes: /api/learning/skills 200 JSON with templates; /api/agents 200 with zero memoryEnabled keys; /api/config 200 with sections [github, orchestrate, skillopt] and no memory/chat_autorespond agent keys; /api/agent/researcher 200 with no memoryFacts/memoryObservations/memory fields; /api/learning/knowledge, /api/chat/threads, /api/chat/thread?id=x -> 200 text/html SPA fallback (route removal confirmed)
  • index.html static verification: new Function() syntax check OK; 108/108 {{bindings}} resolve to defined handlers/state; all this._x() call sites defined; all 91 queried DOM ids exist; all 18 fetch() endpoints map to registered mux routes; zero matches for knowledge|chat|memory|brain; all generated hrefs target surviving routes

Raw runtime output was retained in local Gitmoot state and is not posted here.

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.

1 participant