Closes archie-core-1786637499114 (persistent session-memory curator),
the last open item in the curator engine epic.
docs/prds/session-memory-curator.md records the decisions this needed
before coding, most notably: Observation.Identity is the session ID,
not a user or cross-session identity. migration-decisions.md#5's
memory-scope mapping (global/agent-wide/user-wide/agent-user
relationship) is still explicitly open, and this issue has no business
deciding it unilaterally -- session-as-identity is the narrowest
unambiguous scope available today and is forward-compatible with a
later, properly-decided identity resolution.
curator gains ConversationSource (RecentSessions/Messages), gated in
Registry.validateDeclared/filter exactly like Skills/MemoryEngines, plus
Manifest.Conversations. internal/infrastructure/sessioncurator/adapter.go
adapts gateway.SessionStore's full CRUD/branch/search surface down to
those two read-only methods -- curator must not import gateway.Message,
so role derivation (message.From == botUser -> assistant) is copied from
gateway.compressTurnHistory's existing logic, not shared.
sessioncurator.go: Check is a cheap RecentSessions bool. Pass takes each
session's last 40 messages, asks the model for a JSON array of durable
facts (capped at 5/session), and writes each through
Registrar.MemoryEngines.Get(name) -- resolved by name at call time, the
same trust model every other curator capability already uses. A
response that fails to parse degrades to "nothing extracted" for that
session (not a Pass error); a real model-call failure propagates as one
(these were originally conflated into the same swallowed-error path --
caught by TestPassPropagatesALLMFailure, fixed by splitting the model
call from the parse step). PassInput.Since zero resolves to a 24h
lookback, not the beginning of time, so a cold-start first pass can't
read a session's entire history.
Manifest.OnInput = true wakes it via the existing WakeOnPrimaryInput
wiring (events.KindTurnCompleted), which already excludes every
curator-derived event kind from the forwarded set -- the trigger-
accounting invariant (archie-core-1786637489768) needed no new code to
hold here.
Wired into bootstrap.go:setupCurators via a new curatorLLMRunner adapter
(main.go) over the shared ai-sdk runtime, and sessioncurator.NewAdapter
over b.chatSessionStore/b.cfg.BotUser. Model resolves from
b.chatModels.ActiveModel() -- not b.defaultChatIdentity, which names a
task-routing identity, not a model reference (the same source
telegram_setup.go's sendChatTurn already uses for a real chat turn).
task check is green (full Go suite + dashboard tests).
Part of archie-core-1786637499206 (skill curator reference
implementation), under the curator engine epic.
docs/prds/skill-curator.md records the design decision this needed
before coding (no settled design existed for what "review, prune, and
improve skill definitions" means as concrete Pass() behavior): v1 is
mechanical validation and safe whitespace normalization only. No
LLM-authored rewrites of skill content, no automatic deletion -- an
autonomous process editing or deleting a user's skill has no undo path
today, and the epic's actual purpose for this issue is proving the
curator contract holds for a second, structurally different consumer
(files-as-skills vs. observations-as-memory), not solving "what makes a
skill good."
internal/infrastructure/skillcurator/store.go: a curator.SkillStore
implementation over one root's .agents/skills/*/SKILL.md files. Not
internal/skill.Discover directly -- Discover parses every skill up front
and fails the WHOLE call if any one of them doesn't parse (correct for
"load the catalog to boot the daemon", wrong for "review each skill and
report what's wrong with it individually"). This store lists/reads raw
bytes per skill; the curator itself parses each one so one bad skill's
parse failure becomes one Action, not an aborted pass.
internal/infrastructure/skillcurator/skillcurator.go: the CuratorEngine.
Check is a cheap directory-listing bool. Pass classifies each skill into
exactly one of: skill.invalid (frontmatter parse failure, left
untouched), skill.incomplete (missing required name/description,
untouched), skill.normalized (trailing whitespace / missing final
newline, written back), or nothing (already clean). Manifest declares
only Skills -- no Tools, no MemoryEngine -- since nothing here needs
either.
Wired into internal/app/archied/bootstrap.go:setupCurators, rooted the
same way loadWorkflows already resolves skillsBase (cfg.SkillsDir falling
back to cfg.WorkDir) -- one local root, not the full multi-root catalog a
chat turn reads. Skills is now a shared registrar-level service
(alongside Events/MemoryEngines), narrowed out of a curator's view by
registry.filter when undeclared, same as every other capability.
task check is green (full Go suite + dashboard tests); go test ./...
is green.
Closes archie-core-1786637499161-356-e424e40d.1.
setupMemory's own doc comment claimed external providers are added via
RegisterExternal when cfg.Memory.Provider is set -- no such call
existed. Investigated wiring it for real: there is no external
MemoryProvider implementation anywhere in the repo to construct and
register (only internal/memory/builtin.Provider exists), so there is
nothing to route memory.provider's value to yet. Wiring the call would
be dead plumbing to nothing, not a fix.
The actual defect is that setting memory.provider has always silently
done nothing -- an operator who set it reasonably believed they
configured something. validateMemory now rejects it outright with a
clear reason, turning a silent no-op into a loud one at config load,
same failure-loudly posture as every other unimplemented-value check in
this file. Drop the rejection once a real external provider (or the new
domain/memory engine family's Honcho proof, archie-core-1786637492031)
gives the field an effect again.
Updated setupMemory's doc comment and config.example.toml to match --
the provider_config example is removed too, since it has nothing left
to configure.
Closes archie-core-1786637499636 (bind curators to memory engines).
curator.Registrar gets MemoryEngines, a MemoryEngineSource
(Get(name) (domainmemory.MemoryEngine, bool)) mirroring
domain/memory.Registry.Get's exact signature so the real registry
satisfies it with no adapter. Registration enforces presence the same
way Tools/Skills already do: a curator declaring Manifest.MemoryEngine
with no MemoryEngineSource on the host is rejected at Register, and
filter() clears MemoryEngines from a curator's view when it declared no
engine. A curator with a declared name that turns out not to exist in
the registry is not this layer's problem -- Get(name) at call time
returns false, same as ToolBuilder.Build with an undeclared tool.
Resolution is by name at call time, not a value pre-fetched at Bind: a
curator calls MemoryEngines.Get(its own Manifest().MemoryEngine) itself,
the identical trust model ToolBuilder.Build(ctx, declared) already
uses -- the curator is trusted to pass its own declared identifier, not
handed something pre-scoped to it. Swapping the configured engine (a
different name resolving through the same registry) changes where a
curator's memories land with no change to the curator itself, since
nothing about the curator's own code names a concrete engine.
setupCurators wires b.memEngines (*domainmemory.Registry, set by
setupMemoryAll which Run() calls first) straight in -- it already
satisfies MemoryEngineSource.
A curator declaring no memory engine remains valid (existing behavior,
now also covered by the "nothing declared" and "no source" table
cases) and is only ever affected by a memory operation it never has the
means to attempt, since MemoryEngines is nil in its view.
Completes archie-core-1786637499480 (ship the file-writing store as
the default memory engine): cfg.Memory.Engine now actually selects and
starts an engine, closing the gap the previous commit's message called
out as remaining.
setupMemoryEngine builds a domain/memory.Registry, registers
infraMemory.BuiltinEngine for "builtin" (and the empty/unconfigured
case, matching applyMemoryDefaults' resolution) rooted at
workDir/memory-engine -- separate from the legacy provider's
workDir/memory, so the two can never collide on the same files while
both exist -- starts the registry, and stops it on daemon shutdown.
cfg.Memory.Engine is already validated against the same set at config
load (configuration.validateMemory), so the switch's default case only
guards the two lists drifting apart, not live operator input.
setupMemory and setupMemoryEngine are both called through a new
setupMemoryAll from Run(), which was already at its cyclomatic
complexity budget -- a genuine grouping (both are memory-subsystem
startup), not two unrelated steps merged just to hit a number.
setupMemoryEngine deliberately does not thread Run()'s ctx through to
registry.Start, matching setupMemory's own existing choice for the same
reason (Start is a synchronous startup step, not a subscription that
needs the daemon's lifetime the way setupCurators' WakeOnPrimaryInput
does) -- also what avoids a contextcheck trip that threading ctx through
setupMemoryAll produced during development.
Not yet done: internal/memory.Manager (the live system-prompt/tool-call
path) does not read through this registry -- the two memory systems run
in parallel, per archie-core-1786637490069-11-e245c170's explicit "do
not extend the legacy system in place" scoping. That convergence is
future work, not part of this issue.
Part of archie-core-1786637490043 (config surface for memory engine
selection and settings).
config.MemoryConfig gets an Engine field selecting among the
domain/memory engine family, plus toml tags on every field -- Provider,
ProviderConfig, and SessionTTL had none before, yaml/json only, which
didn't match repo convention.
Engine and Provider are kept as two separate fields rather than one:
they select between two different mechanisms (the new engine family vs.
the legacy external-provider path, archie-core-1786637499161-356-e424e40d.1),
and conflating them would mean a value meant for one silently getting
read by the other once both are wired.
applyMemoryDefaults resolves an absent engine to "builtin" so
unconfigured and explicitly-builtin are the same state everywhere after
defaulting. validateMemory rejects an unrecognised engine name in the
same style as forge.type's existing validation -- named constant list,
"%w: field %q (want %s)" shape, wired into the same validate() chain.
config.example.toml documents the new field.
Not yet wired to anything: nothing reads cfg.Memory.Engine at daemon
boot yet to actually select and start an engine through
domain/memory.Registry. That's bootstrap wiring, tracked as the
remaining half of archie-core-1786637499480 (ship the builtin store as
the default engine).
Part of archie-core-1786637499480 (ship the file-writing store as the
default memory engine).
Records the missing design decision first (migration-decisions.md#5,
"authoritative memory record and revision model" was explicitly open):
internal/memory/builtin.Store addresses blocks by content substring with
no stable per-block ID, which the new Record{ID}/Forget(id) contract
needs. Decided and implemented: an ID assigned once at Write via a
leading `<!--mem:<uuid>-->` marker line, stripped back out of
Record.Content on read, located by that marker (not content) for
Forget -- so an unrelated edit can never orphan a Forget. Identity maps
to a directory named hex(sha256(identity)), not the identity string, so
an arbitrary identity can never traverse outside the configured root.
Kind maps to a builtin section name via the store's own
ValidateSectionName, so an invalid Kind fails the same way an invalid
section already does.
internal/infrastructure/memory.BuiltinEngine wraps one builtin.Store per
identity and implements domain/memory.MemoryEngine end to end
(Write/Query/List/Forget, Lifecycle, Manifest). Lives under
internal/infrastructure per organisation.md ("infrastructure implements
domain contracts"), not internal/domain/memory, which stays
contract-only.
internal/memory/builtin is untouched -- confirmed via git status and its
own test suite passing unmodified, per this issue's acceptance
criterion. This engine is not yet wired into daemon bootstrap or the
config surface (archie-core-1786637490043); it proves the contract
holds for the builtin store the same way curator's reference
implementations prove the curator contract, and registers/runs cleanly
through domain/memory.Registry (TestBuiltinEngineRegistersAndRuns
ThroughTheRegistry).
Part of archie-core-1786637490069-11-e245c170 (memory engine contract
and owning registry), under epic archie-core-1786637499161 (pluggable
memory engine).
Stands up internal/domain/memory as a conforming engine family per the
strict plugin engine rule, mirroring internal/domain/curator's split
exactly as that issue's notes specify:
- contract.go: MemoryEngine (Lifecycle + Store + identity + Bind), with
Store carrying the real domain operations the epic requires --
Write/Query/List/Forget -- not just Name/Version. Store is split out
from MemoryEngine so the interface stays under golangci-lint's
interfacebloat threshold the same way curator's embedded Lifecycle
does: an embedded interface counts as one slot, not its expanded
method count.
- registrar.go: narrow typed host access (EventSink, Clock). No
capability-gated fields yet -- unlike curator's Tools/Skills, no
memory-specific host service exists to gate on today, so Registry.Bind
passes the host straight through rather than filtering.
- registry.go: Register/Get/Names/Start/Health/Stop with the same
duplicate/nil/panic/failure-isolation guarantees as curator's registry,
ctx-bounded Stop, reverse-order shutdown.
This is the contract only -- no engine implements it yet, and
internal/memory's existing ad-hoc MemoryProvider/Manager (pre-migration)
is untouched, per the issue's explicit "do not extend in place" note.
Closes archie-core-atv2.
Media delivery is fire-and-forget with a 30s budget, far longer than
the turn's text usually finishes -- so a large upload failing (or
timing out) after doFinalize has already retired the renderer goroutine
is the normal case, not an edge one. appendFallbackLine was still
writing into toolLines and calling requestRender, a non-blocking send
into a channel nothing reads any more once stopRendering has returned:
the line was silently dropped and the finalized message stood
unchanged, with nothing telling the user or the agent the file never
arrived.
stopRendering is the single point every finalize/abandon path funnels
through to retire the renderer, so it's the right place to mark the
reply finalized. appendFallbackLine now checks that flag and, once
set, sends the fallback as its own follow-up message instead of
appending to a buffer nothing will render again.
Two bugs behind the "System statusEverything is operating normally."
render:
1. Consecutive plain lines with no blank line between them were joined
into one paragraph's text with an embedded "\n". Telegram's
rich-block paragraph does not render an interior "\n" as a break --
it renders nothing, so the words ran together with zero separator.
Join with a space instead: the correct rendering of a CommonMark
soft line break anyway, and it survives regardless of how the
client treats a literal "\n".
2. Telegram's renderer adds no vertical gap between adjacent blocks on
its own -- only a heading carries its own margin -- so a label line
immediately followed by a list (or any two non-heading blocks back
to back) rendered touching, with the list's first item glued to the
preceding text and no visible line break at all. appendBlock now
inserts an empty spacer paragraph before any block that doesn't
follow a heading, making the gap explicit instead of depending on
client-side spacing that isn't there.
Reproduced directly against markdownToBlocks with the reported input
and confirmed the fix before writing this up.
"Treat this as UNCONFIRMED, not complete" is developer-speak in a
message an operator with no codebase context has to act on. Reword to
plain instruction: say what's known, then what to do about it.
CodeQL's Go analyzer (go/uncontrolled-allocation-size, alert #6) can't
trace min(limit, MaxTailLines) as a bound on the request-derived limit
before make([]Entry, 0, limit). The clamp was already correct and has
been in place since 48133e6 -- confirmed by rescanning at current HEAD,
the alert still fires -- so this is an analyzer gap, not a live bug.
Same clamp, written as an explicit if so static analysis (and readers)
can verify the bound directly.
-X main.gatewayVersion/main.runtimeVersion targeted package main, but
those vars live in internal/app/archied (cmd/archied is a thin
wrapper). An -X target that doesn't exist is silently ignored by the
linker, so every archied binary this shipped -- task build, install.sh,
Dockerfile.archied, and the carina self-update script -- reported
"dev" instead of its real version. Point every one of those ldflags at
the actual package.
Also, while chasing the carina incident this surfaced:
- restart.go: /restart didn't check for an in-flight /update install.
The install runs as archied's own child process, so a restart killed
it mid-build (observed: "signal: terminated") instead of letting it
finish or fail cleanly. Refuse the restart while updateInProgress.
- update.go / update_report.go: the "no version could be confirmed
running" branch still opened with "Update complete", contradicting
its own next clause. Reworded so an unverified outcome isn't
reported as completion.
- mcp client_test: assert both initialize handshake calls happened and
notifications/initialized has an empty ID, not their exact order
- telegram model_test: assert the resolved model has an openrouter/
prefix instead of scanning button text for the string; replace the
single-hardcoded-count pagination test with cases covering 0/1/8/9/100
models so pageBounds and nav-row logic are actually exercised
- webui api_chat_test: assert the actionable file path is present in the
streamed error instead of matching generic wording
Implements archie-core-h019.3 (reviewer isolation) and h019.4 (wiring),
per docs/prds/adversarial-self-review.md.
- internal/domain/workflow: new Reviewer interface and StageReview,
inserted between StageDiffCap and StageOpenPR in the implement
workflow. Fail-closed: a review that didn't run, or a confirmed
error-level finding, parks the task (store.StatusParked) with
findings in Detail; warn/plausible findings never block. Inert
unless Repo.ReviewEnabled.
- internal/worktree: Manager.Snapshot exports HEAD's tracked files into
a fresh directory with no .git, for the reviewer's isolated
workspace. Trees interface gains Snapshot; hybridTrees delegates to
it.
- internal/app/agentworker: subagentReviewer implements Reviewer using
ai-sdk's agent.Subagent (nested, in-process, non-streaming
generation) -- conversation isolation is structural (Subagent.Run
never carries message history), workspace isolation is the snapshot
above. The reviewer's toolset is read-only (read/grep/find) rooted
at the snapshot, never the worker's own toolset, so it cannot reach
the worktreerpc publication grant. Findings are captured via a typed
record_finding tool appending to a slice the stage owns, read even
when Subagent.Run errors (a truncated run's captured findings
survive).
- internal/config: Repo.ReviewEnabled (default false) and
Models["reviewer"] (falls back to Models["builder"], no schema
change).
Judgment calls: Reviewer.Review never returns a Go error -- every
failure folds into ReviewReport per the PRD's fail-closed contract,
which the stage can act on uniformly. A Subagent.Run error with zero
captured findings resolves to ReviewStatusNotRun (park); a
Subagent.Run error with >=1 captured findings resolves to
ReviewStatusCompleted with those findings, since the PRD's own example
("three defects survive a step-limit truncation") requires them to
still be evaluated for blocking rather than discarded.
- tomlwrite.go: split Apply into collectPending + an applier struct
(indexTables/resolveTable/matchActiveKeys/uncommentKeys/
appendMissingKeys/render). gocognit 82 -> under threshold.
- find.go: split findWalkVisitor's closure into findSkipEntry/
findMatchesFilters. gocognit 46 -> under threshold. This clears the
last complexity finding from archie-core-agui's original 31.
- richblocks.go: go fix modernization (strings.SplitSeq).
Behavior-preserving.
markdownToBlocks's nested closures over shared mutable state become
methods on a markdownBlockParser struct; blocksToPlainText's list/quote
cases become listBlockPlainText/quoteBlockPlainText. gocognit 37 -> under
threshold for both. Behavior-preserving.
turn.go: extract checkConfigured, replayPriorReply, claimTurn,
recordInboundMessage, prepareTurn, generateAndComplete out of Run
(gocognit 53 -> under threshold, gocyclo brought under 20 then under
cyclop's 15 too).
gateway.go: split dispatchLocal's second half into dispatchLocalMisc
(cyclop 18 -> under 15, on top of the earlier gocyclo fix).
Behavior-preserving; internal/gateway lint clean.
gocognit 70 -> under threshold. Behavior-preserving: same request
fields, same guardrail/validate/persist/deliver sequence, just named
steps instead of one closure.
- toolset.go: extract requireApproval out of toolExecute (nestif)
- gateway.go: extract handleDeny/handleVersion/handleUpdateCheck/
handleRestartAdapter out of dispatchLocal (gocyclo 26 -> under 20)
- cronstore/store.go: extract applyPatch/applyScheduleChange out of
Update (nestif, gocognit)
Behavior-preserving.
Second architecture test (after contract_test.go) that still grepped
cmd/archied for wiring strings following the cmd/archied ->
internal/app/archied extraction. task check now passes clean.
Extracts focused helpers out of applyEdits, grepFallback/grepDirFallback,
serveReadContent, handleChatStream, TDD, runFindGoFallback,
makeGrepExecutor and makeShellExecutor to bring them under the
project's cyclop/gocognit/funlen thresholds. Behavior-preserving.
Partial pass on archie-core-agui: richblocks.go (gocognit),
gateway.go dispatchLocal (gocyclo), and a couple of remaining
gocognit/nestif findings are left for a follow-up.
- migration-decisions.md: confirm curator/mapping/scheduling as
legitimate domains that were never added to the confirmed list;
document identity/agent/messaging/plugin as approved-but-unmaterialised
targets rather than creating dead stub packages.
- Resolve the open Session/Messaging decision (section 2): keep
internal/gateway as-is rather than risk a big-bang rewrite of live
session/compression/approval/branch logic; materialise
internal/domain/messaging with the already-settled canonical
Message/Conversation/ToolCall/ToolResult types. Actual gateway
migration onto these types is tracked as sequenced follow-up bd
issues (label messaging-migration).
- ARCHITECTURE.md: add internal/gateway, internal/tools, internal/memory,
internal/secret, internal/plugin, internal/skill to the Package Map.
Paths and String were value receivers alongside the mutating record()
pointer method. All Provenance uses are through addressable struct
fields, so this is behavior-preserving.
Replaces hand-written JSON Schema + manual unmarshal with
core.NewTypedTool[In], now available at the pinned ai-sdk v0.1.30. This
removes the class of bug where a hand-rolled schema drifts from the
struct a manual decode unmarshals into.
Follow-up to the cmd/archied -> internal/app/archied wiring extraction:
the architecture test that greps main.go for required wiring strings
still pointed at the old cmd/archied path.
Test TestPluginEngineRuleIsCanonicalAndSharedByAgentInstructions was
missing entirely, letting CLAUDE.md drift out of sync with
ARCHITECTURE.md#plugin-engine-rule-strict. Added the test and the
missing reference.
Funcs() was passed a *strings.Replacer value instead of its Replace
method, panicking gateway's init(). Fixing that surfaced a second bug:
the template still referenced .Operator, removed from promptData by
5a92fc1, which made every render fail and silently fall back to a
generic hardcoded prompt.
Also replaces a real Telegram chat ID hardcoded across several test
fixtures with a placeholder value.
Slice 1 of the cron/scheduling epic (archie-core-1786637496320-249-be6d9a20).
Implements the file-backed job store the scheduling ticker engine polls
through scheduling.JobSource. The engine applies no schedule arithmetic
of its own, so the store owns cron expressions, fixed intervals, and
catch-up windows — Slice 1 ships Interval fully, with Once accepted at
Create/fired at Due, and Cron reserved as a wire shape for Slice 2.
Files: per-profile JSON at <path>/jobs.json with a version-stamped
schema. CRUD by job id with merge-semantic Update (nil Patch fields are
preserved). Truncated/partial-write files return ErrCorruptFile; forward
schema versions return ErrUnsupportedSchema. DisallowUnknownFields means
additive shape changes must bump schemaVersion.
Concurrency: three locks stack in fixed order. (1) A package-level
mutex keyed by lock-file path serialises Stores within one process —
Linux flock is per file description, so two Store instances in the
same process have independent fds and would otherwise proceed in
parallel. (2) Cross-process flock serialises Stores across processes
(CLI vs daemon). (3) s.mu guards the in-memory mirror. Every
operation re-hydrates from disk before applying its change so a writer
that just acquired the locks sees every change the previous writer
committed. Atomic write via temp-file + rename + fsync for durability.
Validation: Create and Update validate Pool, Schedule, and required
fields up front so a hand-edited file cannot persist a job the engine
cannot reason about. MarkRun on a kind without next-run arithmetic
returns ErrScheduleUnsupported. Get/List return deep copies so caller
mutation cannot corrupt the in-memory mirror. Files are written 0o600
because payloads can carry operator-identifying data; SetEscapeHTML(false)
keeps operator-readable files human-friendly.
Add a small bounded activity tracker (activityTracker, in
internal/domain/curator/activity.go) fed directly from the runtime's
existing emitRun point: last-run time, last-run action count, and up to
20 recent actions per curator, newest first. No persistence layer -- it
resets on restart, same as the rest of the runtime's in-memory state.
Registry.RecordActivity/Activity expose it.
Closes archie-core-1786637489932-6-1f803e02.
go-telegram/bot v1.24.0 fixes getUpdates to honour Telegram's retry_after
on a 429 instead of its own 100ms-doubling-to-5s backoff (release notes:
https://github.com/go-telegram/bot/releases/tag/v1.24.0). pipelineErrorHandler
was our workaround for that upstream gap -- it now just logs.
The web chat is now a persistent slide-over drawer available on any page
(not just the /chat route), and the agent is told which dashboard page the
operator is on so it can point them to the relevant page with a clickable chip.
Backend (gateway):
- Message gains a per-message Page field; the system prompt renders it in
the <env> block (Current page), so Archie knows where the operator is.
- New dashboard_tools.go: a DashboardPages registry plus two web-only tools
— page_index (lists every page and what it shows) and dashboard_navigate
(validates a path, returns {path,label}; rejects unknown/empty paths).
- The web chat sink emits a dedicated navigate stream event when the model
calls dashboard_navigate, independent of ShowToolCalls.
Frontend (webui):
- chat sends currentPage() (location.hash) with each stream request; a
dashboard_navigate result renders as a clickable link chip (href=#/path).
- The chat is mounted once in a slide-over drawer with a topbar launcher,
scrim and Esc-to-close; /chat opens the drawer instead of a second page.
- ui/dist rebuilt (committed) with the bundled changes.
- .gitignore: ignore .impeccable/ (impeccable tool critique snapshots).
New capability (per scope discipline): designed in
docs/prds/dashboard-aware-chat-navigation.md.
Tests: dashboard_tools_test (registry, resolve/reject, web-only gating),
prompt page-line cases, webui Message.Page + navigate-frame capture, and
chat-tools chip tests. task check is green.
Telegram's rich-message Markdown has no ATX heading support and its MarkdownV2
dialect needs escaping, so hand-building a Markdown string and sending it as
myMarkdown showed literal heading/code markers and mangled unescaped characters.
The previous fix layered blank-line insertion on top of a dialect that could
not render headings at all.
Replace the whole markdown-string pipeline with structured InputRichMessage
blocks: markdownToBlocks emits SectionHeading, Preformatted, List, BlockQuotation
and Paragraph (inline emphasis/code/links reduced to plain text so no marker can
leak), blocksToPlainText feeds the fallback send, and splitBlocks chunks at block
boundaries. sendBlocks, open, edit and the live renderer now send myBlocks.
Delete the dead string surgery (normalizeTelegramText, telegramMarkdown,
telegramPlainText, splitLongMessage, the fence-split cluster and their regexes)
and the tests that pinned it, removing about 1100 lines. splitBlocks and the
parser are unit-tested.
Archie owns the status and action vocabulary in internal/taskstate, but the
dashboard had to keep a hand-synced copy of the display labels, pill severities
and action confirm prompts -- so a new status or action silently rendered
wrong until someone edited the frontend.
- add taskstate.Statuses() and taskstate.ActionCatalog() so the rules and their
presentation live in one place
- expose GET /api/task-meta returning {statuses, actions}
- add a client base/task-meta.js that fetches the catalog and exposes
statusLabel/statusKind/statusIds/attentionStatusIds/actionFor, with a
freeze-dried default snapshot so the dashboard renders instantly and keeps
working when archied is unreachable
- tests for the catalog, the endpoint and the client accessors
An operator could only reject work that was waiting on a human decision, so a
task sitting in review (PR open) or running had no way to be refused even
when it was clearly dangerous.
- expose reject in taskstate.Actions for every non-terminal state (queued,
running, waiting_human, parked, pr_open) so both the dashboard and the chat
tool surface it; terminal states still only expose archive
- make rejectTask transition from the task's actual status to closed_wont_do
and interrupt running execution first, so nothing keeps working against a
task being closed out
- keep the distinct stop (recoverable → parked) semantics; reject is the
terminal escape hatch
- update the lifecycle contract tests to the new intent
- insert blank lines around ATX headings and list blocks so Telegram does not
collapse them into the surrounding paragraph
- leave the SDK's compact triple-backtick tool fences unstyled (do not re-space)
- strip Markdown syntax when the rich send/edit falls back to plain, so the
user never sees raw '#', '**', backticks or link brackets
- log telegramRenderVersion + mode on every outgoing message