foundation/

directory
v0.0.36 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2026 License: MIT

Directories

Path Synopsis
Package cache provides caching utilities for the foundation layer.
Package cache provides caching utilities for the foundation layer.
decorators
Package decorators provides cache decorators for cross-cutting concerns.
Package decorators provides cache decorators for cross-cutting concerns.
Package chartspec is the pure visual-algebra compiler of the analytics engine.
Package chartspec is the pure visual-algebra compiler of the analytics engine.
Package codebase builds a Codebase, a read-only view of one codebase, over a CodebaseSource: file selection, contents, pattern matches, the Go and YAML parsed forms and rendered charts.
Package codebase builds a Codebase, a read-only view of one codebase, over a CodebaseSource: file selection, contents, pattern matches, the Go and YAML parsed forms and rendered charts.
Package config provides a factory for ConfigLoader implementations with multiple backends.
Package config provides a factory for ConfigLoader implementations with multiple backends.
schema/decoration
Package decoration is the config surface for every decorated component — controllers, clients, workflows, pipelines, services, repositories, stores, jobs and gates.
Package decoration is the config surface for every decorated component — controllers, clients, workflows, pipelines, services, repositories, stores, jobs and gates.
schema/infra
Package infra provides typed configuration structures for Tech AI Knowledge Engine services.
Package infra provides typed configuration structures for Tech AI Knowledge Engine services.
schema/listquery
Package listquery is the config surface for the list-query value-suggestion facet: the row threshold above which a facet-eligible field is served from the maintained distinct_values table instead of a live DISTINCT, and the interval at which the reconcile job recomputes refcounts.
Package listquery is the config surface for the list-query value-suggestion facet: the row threshold above which a facet-eligible field is served from the maintained distinct_values table instead of a live DISTINCT, and the interval at which the reconcile job recomputes refcounts.
schema/pipelines
Package pipelines is the config surface for the pipeline (orchestration) layer: the multipart-upload sizing (a pipeline's timeout is a decoration layer, decoration.pipelines).
Package pipelines is the config surface for the pipeline (orchestration) layer: the multipart-upload sizing (a pipeline's timeout is a decoration layer, decoration.pipelines).
schema/repos
Package repos is the config surface for the repository (data-access) layer: the entity cache's TTL, version and key prefix.
Package repos is the config surface for the repository (data-access) layer: the entity cache's TTL, version and key prefix.
schema/resilience
Package resilience is the tunable config surface for the foundation resilience decorators (retry, breaker, rate-limit, bulkhead, timeout, budget) — the per-environment knobs threaded through the repo/client/interceptor providers Each struct mirrors its primitive's tunable fields with defaults identical to the primitive's DefaultConfig(), so adopting the config surface is behavior-preserving; the providers convert these into the primitive's options.
Package resilience is the tunable config surface for the foundation resilience decorators (retry, breaker, rate-limit, bulkhead, timeout, budget) — the per-environment knobs threaded through the repo/client/interceptor providers Each struct mirrors its primitive's tunable fields with defaults identical to the primitive's DefaultConfig(), so adopting the config surface is behavior-preserving; the providers convert these into the primitive's options.
schema/stores
Package stores is the config surface for the data (stores) layer: the ORM the stores are built on (Kind), the page-size cap, the per-resource default page sizes and the list-query caches, so a deployer can tune pagination without a rebuild.
Package stores is the config surface for the data (stores) layer: the ORM the stores are built on (Kind), the page-size cap, the per-resource default page sizes and the list-query caches, so a deployer can tune pagination without a rebuild.
schema/transport
Package transport is the config surface for the edge (transport) layer: WebSocket, gRPC, CORS and HTTP tuning.
Package transport is the config surface for the edge (transport) layer: WebSocket, gRPC, CORS and HTTP tuning.
schema/workers
Package workers is the shared config surface for background workers: the common tunables (name, telemetry, relay and sweep cadences, batching) plus the sweep-timing cross-field invariant, so every worker inherits the typed-field + Validate shape.
Package workers is the shared config surface for background workers: the common tunables (name, telemetry, relay and sweep cadences, batching) plus the sweep-timing cross-field invariant, so every worker inherits the typed-field + Validate shape.
viper
Package viper provides a Viper-backed ConfigLoader implementation.
Package viper provides a Viper-backed ConfigLoader implementation.
Package convert maps values across an API boundary: EnumMapper pairs a proto enum with a domain enum from one table, ParseUUID parses a request id as invalid input when malformed, and Int32OrPanic / CountToInt32 narrow counts to a proto int32.
Package convert maps values across an API boundary: EnumMapper pairs a proto enum with a domain enum from one table, ParseUUID parses a request id as invalid input when malformed, and Int32OrPanic / CountToInt32 narrow counts to a proto int32.
Package crypto provides authenticated symmetric encryption for data at rest — e.g.
Package crypto provides authenticated symmetric encryption for data at rest — e.g.
Package dataset merge-loads YAML data files into one set of top-level sections and decodes each section strictly into a typed value, so a front-end's repository data (tools, paths, checks) can be split across files by topic.
Package dataset merge-loads YAML data files into one set of top-level sections and decodes each section strictly into a typed value, so a front-end's repository data (tools, paths, checks) can be split across files by topic.
Package decorate is the type-agnostic operation-decoration mechanism: a common OpMiddleware interface, a Chain composer, and a generic Exec[R] runner that wraps ANY named operation with the cross-cutting decorator stack, regardless of the operation's return type.
Package decorate is the type-agnostic operation-decoration mechanism: a common OpMiddleware interface, a Chain composer, and a generic Exec[R] runner that wraps ANY named operation with the cross-cutting decorator stack, regardless of the operation's return type.
Package dtovalidate is the leaf rule library the generated DTO Validate() methods compose Each rule is a small, hand-written check that REUSES the standard library (google/uuid, net/url, path/filepath, net/mail) rather than a hand-rolled regex, and returns a core/errors CodeInvalidInput AppError on violation so the failure classifies to 400 / InvalidArgument at the boundary.
Package dtovalidate is the leaf rule library the generated DTO Validate() methods compose Each rule is a small, hand-written check that REUSES the standard library (google/uuid, net/url, path/filepath, net/mail) rather than a hand-rolled regex, and returns a core/errors CodeInvalidInput AppError on violation so the failure classifies to 400 / InvalidArgument at the boundary.
Package fsys provides a real-OS filesystem implementation of the FS interface defined in core/interfaces.
Package fsys provides a real-OS filesystem implementation of the FS interface defined in core/interfaces.
Package gen checks a Generator's committed outputs for drift and writes fresh ones.
Package gen checks a Generator's committed outputs for drift and writes fresh ones.
Package ghactions is what a step running in GitHub Actions says to its runner: the markdown it appends to the job summary and the ::add-mask:: workflow commands that redact a value from the log.
Package ghactions is what a step running in GitHub Actions says to its runner: the markdown it appends to the job summary and the ::add-mask:: workflow commands that redact a value from the log.
Package git provides reusable git operations for the CLI and tooling layers.
Package git provides reusable git operations for the CLI and tooling layers.
Package imagescan is a container-image vulnerability gate: a Trivy image scan under a TrivyPolicy (ScanImage), and the known-exploited verdict over a grype JSON report (GrypeEmergencies, CheckGrypeReport), which blocks only on a vulnerability that is known to be exploited (CISA KEV) and that an upgrade fixes.
Package imagescan is a container-image vulnerability gate: a Trivy image scan under a TrivyPolicy (ScanImage), and the known-exploited verdict over a grype JSON report (GrypeEmergencies, CheckGrypeReport), which blocks only on a vulnerability that is known to be exploited (CISA KEV) and that an upgrade fixes.
Package impact maps changed paths to what they affect: the units owning them (Map, a deploy row, a module, a chart) and the named pattern classes they touch (Classify, a language or a domain).
Package impact maps changed paths to what they affect: the units owning them (Map, a deploy row, a module, a chart) and the named pattern classes they touch (Classify, a language or a domain).
Package jsonapi is the [JSON:API](https://jsonapi.org/format/) codec: it rewrites a proto-JSON REST response into the {data, meta, links, errors} envelope (TransformSingleResource, TransformCollection, TransformMeta, TransformError).
Package jsonapi is the [JSON:API](https://jsonapi.org/format/) codec: it rewrites a proto-JSON REST response into the {data, meta, links, errors} envelope (TransformSingleResource, TransformCollection, TransformMeta, TransformError).
Package lifecycle provides a Manager that starts a set of lifecycle-managed clients in registration order and stops them in reverse for graceful shutdown, so a composition root wires its clients once and coordinates their startup and teardown centrally instead of by hand.
Package lifecycle provides a Manager that starts a set of lifecycle-managed clients in registration order and stops them in reverse for graceful shutdown, so a composition root wires its clients once and coordinates their startup and teardown centrally instead of by hand.
Package listquery is the pure, ORM-free half of the list-query SDK a per-resource filter allow-list (Map) + sort allow-list (Set), a JSON filter-DSL parser that compiles a client filter string into the core/types Filter contract (gated by the allow-list so only allow-listed fields with type-checked values reach a query), and the shared Compile/CompileOrder fold that walks that IR through a core/interfaces.QueryBackend algebra.
Package listquery is the pure, ORM-free half of the list-query SDK a per-resource filter allow-list (Map) + sort allow-list (Set), a JSON filter-DSL parser that compiles a client filter string into the core/types Filter contract (gated by the allow-list so only allow-listed fields with type-checked values reach a query), and the shared Compile/CompileOrder fold that walks that IR through a core/interfaces.QueryBackend algebra.
Package logger provides structured logging with multiple backend implementations.
Package logger provides structured logging with multiple backend implementations.
logctx
Package logctx provides shared context utilities for logger sub-packages.
Package logctx provides shared context utilities for logger sub-packages.
stdlib
Package stdlib provides a pure stdlib slog logger implementation.
Package stdlib provides a pure stdlib slog logger implementation.
zap
Package zap provides a zap-backed logger implementation with PII redaction.
Package zap provides a zap-backed logger implementation with PII redaction.
Package metrics provides a builder for the Prometheus metrics implementation.
Package metrics provides a builder for the Prometheus metrics implementation.
noop
Package noop provides a no-op metrics implementation that silently discards all metric operations.
Package noop provides a no-op metrics implementation that silently discards all metric operations.
prom
Package prom provides a Prometheus-backed metrics implementation.
Package prom provides a Prometheus-backed metrics implementation.
Package middleware provides stdlib net/http middleware for composing request processing pipelines without external web frameworks.
Package middleware provides stdlib net/http middleware for composing request processing pipelines without external web frameworks.
Package mockgen renders the Go mocks the repository's `//go:generate mockgen` directives declare, as an interfaces.Generator: one artifact per directive, rendered by mockgen into memory, so a drift check (gen.Check) compares them with the on-disk mocks without writing to the tree.
Package mockgen renders the Go mocks the repository's `//go:generate mockgen` directives declare, as an interfaces.Generator: one artifact per directive, rendered by mockgen into memory, so a drift check (gen.Check) compares them with the on-disk mocks without writing to the tree.
Package okf reads, renders and checks Open Knowledge Format (OKF) v0.2 bundles: a directory tree of markdown concepts, each with YAML frontmatter, plus the reserved index.md (directory listing) and log.md (dated history) files.
Package okf reads, renders and checks Open Knowledge Format (OKF) v0.2 bundles: a directory tree of markdown concepts, each with YAML frontmatter, plus the reserved index.md (directory listing) and log.md (dated history) files.
Package openapi post-processes the raw Swagger 2.0 specs generated by protoc-gen-openapiv2 into OpenAPI 3 specs with JSON:API envelope schemas.
Package openapi post-processes the raw Swagger 2.0 specs generated by protoc-gen-openapiv2 into OpenAPI 3 specs with JSON:API envelope schemas.
Package options provides a generic functional options pattern for configuring types.
Package options provides a generic functional options pattern for configuring types.
Package pins keeps a Renovate config in step with a codebase: it detects which dependency ecosystems the codebase holds (Detect), renders renovate.json from them and a consumer's update Policy (Render), and exposes the render as a Generator, so a drift check fails when an ecosystem appears and the config was not regenerated.
Package pins keeps a Renovate config in step with a codebase: it detects which dependency ecosystems the codebase holds (Detect), renders renovate.json from them and a consumer's update Policy (Render), and exposes the render as a Generator, so a drift check fails when an ecosystem appears and the config was not regenerated.
Package protogen holds the file passes a proto generation runs over buf's output: the generated Python package's skeleton (__init__.py files, the py.typed marker) and its package-qualified imports, the protobuf-es REQUIRED-field promotion read from a descriptor set, and the clean / stash-and-settle moves that regenerate a directory without losing its committed contents on a failed run.
Package protogen holds the file passes a proto generation runs over buf's output: the generated Python package's skeleton (__init__.py files, the py.typed marker) and its package-qualified imports, the protobuf-es REQUIRED-field promotion read from a descriptor set, and the clean / stash-and-settle moves that regenerate a directory without losing its committed contents on a failed run.
Package report renders a gate's progress and a CLI's console output.
Package report renders a gate's progress and a CLI's console output.
Package resilience provides fault-tolerance primitives as standalone subpackages.
Package resilience provides fault-tolerance primitives as standalone subpackages.
adaptivethrottle
Package adaptivethrottle provides a client-side adaptive throttler (Google SRE "Handling Overload"): it sheds a growing fraction of outbound requests locally when a backend's accept-rate drops, protecting the backend from a client-side retry storm.
Package adaptivethrottle provides a client-side adaptive throttler (Google SRE "Handling Overload"): it sheds a growing fraction of outbound requests locally when a backend's accept-rate drops, protecting the backend from a client-side retry storm.
budget
Package budget tracks retry consumption across a call chain via context propagation.
Package budget tracks retry consumption across a call chain via context propagation.
bulkhead
Package bulkhead provides a builder for Bulkhead implementations with multiple backends.
Package bulkhead provides a builder for Bulkhead implementations with multiple backends.
bulkhead/adaptive
Package adaptive provides a self-tuning (AIMD) concurrency-limiting Bulkhead.
Package adaptive provides a self-tuning (AIMD) concurrency-limiting Bulkhead.
bulkhead/channel
Package channel provides a channel-based semaphore bulkhead implementation.
Package channel provides a channel-based semaphore bulkhead implementation.
bulkhead/keyed
Package keyed is the in-process KeyedLimiter: a per-key counting semaphore that refuses, rather than waits, once a key holds its cap.
Package keyed is the in-process KeyedLimiter: a per-key counting semaphore that refuses, rather than waits, once a key holds its cap.
circuitbreaker
Package circuitbreaker provides a builder for CircuitBreaker implementations with multiple backends.
Package circuitbreaker provides a builder for CircuitBreaker implementations with multiple backends.
circuitbreaker/gobreaker
Package gobreaker provides a circuit breaker backed by sony/gobreaker/v2.
Package gobreaker provides a circuit breaker backed by sony/gobreaker/v2.
deadletter
Package deadletter provides the dead-letter-queue facade — the Go mirror of techai_webutils.foundation.resilience.dlq.
Package deadletter provides the dead-letter-queue facade — the Go mirror of techai_webutils.foundation.resilience.dlq.
dedup
Package dedup provides message deduplication for exactly-once processing under at-least-once delivery.
Package dedup provides message deduplication for exactly-once processing under at-least-once delivery.
hedge
Package hedge provides a builder for Hedger implementations that reduce tail latency by racing a backup attempt.
Package hedge provides a builder for Hedger implementations that reduce tail latency by racing a backup attempt.
leader
Package leader provides leader election for single-instance job execution.
Package leader provides leader election for single-instance job execution.
pausegate
Package pausegate stops a consumer pulling work while its downstream is unavailable.
Package pausegate stops a consumer pulling work while its downstream is unavailable.
ratelimiter
Package ratelimiter provides a builder for RateLimiter implementations with multiple backends.
Package ratelimiter provides a builder for RateLimiter implementations with multiple backends.
ratelimiter/token
Package token provides a token-bucket rate limiter backed by golang.org/x/time/rate.
Package token provides a token-bucket rate limiter backed by golang.org/x/time/rate.
reswire
Package reswire builds the resilience primitives that are not decoration layers — the tail-latency hedger and the adaptive throttle — from a ConfigLoader and the schema/resilience config surface, starting from the schema defaults so an absent overlay is behavior-preserving.
Package reswire builds the resilience primitives that are not decoration layers — the tail-latency hedger and the adaptive throttle — from a ConfigLoader and the schema/resilience config surface, starting from the schema defaults so an absent overlay is behavior-preserving.
retry
Package retry provides a builder for Retrier implementations with multiple backends.
Package retry provides a builder for Retrier implementations with multiple backends.
retry/exponential
Package exponential provides an exponential backoff retrier using cenkalti/backoff/v5.
Package exponential provides an exponential backoff retrier using cenkalti/backoff/v5.
Package scaffold plans and applies the files a template set (Plan) or the caller's own rendering (PlanFiles) generates into a codebase, honoring each file's policy (written once, regenerated, or regenerated above a preserve marker).
Package scaffold plans and applies the files a template set (Plan) or the caller's own rendering (PlanFiles) generates into a codebase, honoring each file's policy (written once, regenerated, or regenerated above a preserve marker).
Package schemagen derives documentation artifacts from Go and Python config sources: JSON Schema (Draft 2020-12) reflected from Go types (For, Reflect), the allowed values of each config-selected Kind (ExtractGoKinds, ExtractPythonKinds), and a markdown config reference rendered as a Generator (NewConfigDocs) with its documentation audit (AuditContract).
Package schemagen derives documentation artifacts from Go and Python config sources: JSON Schema (Draft 2020-12) reflected from Go types (For, Reflect), the allowed values of each config-selected Kind (ExtractGoKinds, ExtractPythonKinds), and a markdown config reference rendered as a Generator (NewConfigDocs) with its documentation audit (AuditContract).
Package stepcache builds a StepCache from config: off (the default, never hits) or dir (one marker file per passed key under a directory), and derives the content-addressed key a step is cached under.
Package stepcache builds a StepCache from config: off (the default, never hits) or dir (one marker file per passed key under a directory), and derives the content-addressed key a step is cached under.
Package stream is the engine's substrate for large, pull-based results over interfaces.Stream.
Package stream is the engine's substrate for large, pull-based results over interfaces.Stream.
Package system provides CommandRunner implementations for executing external commands.
Package system provides CommandRunner implementations for executing external commands.
Package tfplan reads the plans a `terragrunt run --all --json-out-dir <dir>` run leaves — one `terraform show -json` rendering per unit, under <dir>/<unit>/ — and renders the markdown summary a reviewer approves: the totals, every destroyed resource, a per-unit add/change/destroy table and each changed unit's resource list, destroys first.
Package tfplan reads the plans a `terragrunt run --all --json-out-dir <dir>` run leaves — one `terraform show -json` rendering per unit, under <dir>/<unit>/ — and renders the markdown summary a reviewer approves: the totals, every destroyed resource, a per-unit add/change/destroy table and each changed unit's resource list, destroys first.
Package tracer provides distributed tracing with swappable backends.
Package tracer provides distributed tracing with swappable backends.
nooptracer
Package nooptracer provides a no-op tracer that satisfies interfaces.Tracer.
Package nooptracer provides a no-op tracer that satisfies interfaces.Tracer.
oteltracer
Package oteltracer provides an OpenTelemetry-backed tracer implementation.
Package oteltracer provides an OpenTelemetry-backed tracer implementation.
Package validator provides a small, generic business-rule validator for the service layer — the below-transport-boundary complement to the proto/request validation performed at the transport edge (connect ValidateInterceptor).
Package validator provides a small, generic business-rule validator for the service layer — the below-transport-boundary complement to the proto/request validation performed at the transport edge (connect ValidateInterceptor).
workspace
golang
Package golang discovers the Go side of a workspace: the go.work modules (GoWorkModules, WorkUses) and their require graph (WorkspaceGraph, ParseWorkspaceGraph), which of them hold loadable Go packages (FilterModulesWithGoPackages, GoListPackages, HasGoPackagesWithTags — `go list` run through the injected CommandRunner and memoized per directory), scoped go.work files for isolated runs (ScopedWork), the root module path (ModulePath), the modules holding staged files (StagedModules) and whether generated protobuf packages are present (HasGeneratedPackages).
Package golang discovers the Go side of a workspace: the go.work modules (GoWorkModules, WorkUses) and their require graph (WorkspaceGraph, ParseWorkspaceGraph), which of them hold loadable Go packages (FilterModulesWithGoPackages, GoListPackages, HasGoPackagesWithTags — `go list` run through the injected CommandRunner and memoized per directory), scoped go.work files for isolated runs (ScopedWork), the root module path (ModulePath), the modules holding staged files (StagedModules) and whether generated protobuf packages are present (HasGeneratedPackages).
python
Package python discovers a repository's Python packages: the directories holding a pyproject.toml under the given roots (Packages) and a package's importable module (ModuleName).
Package python discovers a repository's Python packages: the directories holding a pyproject.toml under the given roots (Packages) and a package's importable module (ModuleName).
Package yamlq queries and edits YAML documents by path.
Package yamlq queries and edits YAML documents by path.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL