internal/api
github.com/ensera-ai/taisce/internal/api · 28 files · 5453 lines · 155 tests · source
Package api is the wire boundary: the journey over HTTP rather than through Go packages.
Everything the spine does already exists and is reachable only by importing a package. The adapters are the product and they are not written in Go, so a contract they can bind to is the difference between a demonstrated design and a usable one.
What this package is allowed to decide
Transport, and nothing else. It parses, authorises, calls, and renders. Every correctness argument — the span rule, the closed vocabulary, the role policy, the residual count — lives below it and stays there. A handler that made one of those decisions would be a second place the rule exists, and the one that drifts is whichever is not the one with the test named after it.
Where it sits
Imports: internal/credential, internal/domain, internal/entitycandidate, internal/infra/pg, internal/notify, internal/passage, internal/recall, internal/reportcandidate
Imported by: cmd/taisce
Files
| File | Lines | Declarations | What it is for |
|---|---|---|---|
| admission.go | 121 | 10 | Admission bounds this process's HTTP work. |
| api.go | 1214 | 51 | Carries the package documentation. |
| artifacts.go | 116 | 10 | |
| assertions.go | 48 | 2 | The credential supplies project and authorship. |
| auth_audit.go | 76 | 4 | refusedAuthBudget bounds anonymous ledger writes per server, without keeping an attacker-keyed map. |
| authorization.go | 51 | 2 | authorized runs after authentication, project checks and admission, but before parsing a body or executing memory work. |
| citation.go | 51 | 2 | |
| contexts.go | 110 | 6 | contextRequest asks for one subject's history under a budget: the newest turns verbatim, the rest as the segments the compaction pass wrote. |
| contract.go | 373 | 12 | Carries the package documentation. |
| corrections.go | 49 | 2 | Attribution comes from the credential and retained target; the body cannot replace either. |
| entities.go | 108 | 7 | entityPurgeRequest withdraws an entity the extractor should not have made. |
| entitycandidates.go | 60 | 3 | |
| feedback.go | 106 | 5 | feedbackListRequest narrows the queue. |
| health.go | 68 | 5 | Readiness permits one dependency check at a time and caches either result for one second. |
| manage.go | 646 | 47 | Carries the package documentation. |
| mcp.go | 282 | 14 | Carries the package documentation. |
| messages.go | 60 | 3 | |
| notifications.go | 138 | 13 | notificationEndpointListRequest takes nothing: the credential decides the project, as it does everywhere else on this surface. |
| passages.go | 62 | 3 | |
| portal.go | 639 | 39 | Carries the package documentation. |
| portalactions.go | 272 | 17 | portalAction is one thing the portal can do, and what it costs to be wrong about it. |
| portalactivity.go | 233 | 16 | portalRange is one window the overview offers. |
| records.go | 82 | 5 | Keep client-supplied IDs, subjects and database error text out of both audit and diagnostics. |
| reportcandidates.go | 60 | 3 | |
| request.go | 141 | 6 | decode validates the complete wire representation before populating a request. |
| retractions.go | 48 | 2 | The actor is the authenticated credential, never a body field. |
| semantic.go | 143 | 6 | semanticSurfaces composes the three retrievers the API already serves separately into what recall consults after exact anchoring. |
| subjects.go | 96 | 8 |
155 tests hold this package's behaviour; the list is named for what each one proves.
Files it carries
Not Go, and part of what the package is: embedded, rendered or read at build time.
portal/assets/Manrope-OFL.txtportal/assets/SpaceGrotesk-OFL.txtportal/assets/manrope-latin-400-normal.woff2portal/assets/manrope-latin-500-normal.woff2portal/assets/manrope-latin-600-normal.woff2portal/assets/manrope-latin-700-normal.woff2portal/assets/space-grotesk-latin-500-normal.woff2portal/assets/space-grotesk-latin-700-normal.woff2portal/home.htmlportal/icons.htmlportal/layout.htmlportal/ledger.htmlportal/login.htmlportal/project.htmlportal/styles.html