Apply namespace scopes to inspections and diagnostics
This commit is contained in:
@@ -81,14 +81,15 @@ prepared, err := scoped.Prepare(ctx, promptkit.RunRequest{
|
||||
})
|
||||
```
|
||||
|
||||
Ordinary execution and preparation qualify slashless caller selections with
|
||||
their respective namespace. Already-qualified IDs pass through unchanged;
|
||||
configured defaults and references are not rewritten. Each call replaces the
|
||||
view's scope defaults, including clearing a scope with an empty field, without
|
||||
changing the receiver or rebuilding its captured configuration and execution
|
||||
collaborators. Namespace syntax is checked when creating the view; resource
|
||||
existence is checked when selected. See [`WithNamespaces`](../../namespaces.go)
|
||||
for the exact public contract.
|
||||
Execution, preparation, prompt/profile inspection, requirement inspection, and
|
||||
smoke diagnostics qualify slashless caller selections with their respective
|
||||
namespaces. Already-qualified IDs pass through unchanged; configured defaults
|
||||
and references are not rewritten. Each call replaces the view's scope defaults,
|
||||
including clearing a scope with an empty field, without changing the receiver
|
||||
or rebuilding its captured configuration and execution collaborators.
|
||||
Namespace syntax is checked when creating the view; resource existence is
|
||||
checked when selected. Configuration inspection remains global. See
|
||||
[`WithNamespaces`](../../namespaces.go) for the exact public contract.
|
||||
|
||||
## Supply Embedded Application Defaults
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ contributor workflow and validation.
|
||||
| `internal/configuration` | Loads keyed backend, profile, and prompt configuration through ConfigKit; records effective field presence, validates final values including optional diagnostic metadata, captures indexed prompt definitions, referenced message content, compiled templates, input metadata snapshots, sorted identity-only profile and prompt inventories, backend and presence-aware profile snapshots, and an explicit read-only inspection view. | [Typed loader](../../internal/configuration/load.go), [identity listing](../../internal/configuration/listing.go), [internal sources](sources.md#typed-configuration-loading) |
|
||||
| `internal/capacity` | Owns engine-local bounded execution admission and FIFO model-generation permits for limited backend IDs, including cancellation-safe waiter removal and client wrapping. | [Internal capacity management](capacity.md) |
|
||||
| `internal/domain` | Defines internal framework values for requests, artifacts, prompt definitions, requirement inspection, profiles, execution targets, rendering, generation, validation, and source-neutral smoke diagnostics, and owns source-neutral invariants for shared execution settings, OpenAI-compatible base endpoints, session identifiers, output contracts, and resource-identity syntax and qualification. Source parsing, required fields, other source-specific normalization, defaulting, and boundary-specific error classification remain with their callers. | [Domain declarations](../../internal/domain/domain.go), [requirement values](../../internal/domain/requirements.go), [endpoint invariant](../../internal/domain/endpoint.go) |
|
||||
| `internal/engine` | Assembles caller-selected configuration into one snapshot, then constructs shared capacity, rendering, validation, generation, repair, the ordinary runner, and the smoke tester for each engine. Immutable namespace views share those collaborators and qualify ordinary request selections. Built-in engines provide the diagnostic HTTP collaborator; injected-client engines do not. It delegates identity listing directly to the captured configuration inventory rather than the runner. | [Engine assembly](../../internal/engine/engine.go), [internal sources](sources.md#typed-configuration-loading), [internal runner](runner.md) |
|
||||
| `internal/engine` | Assembles caller-selected configuration into one snapshot, then constructs shared capacity, rendering, validation, generation, repair, the ordinary runner, and the smoke tester for each engine. Immutable namespace views share those collaborators and qualify caller-supplied execution, inspection, and diagnostic selections without rewriting captured references. Built-in engines provide the diagnostic HTTP collaborator; injected-client engines do not. It delegates identity listing directly to the captured configuration inventory rather than the runner. | [Engine assembly](../../internal/engine/engine.go), [internal sources](sources.md#typed-configuration-loading), [internal runner](runner.md) |
|
||||
| `internal/generation` | Coordinates frozen built-in HTTP attempts and one-shot injected calls through active backend permits, including bounded status retries, cancellable backoff, ordinary attempt observations, and invocation-local evidence for diagnostics. | [Internal generation coordination](generation.md) |
|
||||
| `internal/defaults` | Defines application-neutral framework constants and constructs the default execution target. It contains no CLI, server, or inbound HTTP limits. | [Framework defaults](../../internal/defaults/defaults.go) |
|
||||
| `internal/filecatalog` | Provides deterministic YAML discovery and path helpers for operating-system filesystems and `fs.FS` sources. | [File catalog](../../internal/filecatalog/catalog.go) |
|
||||
|
||||
@@ -650,6 +650,18 @@ prove shared behavior and full identities. Reuse naming-helper tests instead of
|
||||
duplicating the full syntax matrix in every API test. Run relevant root/engine
|
||||
tests and focused race checks.
|
||||
|
||||
Completion: prompt, profile, and requirement inspections now qualify each
|
||||
explicit caller selection independently, and smoke diagnostics qualify supplied
|
||||
prompt, profile, and backend IDs before applying their unchanged selection
|
||||
precedence. Captured references and global configuration inspection remain
|
||||
unchanged. Contract tests verify full returned identities, exact configured
|
||||
prompt defaults and backend references, malformed caller IDs, and ordinary
|
||||
not-found behavior.
|
||||
Validation passed: `GOWORK=off go test ./...`, focused
|
||||
`GOWORK=off go test -race . -run 'TestWithNamespaces' -count=1`,
|
||||
`GOWORK=off go vet ./...`, `GOWORK=off python3 scripts/check-examples.py`,
|
||||
and `git diff --check`.
|
||||
|
||||
## Stage 14: Add Backend Listing And Namespace Filters
|
||||
|
||||
Scope: the existing identity-inventory path, not the execution runner.
|
||||
|
||||
Reference in New Issue
Block a user