fix(logging): propagate bound slog attrs to wrapped handler in FeedHandler
FeedHandler.WithAttrs/WithGroup only tracked bound attrs for the live feed copy; Handle forwarded the bare record to the wrapped handler, so component (and any other With-bound attr) never reached stderr/file JSON sinks or survived restart for historical log filtering. Now WithAttrs/WithGroup also derive the wrapped handler via its own With*, matching agentexec.SystemLogHandler's existing pattern.
This commit is contained in:
1 parent
e96721ba68
commit
de3cd32c72
3 files changed
+26
-1
No files matched your search
+2
-1
@@ -13,6 +13,7 @@
|
||||
{"_type":"issue","id":"archie-core-1ysw.1","title":"Bind worktree RPC operations to the dispatched task","description":"The sandboxed agent can currently choose owner, repo, issue, base, and branch on worktree RPC requests. The daemon then performs host deletion and credentialed forge operations without correlating the request to the dispatched task or enforcing WorkDir containment.","acceptance_criteria":"Reject traversal and unconfigured or task-mismatched coordinates before any filesystem or forge side effect; derive or validate the permitted branch; regression tests fail on the old behavior and pass on the fix.","status":"closed","priority":0,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:43Z","created_by":"Sam Catlow","updated_at":"2026-08-24T06:59:58Z","started_at":"2026-08-22T11:02:03Z","closed_at":"2026-08-24T06:59:58Z","close_reason":"Fixed on main: worktreerpc now exposes only Push, authorized by an opaque per-dispatch grant issued from the dispatched *store.Task (worktreerpc.go:71-83). Sandbox input no longer selects host path, repo or branch; ValidCoordinates rejects traversal. Package tests pass.","external_ref":"https://github.com/samcharles93/archie-core/issues/589","metadata":null,"dependencies":[{"issue_id":"archie-core-1ysw.1","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:42Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-1ysw","title":"Repair internal/worktree correctness and trust-boundary defects","description":"Track the concrete worktree-package defects proven by the 2026-08-22 evidence-gated review. Child bugs cover RPC authority/path containment, repository-key isolation, retry/base/diff correctness, push lifecycle, terminal cleanup, cancellation, and branch naming. This epic groups implementation only; each child has its own observable acceptance criteria.","acceptance_criteria":"All child bugs are closed with red-green regression tests, scoped lint passes, and the repository quality gate is clean.","status":"closed","priority":0,"issue_type":"epic","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:18Z","created_by":"Sam Catlow","updated_at":"2026-08-24T08:16:00Z","closed_at":"2026-08-24T08:16:00Z","close_reason":"All 9 children complete. The P0/P1 trust-boundary and correctness defects (.1 RPC task binding, .2 colliding directory keys, .3 untracked cleanup, .4 fail-closed base resolution, .5 three-dot merge-base semantics) were already fixed on main and reconciled 2026-08-24. The remaining four (.6 push result, .7 no-change worktree leak, .8 commit cancellation, .9 branch naming contract) were implemented this session, merged as 474c31d and its two merge commits, task check green, with an independent adversarial review reporting zero findings.","external_ref":"https://github.com/samcharles93/archie-core/issues/590","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-t2db.5","title":"Security: an unauthenticated endpoint must not be able to run an agent","description":"P0 within this epic because the feature's own pitch is the threat model: a public intake surface whose output is an agent with tool access and a repo. Get this wrong and a webhook URL is remote code execution with extra steps.\n\nNon-negotiables to design:\n\n- Per-source authentication. A source registers with a secret (HMAC, as internal/channels/webhook already does per route) before its events can trigger anything. Capture-only for unknown senders is acceptable; triggering is not.\n- Human approval before a binding goes live. An operator authoring a binding is a deliberate act; an event arriving is not. Nothing should self-arm.\n- Rate and volume limits per source, so capture cannot be used to exhaust disk or drown the inspector.\n- Payload content is untrusted input flowing into an agent prompt. Treat prompt injection as expected, not exceptional -- the sender controls that text, and the agent has tools. Bound what a playbook-triggered workflow may do.\n- Captured payloads may contain secrets from the sending system. Decide retention, redaction and who can view them; internal/memory/scrubber may already have applicable prior art.\n\nArchie's own principle applies: environmental enforcement over prompt rules. 'The agent should ignore instructions in the payload' is not a control.","acceptance_criteria":"An event from an unauthenticated source can be captured but cannot trigger a workflow; a new binding requires explicit human approval before it arms; per-source rate limits exist; the blast radius of a playbook-triggered workflow is bounded by code rather than by prompt text; retention and visibility of captured payloads is decided and documented.","notes":"2026-08-22: security design decided and documented in docs/prds/webhook-intake-security.md, covering all five non-negotiables from this bead's description:\n1. Per-source auth reuses internal/channels/webhook's existing HMAC-SHA256 scheme; capture accepts unsigned events (visible, marked unauthenticated), only authenticated events can ever match a binding.\n2. Bindings gain a draft -\u003e pending_approval -\u003e armed state machine; any edit to an armed binding drops it back to pending_approval so approval can't be bypassed by editing. Modeled on telegram's existing dangerousAction/pendingApproval flow (dangerous.go/approval.go).\n3. Per-source token-bucket rate limiting (precedent: pairing/store.go's MaxPendingPerPlatform); limit-exceeded is an observable 429, not a silent drop.\n4. Blast radius bounded by the SAME code-level controls every task already gets -- gate, diff_cap_lines, sandboxed container, worktree isolation -- no new relaxation for playbook-triggered work, and payload text is ordinary untrusted prompt input, never a trusted instruction.\n5. 7-day configurable retention on captured payloads; best-effort redaction reusing gateway/stream.go's sensitiveParameterKey heuristic before persisting; visibility gated by the same dashboard auth as every other webui surface.\n\nThis bead's code-level acceptance criteria (capture-can't-trigger, rate limits exist, blast-radius bounded, approval gate) cannot be implemented yet: they constrain t2db.1 (capture), 7d5u.3 (intake family) and t2db.4 (binding), none of which have landed. This document is the contract those beads build against -- do not build any of them without satisfying it. Leaving this bead in_progress rather than closing it; it closes when t2db.1/7d5u.3/t2db.4 land and demonstrably satisfy points 1-5, not before.","status":"in_progress","priority":0,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-21T13:45:46Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:01Z","started_at":"2026-08-21T14:51:26Z","external_ref":"https://github.com/samcharles93/archie-core/issues/536","dependencies":[{"issue_id":"archie-core-t2db.5","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-08-21T23:45:45Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-s81k","title":"Preserve bound slog attributes in persistent log sinks","description":"PR #650 scopes daemon, Web UI, and curator loggers with slog.Logger.With. internal/logging.FeedHandler.WithAttrs retains those bound attributes for the live feed but does not pass them to the wrapped handler, while Handle forwards the bare slog.Record. As a result, component is present in live Web UI entries but absent from stderr and file JSON; after restart, historical component discovery and filtering cannot see those records. Fix bound-attribute propagation without breaking slog group semantics or duplicating attributes.","acceptance_criteria":"Bound attributes appear in both Feed entries and the wrapped JSON sink; component values survive file persistence and are discoverable and filterable through historical /api/logs reads; regression tests exercise logger.With for both live and persistent paths; task check passes.","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-09-02T09:37:55Z","created_by":"Sam Catlow","updated_at":"2026-09-02T09:43:01Z","closed_at":"2026-09-02T09:43:01Z","close_reason":"Fixed: FeedHandler.WithAttrs/WithGroup now propagate to the wrapped handler, matching SystemLogHandler's existing pattern. Added regression test covering both feed and persistent sink.","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-d66k","title":"P1: Update ARCHITECTURE.md Package Map with missing packages","description":"ARCHITECTURE.md's Package Map omits sizeable load-bearing packages:\n- internal/gateway: 18.7k LOC\n- internal/tools: 20.9k LOC\n- internal/memory: 7k LOC\n- secret/*\n- plugin/*\n- skill/*\n\nA contributor or agent reading the map would miss where most of the code actually lives.\n\nNeed to:\n- Audit ARCHITECTURE.md Package Map section\n- Add all missing packages with their responsibilities\n- Ensure consistency with actual package structure\n- Verify LOC counts are accurate\n\nBlocked by: nothing","status":"closed","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-28T13:42:10Z","created_by":"Sam Catlow","updated_at":"2026-08-31T10:10:50Z","closed_at":"2026-08-31T10:10:50Z","close_reason":"Added internal/gateway, internal/tools, internal/memory, internal/secret, internal/plugin, internal/skill to ARCHITECTURE.md Package Map with LOC and role descriptions","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-p3wt","title":"P1: Fix recvcheck - mixed pointer/value receivers","description":"recvcheck found mixed pointer/value receivers on:\n- Duration\n- TaskEnvelope\n- Provenance\n\nThis is a latent mutation-semantics bug - methods may not behave correctly if they expect to mutate the receiver.\n\nNeed to:\n- Audit all methods on Duration, TaskEnvelope, Provenance\n- Standardize to either all pointer receivers or all value receivers\n- Prefer pointer receivers for types that need mutation\n- Verify no behavior changes after fix\n\nBlocked by: nothing","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-28T13:42:07Z","created_by":"Sam Catlow","updated_at":"2026-08-31T10:09:59Z","closed_at":"2026-08-31T10:09:59Z","close_reason":"Duration and TaskEnvelope were already consistent by the time this was picked up; fixed the remaining recvcheck violation on Provenance (Paths/String moved to pointer receiver to match the mutating record() method). All Provenance uses are through addressable struct fields, so build/tests are unaffected. recvcheck now reports 0 issues.","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-agui","title":"P1: Fix 31 golangci-lint issues","description":"31 golangci-lint issues clustered as high cyclomatic/cognitive complexity in:\n- internal/tools/builtin/find.go\n- internal/tools/builtin/grep.go\n- internal/tools/builtin/shell.go\n- internal/gateway/go:dispatchLocal\n\nThese are real refactor candidates, not noise.\n\nNeed to:\n- Review each issue to understand the complexity\n- Refactor functions to reduce cyclomatic complexity\n- Break down large functions into smaller, focused ones\n- Re-run golangci-lint to verify fixes\n\nBlocked by: nothing","notes":"Fixed cyclop findings (applyEdits, grepFallback, grepDirFallback, serveReadContent, handleChatStream) and several gocognit/funlen findings (TDD, runFindGoFallback, makeGrepExecutor, makeShellExecutor). Remaining: richblocks.go markdownToBlocks/blocksToPlainText (gocognit), gateway.go dispatchLocal (gocyclo), agent.go Stage (gocognit 70), turn.go Run (gocognit 53), tomlwrite.go Apply (gocognit 82), cronstore store.go Update (gocognit) + nestif x2, toolset.go nestif. 22 of original 31 findings remain unaddressed -- keeping open.","status":"closed","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-28T13:42:04Z","created_by":"Sam Catlow","updated_at":"2026-08-31T11:36:17Z","closed_at":"2026-08-31T11:36:17Z","close_reason":"All 31 original findings (5 cyclop, 9 gocognit, 1 gocyclo, 2 nestif, plus incidental funlen) resolved via targeted extraction across tools/builtin, gateway, workflow, webui, telegram, cronstore, tomlwrite, agentexec. Remaining 6 lint findings (containedctx/errorlint/noctx/staticcheck) were never part of this bead's scope.","dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
@@ -194,7 +195,7 @@
|
||||
{"_type":"issue","id":"archie-core-1786637500805-417-67db48ed","title":"Regression tests: Container pool — volume lifecycle, error paths, concurrent pool access","description":"internal/container/pool_test.go has 3 tests (grace period, JSON output, volume file). Missing: volume cleanup on error, concurrent pool access, container timeout during task, invalid task payload handling, Docker daemon unavailable error path.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:59:19Z","updated_at":"2026-08-08T14:59:22Z","closed_at":"2026-08-08T14:59:23Z","external_ref":"https://github.com/samcharles93/archie-core/issues/438","source_system":"github:https://github.com/samcharles93/archie-core/issues/438:438","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-1786637500776-416-600a66e5","title":"Surprisal sampling: embedding-backed strategies","description":"Implement the embedding-backed surprisal strategy behind the Sampler seam that wave 1 of the curator epic ships (cheap strategies: recency, random, all, staleness proxy). Surprisal scores memories by how surprising they are so the sampled reasoner's agentic budget is spent on the memories most likely to matter. DEFERRED by design: gated behind the embeddings capability (sibling issue 'Embeddings capability (prerequisite for surprisal sampling)') — pick up only after that lands.\n\n### Acceptance Criteria\n\nA Sampler implementation behind the same interface as the cheap strategies; selection is deterministic given fixed inputs. Algorithm: sample up to a candidate cap; build a k-NN graph over embedding vectors; row-normalize the adjacency with self-loops; power-iterate to the stationary distribution; surprisal = -log(stationary probability of the nearest point); select the highest-surprisal items. Degradation: content with no embedding is skipped; an embedding failure aborts sampling and falls back to free exploration - a sampling failure must never fail or crash a curator pass. Cost: the graph build is quadratic in the candidate cap; the cap is a named constant with a documented bound. Tests use synthetic vectors via httptest, never a live embedding service.","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:59:16Z","updated_at":"2026-08-08T14:59:16Z","external_ref":"https://github.com/samcharles93/archie-core/issues/437","source_system":"github:https://github.com/samcharles93/archie-core/issues/437:437","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-1786637500752-415-434e5bb9","title":"Embeddings capability (prerequisite for surprisal sampling)","description":"Surprisal-based sampling (curator epic DESIGN) requires computing vector embeddings of memory content so memories can be scored by how surprising they are. Archie has no embedding capability today; the epic gates any surprisal-style sampling behind adding one. This issue tracks that prerequisite so it can be picked up independently of the curator epic's main work. The consumer is the embedding-backed surprisal sampler (sibling issue 'Surprisal sampling: embedding-backed strategies'). Embedding consumers must degrade gracefully: content with no embedding is skipped, and an embedding failure aborts sampling in favour of free exploration rather than crashing the pass.\n\n### Acceptance Criteria\n\nAn embedding client exists behind a narrow typed interface usable by in-process daemon components (curators first, other consumers later). Provider/model is config-driven (providers table + a role in [models]). A missing credential degrades per the credential-missing-degrades-not-fatal rule: capability reports unavailable, daemon still starts. Network calls carry timeouts; failures surface as reported errors, never a crash or a failed chat turn. Tests use httptest and never require a live embedding service.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:59:13Z","updated_at":"2026-09-01T15:30:09Z","closed_at":"2026-09-01T15:30:09Z","close_reason":"Closed","external_ref":"https://github.com/samcharles93/archie-core/issues/436","source_system":"github:https://github.com/samcharles93/archie-core/issues/436:436","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-1786637500725-414-9d66a52b","title":"[EPIC] Curator engine: persistent memory-reasoning agent loops","description":"Introduce curators as their own engine family: long-running agent loops that reason over memory and perform small maintenance tasks, rather than one hardcoded background job. A curator is defined by a check-in interval, a tool set, and (once the memory engine family lands) an attached memory engine. It runs persistently while there is input and backs off to a cooldown when idle. Ship two reference curators -- a skill curator and a persistent-session-memory curator -- so the interface is proven against two consumers rather than designed around one.\n\n### Design\n\nThe design splits a cheap hot-path extractor from an expensive sampled reasoner, so agentic cost is never paid per message. Sampling chooses which memories deserve attention via surprisal-based scoring, implemented over embeddings through interchangeable strategies including a k-NN graph random walk. Archie has no embedding capability today, so any surprisal-style sampling is gated behind adding one.\n\n### Acceptance Criteria\n\nCurator is a conforming engine family per ARCHITECTURE.md 'Plugin engine rule (strict)': typed contract, owning registry/manager, start/health/stop, narrow typed host access. Curators are registered and configured declaratively, not hardcoded. The runtime supports persistent operation under load and cooldown when idle, with intervals configurable per curator. Both reference curators run against the shipped defaults. Curator activity is observable: what ran, when, what it changed, and why. A curator failure is isolated and never takes down the daemon or a chat turn.","status":"open","priority":2,"issue_type":"epic","created_at":"2026-08-08T14:59:10Z","updated_at":"2026-08-08T15:34:16Z","external_ref":"https://github.com/samcharles93/archie-core/issues/435","source_system":"github:https://github.com/samcharles93/archie-core/issues/435:435","metadata":null,"labels":["epic"],"dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-1786637500725-414-9d66a52b","title":"[EPIC] Curator engine: persistent memory-reasoning agent loops","description":"Introduce curators as their own engine family: long-running agent loops that reason over memory and perform small maintenance tasks, rather than one hardcoded background job. A curator is defined by a check-in interval, a tool set, and (once the memory engine family lands) an attached memory engine. It runs persistently while there is input and backs off to a cooldown when idle. Ship two reference curators -- a skill curator and a persistent-session-memory curator -- so the interface is proven against two consumers rather than designed around one.\n\n### Design\n\nThe design splits a cheap hot-path extractor from an expensive sampled reasoner, so agentic cost is never paid per message. Sampling chooses which memories deserve attention via surprisal-based scoring, implemented over embeddings through interchangeable strategies including a k-NN graph random walk. Archie has no embedding capability today, so any surprisal-style sampling is gated behind adding one.\n\n### Acceptance Criteria\n\nCurator is a conforming engine family per ARCHITECTURE.md 'Plugin engine rule (strict)': typed contract, owning registry/manager, start/health/stop, narrow typed host access. Curators are registered and configured declaratively, not hardcoded. The runtime supports persistent operation under load and cooldown when idle, with intervals configurable per curator. Both reference curators run against the shipped defaults. Curator activity is observable: what ran, when, what it changed, and why. A curator failure is isolated and never takes down the daemon or a chat turn.","notes":"Status as of 2026-09-02: all 7 real children closed (contract/registry,\nruntime, observability, trigger-accounting, memory-engine binding, and\nboth reference curators -- skill and session-memory).\n\nOne epic AC clause remains genuinely unmet: \"curators are registered and\nconfigured declaratively, not hardcoded.\" Both reference curators are\nregistered via direct Register() calls in\ninternal/app/archied/bootstrap.go:setupCurators, with hardcoded\nintervals (skillcurator.DefaultInterval, sessioncurator.DefaultInterval)\n-- no config surface exists to enable/disable a curator or tune its\ninterval/cooldown without a code change and rebuild. Leaving this epic\nopen on that basis rather than closing it on a partial match; a\nfollow-up issue for declarative curator config (mirroring how\narchie-core-1786637490043 did this for memory.engine) would close it.","status":"open","priority":2,"issue_type":"epic","created_at":"2026-08-08T14:59:10Z","updated_at":"2026-09-01T17:09:33Z","external_ref":"https://github.com/samcharles93/archie-core/issues/435","source_system":"github:https://github.com/samcharles93/archie-core/issues/435:435","metadata":null,"labels":["epic"],"dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-1786637500699-413-301bc587","title":"Regression tests: Yaegi extract packages smoke tests (wfextract, gateextract, pluginextract)","description":"Four extract packages have zero tests: internal/workflow/wfextract, internal/gate/gateextract, internal/plugin/pluginextract, and internal/workflow/wfextract. These are Yaegi symbol extractors that generate Go source exposing package symbols to Yaegi scripts. They fail loudly at build time if broken, but minimal smoke tests would catch regressions in the export format (correct symbol names, expected types, no missing exports).","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:59:05Z","updated_at":"2026-08-08T14:59:07Z","closed_at":"2026-08-08T14:59:08Z","external_ref":"https://github.com/samcharles93/archie-core/issues/434","source_system":"github:https://github.com/samcharles93/archie-core/issues/434:434","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-1786637500667-412-04faa3e7","title":"generalize Provider.APIKeyEnv / NATS.TokenEnv / Telegram.TokenEnv to SecretRef","description":"Follow-up to archie-core-xec, which only migrated Forge.TokenEnv (self-contained call site). Provider.APIKeyEnv is forwarded THREE different ways that all assume the secret is reachable by name in the daemon's own env, not resolved centrally:\n1. agentexec.NewRuntime -\u003e passes the env-var NAME into ai-sdk/runtime's AuthConfig.APIKeyEnv, which lazily os.Getenv's it later (external module, cannot change its contract).\n2. agentexec.WorkerEnvironment / subprocess.go WorkerEnvironment() -\u003e allowlist-forwards the NAME into a subprocess's environment for archie-agent to read itself.\n3. daemon.containerEnv() -\u003e already eagerly resolves via os.Getenv and injects NAME=value into a container env (this one generalizes cleanly).\n\nMigrating Provider.APIKeyEnv to SecretRef requires switching cases 1 and 2 from name-forwarding to eager-resolve-via-secret.Registry-then-inject-value (ai-sdk/runtime.AuthConfig.APIKey literal field already supports this per its ResolveAPIKey fallback chain -- no ai-sdk/runtime changes needed, just stop relying on its lazy os.Getenv path for non-env engines). Also migrate NATSConfig.TokenEnv and TelegramConfig.TokenEnv (each has a single simple os.Getenv call site, lower risk than Provider).\n\n### Design\n\nsecret.Registry must be threaded into agentexec.NewRuntime, WorkerEnvironment, and daemon.containerEnv (or a shared secret-resolution helper) so eager-resolve-then-inject replaces name-forwarding for engines other than the built-in env engine.\n\n### Acceptance Criteria\n\nProvider.APIKeyEnv, NATSConfig.TokenEnv, TelegramConfig.TokenEnv replaced with SecretRef; all three consumption paths (in-process runtime, subprocess worker env, container env) resolve via secret.Registry; task check passes; adversarial review finds zero surviving findings; explicit test proving a non-env engine (e.g. a fake test engine) correctly delivers a provider API key to agentexec.NewRuntime via the AuthConfig.APIKey literal field, not APIKeyEnv.","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:59:02Z","updated_at":"2026-08-08T15:35:20Z","external_ref":"https://github.com/samcharles93/archie-core/issues/433","source_system":"github:https://github.com/samcharles93/archie-core/issues/433:433","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
{"_type":"issue","id":"archie-core-1786637500634-411-e265a95c","title":"secret engine plugin: vault/openbao","description":"Ship a yaegi-loaded secrets engine plugin talking to Vault/OpenBao's HTTP KV API (net/http), following the internal/secret Engine interface from archie-core-xec.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:58:59Z","updated_at":"2026-08-17T22:27:53Z","started_at":"2026-08-17T14:22:10Z","closed_at":"2026-08-17T14:33:52Z","close_reason":"Shipped vault/openbao engine plugin in examples/secret-engines/vault.go (commit 24faf53): CLI-based, VAULT_ADDR/VAULT_TOKEN, key 'path/field' or VAULT_SECRET_PATH prefix.","external_ref":"https://github.com/samcharles93/archie-core/issues/432","source_system":"github:https://github.com/samcharles93/archie-core/issues/432:432","metadata":null,"labels":["task"],"dependencies":[{"issue_id":"archie-core-1786637500634-411-e265a95c","depends_on_id":"archie-core-1786637500571-409-cdffe32a","type":"related","created_at":"2026-08-15T12:49:33Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-1786637500634-411-e265a95c","depends_on_id":"archie-core-1786637500602-410-7a461d4d","type":"related","created_at":"2026-08-15T12:49:33Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
|
||||
|
||||
@@ -108,12 +108,14 @@ func (h *FeedHandler) Handle(ctx context.Context, record slog.Record) error {
|
||||
func (h *FeedHandler) WithAttrs(attrs []slog.Attr) slog.Handler {
|
||||
clone := *h
|
||||
clone.attrs = append(append([]slog.Attr(nil), h.attrs...), PrefixAttrs(attrs, h.groups)...)
|
||||
clone.next = h.next.WithAttrs(attrs)
|
||||
return &clone
|
||||
}
|
||||
|
||||
func (h *FeedHandler) WithGroup(name string) slog.Handler {
|
||||
clone := *h
|
||||
clone.groups = append(append([]string(nil), h.groups...), name)
|
||||
clone.next = h.next.WithGroup(name)
|
||||
return &clone
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package logging
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"log/slog"
|
||||
"testing"
|
||||
)
|
||||
@@ -29,6 +31,26 @@ func TestFeedCapturesStructuredSlogEntriesInOrder(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestFeedHandlerWithAttrsPropagatesToWrappedHandler(t *testing.T) {
|
||||
feed := NewFeed(2)
|
||||
var buf bytes.Buffer
|
||||
logger := slog.New(NewFeedHandler(slog.NewJSONHandler(&buf, nil), feed)).With("component", "curator")
|
||||
logger.Info("ran")
|
||||
|
||||
entries := feed.Snapshot()
|
||||
if len(entries) != 1 || entries[0].Fields["component"] != "curator" {
|
||||
t.Fatalf("feed entry = %#v, want component=curator", entries)
|
||||
}
|
||||
|
||||
var decoded map[string]any
|
||||
if err := json.Unmarshal(buf.Bytes(), &decoded); err != nil {
|
||||
t.Fatalf("json.Unmarshal(persistent sink output) = %v", err)
|
||||
}
|
||||
if decoded["component"] != "curator" {
|
||||
t.Fatalf("persistent sink output = %#v, want component=curator", decoded)
|
||||
}
|
||||
}
|
||||
|
||||
type testWriter struct{}
|
||||
|
||||
func (testWriter) Write(p []byte) (int, error) { return len(p), nil }
|
||||
Reference in new issue
Block a user