docs: normalise Australian English and prose across comments and docs
This commit is contained in:
98 files changed
+209
-609
No files matched your search
+2
-2
@@ -7,9 +7,9 @@ and an ordered list of steps. Definitions are stored in the control plane's
|
||||
`internal/domain/workflow/shipped/`.
|
||||
|
||||
The server is the authority. It serves the step vocabulary, including each step
|
||||
type's settings schema, in the `workflow-definitions` catalog entry
|
||||
type's settings schema, in the `workflow-definitions` catalogue entry
|
||||
(`x-step-types`), and validates every definition when it is saved. This file
|
||||
describes that vocabulary; when they disagree, the catalog wins.
|
||||
describes that vocabulary; when they disagree, the catalogue wins.
|
||||
|
||||
```yaml
|
||||
id: implement
|
||||
|
||||
@@ -63,6 +63,6 @@ without turning the codebase to garbage.
|
||||
|
||||
- One issue → one small PR applies doubly to self-directed work: past about 100
|
||||
lines or any new mechanism, the change stops and reassesses.
|
||||
- Every self-directed commit cites the issue that authorized it.
|
||||
- Every self-directed commit cites the issue that authorised it.
|
||||
- Rule proposals from the distillation curator must name the run that triggered
|
||||
them, and `AGENTS.md` stays short enough to read in full every session.
|
||||
@@ -1,4 +1,4 @@
|
||||
# User authorization boundaries
|
||||
# User authorisation boundaries
|
||||
|
||||
Archie separates authentication (which person or service is calling) from
|
||||
permission to act on a resource. This inventory follows the
|
||||
@@ -33,7 +33,7 @@ and task grants must remain distinct.
|
||||
|
||||
`internal/domain/access` defines actions, resources, principals and memberships.
|
||||
`internal/infrastructure/access` assembles Cedar entities and evaluates the
|
||||
instance → organization → workspace → object chain. A forbid wins; each
|
||||
instance → organisation → workspace → object chain. A forbid wins; each
|
||||
applicable level must permit the operation. Missing or invalid policy chains
|
||||
fail closed.
|
||||
|
||||
@@ -47,7 +47,7 @@ authenticated context, never a request's assertion about itself.
|
||||
|
||||
Cedar permission is not ownership of another person's private data. Conversation
|
||||
history, passkeys, recovery codes and personal tokens are bound to the person.
|
||||
An organization or instance admin role does not override those relationships.
|
||||
An organisation or instance admin role does not override those relationships.
|
||||
Account creation uses `manage_members` policy rather than a hard-coded admin
|
||||
role. Authenticating through OIDC does not automatically grant membership, link
|
||||
accounts by unverified email, or create an administrator.
|
||||
@@ -59,7 +59,7 @@ accounts by unverified email, or create an administrator.
|
||||
| Browser credential gate: `webui/auth.go`, `accounts.go` | Account session or verified provider identity; shared dashboard token is not a person when accounts are enabled. No API data before authentication. | `TestAccountBoundary`, `TestAccountSessionFailureIsClosed` |
|
||||
| Browser policy gate: `webui/authorize.go` | Resolve principal from stored identity; evaluate action against stored org/workspace and resource kind before handler. Missing chain refuses. | `TestHTTPPolicyCannotBeBypassed`, `TestAuthorizeRefusesWithoutAChain`, `TestAuthorizeRecord`, `TestTaskAuthorizationUsesStoredAttributes`, `TestAuthorizeCreateIn` |
|
||||
| Instance-only HTTP surfaces: `webui/instance_only.go`, server route registration | Hide instance-owned configuration and diagnostics from another org; policy still applies first. | `TestInstanceOnlyHidesTheInstanceFromOtherOrgs`, `TestInstanceAdminOrgs` |
|
||||
| First setup: `webui/accounts.go`, `postgres/accounts.go` | Initial organization, workspace, instance URL, admin identity and password commit together. Transaction lock closes bootstrap after first account; later requests require `manage_members`. | Disposable PostgreSQL smoke verification for bootstrap race and rollback; account policy tests below |
|
||||
| First setup: `webui/accounts.go`, `postgres/accounts.go` | Initial organisation, workspace, instance URL, admin identity and password commit together. Transaction lock closes bootstrap after first account; later requests require `manage_members`. | Disposable PostgreSQL smoke verification for bootstrap race and rollback; account policy tests below |
|
||||
| Account creation: `webui/accounts.go`, `staterpc/accounts.go`, `postgres/accounts.go` | Cedar `manage_members` at HTTP and RPC; target org is authenticated context. New local accounts cannot request owner role. | `TestAccountManagementUsesPolicy`, `TestAccountBoundary` |
|
||||
| Local passwords and sessions: `identity/password.go`, `postgres/accounts.go` | Argon2id, independent salts, length/common-password checks, generic login refusal, account throttling, session hashes and expiry, revocation on logout/password change/suspension. | `TestPasswordVerification`, `TestAccountBoundary`; disposable PostgreSQL session verification |
|
||||
| Transport and CSRF: `webui/accounts.go`, `api_tasks.go` | Password/account mutations require HTTPS or localhost development, JSON, custom CSRF header and same-origin requests. Forwarded headers require explicit trusted-proxy configuration. | `TestAuthenticationTransport`, existing mutation security tests |
|
||||
@@ -100,7 +100,7 @@ they do not contain user data. `/health/detailed` remains protected.
|
||||
|
||||
Personal routes under `/api/account/` require an active signed-in person and
|
||||
server-derived ownership: password change, recovery-secret generation, passkey
|
||||
begin/finish/list/delete. They do not require an organization administrator
|
||||
begin/finish/list/delete. They do not require an organisation administrator
|
||||
role. `POST /api/accounts` and `/api/authentication` are administrative policy
|
||||
routes.
|
||||
|
||||
@@ -226,7 +226,7 @@ action/resource; the handler may impose a stricter record or instance boundary.
|
||||
|
||||
## Verification limits
|
||||
|
||||
A synthetic browser authenticator verifies protocol behavior, not a physical
|
||||
A synthetic browser authenticator verifies protocol behaviour, not a physical
|
||||
security key or every operating system. An OIDC unit test is not acceptance
|
||||
against a deployed provider. Disposable PostgreSQL smoke checks verify real SQL
|
||||
without putting database-dependent tests in the fast unit suite.
|
||||
@@ -236,8 +236,8 @@ new person. Existing service credentials remain privileged; this inventory does
|
||||
not claim that all internal gRPC methods have independent Cedar gates.
|
||||
|
||||
When changing a user-facing operation, update its inventory entry and its
|
||||
allow/deny behavior cases. Include another user in the same organization, a
|
||||
caller in another organization, a missing principal, unavailable policy storage,
|
||||
allow/deny behaviour cases. Include another user in the same organisation, a
|
||||
caller in another organisation, a missing principal, unavailable policy storage,
|
||||
and the applicable owner/workspace/instance restrictions.
|
||||
|
||||
Bootstrap is unauthenticated until the first administrator is created. Complete
|
||||
|
||||
@@ -42,7 +42,7 @@ func SamplingMessages(req protocol.SamplingRequest) ([]chat.Message, error) {
|
||||
|
||||
// SamplingMaxTokens returns the request's maxTokens or the default, capped at
|
||||
// the model's ceiling. The ai-sdk runtime picks max_completion_tokens or
|
||||
// max_tokens from the model's catalog metadata, so there is no reasoning
|
||||
// max_tokens from the model's catalogue metadata, so there is no reasoning
|
||||
// branch here.
|
||||
func SamplingMaxTokens(requested, modelCeiling int) int {
|
||||
maxTokens := requested
|
||||
|
||||
@@ -104,7 +104,7 @@ func TestEveryOperationIsAuthorized(t *testing.T) {
|
||||
}
|
||||
|
||||
// TestUnwiredAuthorizerRefuses guards the boot order: until the policy chain
|
||||
// is wired, an authorized operation is refused rather than let through.
|
||||
// is wired, an authorised operation is refused rather than let through.
|
||||
func TestUnwiredAuthorizerRefuses(t *testing.T) {
|
||||
settings := &governance.Module{}
|
||||
if err := settings.Allow(governance.WithPrincipal(t.Context(), governance.SharedTokenOwner()), "read", "run"); !errors.Is(err, httpapi.ErrUnavailable) {
|
||||
|
||||
@@ -837,7 +837,7 @@ func (b *boot) addCleanup(fn func()) {
|
||||
|
||||
func (b *boot) catalogState() modelcatalog.Snapshot { return b.catalog.State() }
|
||||
|
||||
// loadCatalog layers the model catalog under the file config. A catalog that
|
||||
// loadCatalog layers the model catalogue under the file config. A catalogue that
|
||||
// cannot be read leaves the configured providers and models in effect.
|
||||
func (b *boot) loadCatalog(ctx context.Context) {
|
||||
snapshot, err := b.catalog.Fetch(ctx, b.secrets.Getenv, b.cfgHolder.Get().Providers)
|
||||
@@ -846,7 +846,7 @@ func (b *boot) loadCatalog(ctx context.Context) {
|
||||
return
|
||||
}
|
||||
models := modelcatalog.Apply(&b.cfg, snapshot)
|
||||
// Layer the catalog over the live config, not b.cfg: b.cfg predates the
|
||||
// Layer the catalogue over the live config, not b.cfg: b.cfg predates the
|
||||
// execution-settings watch, so publishing it would put the file's budgets
|
||||
// back over the control plane's.
|
||||
live := b.cfgHolder.Get().Clone()
|
||||
|
||||
@@ -47,10 +47,10 @@ func (b *boot) loadRuntimeConfig(ctx context.Context) error {
|
||||
// cannot answer aborts the reload: the running config already holds those
|
||||
// values, so publishing the file's over them is the worse outcome.
|
||||
func (b *boot) reloadConfig(ctx context.Context, doc *configuration.Document) error {
|
||||
// Boot merges catalog-discovered providers into cfg before the
|
||||
// Boot merges catalogue-discovered providers into cfg before the
|
||||
// Holders are seeded; publishing the raw reloaded document would
|
||||
// drop them from the running config even though the file is
|
||||
// unchanged. Re-apply the same merge (idempotent: a catalog that
|
||||
// unchanged. Re-apply the same merge (idempotent: a catalogue that
|
||||
// failed to load merges to identity).
|
||||
catalog := b.catalogState()
|
||||
modelcatalog.Apply(&doc.Config, catalog)
|
||||
@@ -376,8 +376,8 @@ func (b *boot) applyRuntimeResourceUpdate(ctx context.Context, kind string, upda
|
||||
}
|
||||
}
|
||||
base := b.cfgHolder.Get()
|
||||
// Boot publishes before the model catalog is merged in, so the snapshot
|
||||
// this read returns can lack the catalog's model limits and discovered
|
||||
// Boot publishes before the model catalogue is merged in, so the snapshot
|
||||
// this read returns can lack the catalogue's model limits and discovered
|
||||
// providers. The merge is idempotent, and reloadConfig re-applies it
|
||||
// before layering for the same reason.
|
||||
catalog := b.catalogState()
|
||||
|
||||
@@ -194,7 +194,7 @@ func Run() int { //nolint:cyclop,funlen // the composition root's setup sequence
|
||||
go presence.Run(ctx, b.processName, servicekit.Build(), ps, b.healthRegistry, b.log)
|
||||
b.reportBrokerPresence(ctx, ps)
|
||||
}
|
||||
// The daemon publishes the configuration view, which carries the catalog's
|
||||
// The daemon publishes the configuration view, which carries the catalogue's
|
||||
// model limits.
|
||||
b.startModelCatalogRefresh(ctx)
|
||||
b.buildWorktreeManager()
|
||||
|
||||
@@ -31,7 +31,7 @@ func stepVocabulary() (*workflow.Manager, error) { return workflowsteps.NewManag
|
||||
// (main.go's Run) before buildDaemon captures the client.
|
||||
//
|
||||
// It is deliberately not part of openStateStoreAdapter, which the gateway root
|
||||
// shares: the gateway reads catalog, runtime settings and SOUL, never a
|
||||
// shares: the gateway reads catalogue, runtime settings and SOUL, never a
|
||||
// workflow definition, so registering a vocabulary there would be the dead
|
||||
// vocabulary this shape removed from internal/app/archiemessaging -- a root that
|
||||
// cannot consume it must not be failed by it.
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
// chatModelManager owns the model selection for interactive chat. Named
|
||||
// aliases remain defaults; choosing a catalog model does not rewrite them
|
||||
// aliases remain defaults; choosing a catalogue model does not rewrite them
|
||||
// or affect workflow steps.
|
||||
type chatModelManager struct {
|
||||
mu sync.RWMutex
|
||||
@@ -43,7 +43,7 @@ func (m *chatModelManager) SetConfigured(aliases map[string]string) {
|
||||
}
|
||||
|
||||
// SetModelCatalog replaces the provider display names and per-model details
|
||||
// the catalog publishes.
|
||||
// the catalogue publishes.
|
||||
func (m *chatModelManager) SetModelCatalog(snapshot modelcatalog.Snapshot) {
|
||||
m.mu.Lock()
|
||||
defer m.mu.Unlock()
|
||||
@@ -174,7 +174,7 @@ func (m *chatModelManager) ModelFor(ctx context.Context) (string, error) {
|
||||
}
|
||||
|
||||
// refsLocked keeps tenant choices within their assigned aliases; the system
|
||||
// org can also select from its credential-filtered provider catalog.
|
||||
// org can also select from its credential-filtered provider catalogue.
|
||||
func (m *chatModelManager) refsLocked(id org.OrgID, aliases map[string]string) []string {
|
||||
if id != org.DefaultOrgID {
|
||||
return chatModelRefs(aliases, nil)
|
||||
|
||||
@@ -200,7 +200,7 @@ func (m *preparedChatTurnModel) Generate(
|
||||
// This is one provider response's output allowance, not a turn-
|
||||
// continuation budget. Tool loops remain free to continue. The ai-sdk
|
||||
// runtime picks max_completion_tokens or max_tokens from the model's
|
||||
// catalog metadata.
|
||||
// catalogue metadata.
|
||||
options.MaxTokens = request.MaxOutputTokens
|
||||
// A runtime swapped to nil -- a live update that left no usable provider
|
||||
// configured -- is a refused turn, not a panic.
|
||||
|
||||
@@ -93,7 +93,7 @@ func (s curatorEventSink) Emit(kind, detail string, data map[string]any) {
|
||||
|
||||
// actingPrincipal resolves the identity the instance acts as for automated
|
||||
// work (the default chat identity, falling back to the bot user), so curator
|
||||
// passes authorize guarded tools exactly as that identity would.
|
||||
// passes authorise guarded tools exactly as that identity would.
|
||||
func (b *server) actingPrincipal(ctx context.Context) (access.Principal, error) {
|
||||
name := b.defaultChatIdentity
|
||||
if name == "" {
|
||||
|
||||
@@ -260,7 +260,7 @@ func (b *server) waitForNATSEndpoint(ctx context.Context) (servicekit.NATSEndpoi
|
||||
|
||||
func (b *server) catalogState() modelcatalog.Snapshot { return b.catalog.State() }
|
||||
|
||||
// loadCatalog layers the model catalog under the running config. A catalog
|
||||
// loadCatalog layers the model catalogue under the running config. A catalogue
|
||||
// that cannot be read leaves the configured providers and models in effect.
|
||||
func (b *server) loadCatalog(ctx context.Context) {
|
||||
snapshot, err := b.catalog.Fetch(ctx, b.secrets.Getenv, b.cfg.Providers)
|
||||
|
||||
@@ -70,7 +70,7 @@ func (b *server) refreshSkills(ctx context.Context, applied *string) {
|
||||
}
|
||||
|
||||
// storedSkills reads the skills resource, leaving out any name already in
|
||||
// have. An unreadable resource leaves the running catalog in place.
|
||||
// have. An unreadable resource leaves the running catalogue in place.
|
||||
func (b *server) storedSkills(ctx context.Context, have []skill.CatalogEntry) ([]skill.CatalogEntry, int64, error) {
|
||||
var out []skill.CatalogEntry
|
||||
version, _, err := b.controlPlane.Query(ctx, controlplanestore.SkillsKind, func(value []byte) error {
|
||||
|
||||
@@ -27,7 +27,7 @@ type ServiceTarget struct {
|
||||
|
||||
// Options is the UI-owned input DTO. It carries process-local settings and
|
||||
// endpoint references only -- there is deliberately no config.Config,
|
||||
// config.Holder, forge credential, model catalog or workflow routing field
|
||||
// config.Holder, forge credential, model catalogue or workflow routing field
|
||||
// for daemon configuration to arrive through.
|
||||
type Options struct {
|
||||
// Config and Overlay name the configuration source the process reads a
|
||||
|
||||
@@ -219,7 +219,7 @@ type Budgets struct {
|
||||
TaskWallClock Duration `toml:"task_wall_clock" json:"task_wall_clock" yaml:"task_wall_clock"`
|
||||
}
|
||||
|
||||
// Provider configures one LLM provider for the runtime catalog.
|
||||
// Provider configures one LLM provider for the runtime catalogue.
|
||||
type Provider struct {
|
||||
Class string `toml:"class" yaml:"class" json:"class"`
|
||||
APIKeyEnv string `toml:"api_key_env" yaml:"api_key_env" json:"api_key_env"`
|
||||
@@ -228,7 +228,7 @@ type Provider struct {
|
||||
// Disabled marks a configured provider whose api_key could not be
|
||||
// resolved at boot. It is runtime state, not a setting: without it a
|
||||
// disabled provider is indistinguishable from one the operator never
|
||||
// configured, and the model catalog would serve it from an ambient
|
||||
// configured, and the model catalogue would serve it from an ambient
|
||||
// environment variable.
|
||||
Disabled bool `toml:"-" yaml:"-" json:"-"`
|
||||
}
|
||||
@@ -246,7 +246,7 @@ type Dispatch struct {
|
||||
// issues), "label" (poll labelled issues), or "either" (both).
|
||||
Trigger string `toml:"trigger" json:"trigger" yaml:"trigger"`
|
||||
// AckReaction is the emoji reaction posted on issue pickup. Set
|
||||
// ack_reaction = "off" in TOML to disable it; Load normalizes that
|
||||
// ack_reaction = "off" in TOML to disable it; Load normalises that
|
||||
// sentinel to an empty string for callers.
|
||||
AckReaction string `toml:"ack_reaction" json:"ack_reaction" yaml:"ack_reaction"`
|
||||
}
|
||||
@@ -468,7 +468,7 @@ type ModelLimits struct {
|
||||
ContextWindow int `json:"context_window"`
|
||||
MaxOutputTokens int `json:"max_output_tokens"`
|
||||
// Reasoning marks a reasoning-class model. It is derived from the model
|
||||
// catalog (never operator-authored) and carried to the agent worker so a
|
||||
// catalogue (never operator-authored) and carried to the agent worker so a
|
||||
// task-scoped MCP sampling request omits the max-token bound those models
|
||||
// reject, exactly as the daemon's chat path does.
|
||||
Reasoning bool `json:"reasoning,omitempty"`
|
||||
@@ -517,7 +517,7 @@ func (c Config) ForTask() TaskConfig {
|
||||
|
||||
// aliasedModelLimits keeps the limits of the models an alias can resolve to.
|
||||
// Workflows reach a model only through Models, so the rest of the provider
|
||||
// catalog would only bloat every attempt's captured configuration.
|
||||
// catalogue would only bloat every attempt's captured configuration.
|
||||
func (c Config) aliasedModelLimits() map[string]ModelLimits {
|
||||
var out map[string]ModelLimits
|
||||
for _, ref := range c.Models {
|
||||
@@ -739,7 +739,7 @@ type ContainerConfig struct {
|
||||
// at startup rather than at the first failed pull.
|
||||
Image string `toml:"image" yaml:"image"`
|
||||
// MaxConcurrency limits simultaneous daemon tasks and containers.
|
||||
// Tasks from the same repository remain serialized. 0 = no limit.
|
||||
// Tasks from the same repository remain serialised. 0 = no limit.
|
||||
MaxConcurrency int `toml:"max_concurrency" yaml:"max_concurrency"`
|
||||
// MaxUptime caps a container's lifetime before recycling.
|
||||
MaxUptime Duration `toml:"max_uptime" yaml:"max_uptime"`
|
||||
|
||||
@@ -35,7 +35,7 @@ type TaskTransport interface {
|
||||
}
|
||||
|
||||
// RunCredentialIssuer issues the one credential a task's container holds: it
|
||||
// authorizes the task's own State Store calls and the push of its branch.
|
||||
// authorises the task's own State Store calls and the push of its branch.
|
||||
// It lapses at the task's time limit plus a margin if never revoked.
|
||||
type RunCredentialIssuer interface {
|
||||
Issue(ctx context.Context, task *workflow.Task, limit time.Duration) (token string, revoke func(), err error)
|
||||
|
||||
@@ -58,7 +58,7 @@ func (d *Daemon) adoptWorkflowIdentity(ctx context.Context, task *workflow.Task)
|
||||
}
|
||||
|
||||
// declaredIdentity resolves a workflow's declared identity to the ID it is
|
||||
// authorized as and the name the task carries while it runs.
|
||||
// authorised as and the name the task carries while it runs.
|
||||
func (g *IdentityGate) declaredIdentity(ctx context.Context, task *workflow.Task, ref string) (identity.IdentityID, string, error) {
|
||||
value, err := g.databaseExecutionIdentity(ctx, task, identity.IdentityID(ref))
|
||||
if err != nil {
|
||||
|
||||
@@ -132,7 +132,7 @@ type Usage struct {
|
||||
}
|
||||
|
||||
// Provider describes how the worker resolves a model provider. API keys are
|
||||
// referenced by environment variable name and never serialized.
|
||||
// referenced by environment variable name and never serialised.
|
||||
type Provider struct {
|
||||
Class string `json:"class"`
|
||||
APIKeyEnv string `json:"api_key_env,omitempty"`
|
||||
|
||||
@@ -109,7 +109,7 @@ func NormalizeLimit(limit int) int {
|
||||
return limit
|
||||
}
|
||||
|
||||
// Hash is the fingerprint of the normalized filter a cursor is bound to. A
|
||||
// Hash is the fingerprint of the normalised filter a cursor is bound to. A
|
||||
// cursor replayed with a different filter would resume at a position that no
|
||||
// longer means the same page, so the reader refuses it.
|
||||
func (f *Filter) Hash() string {
|
||||
|
||||
@@ -91,7 +91,7 @@ type ToolBuilder interface {
|
||||
}
|
||||
|
||||
// SkillStore is the skill-maintenance capability. The implementation owns
|
||||
// the on-disk format and catalog reload rules.
|
||||
// the on-disk format and catalogue reload rules.
|
||||
type SkillStore interface {
|
||||
List(ctx context.Context) ([]SkillRef, error)
|
||||
Read(ctx context.Context, name string) (Skill, error)
|
||||
|
||||
@@ -30,7 +30,7 @@ type RuntimeConfig struct {
|
||||
// defaultPassTimeout (10m).
|
||||
PassTimeout time.Duration
|
||||
// MaxConcurrentPasses caps simultaneous passes across all curators.
|
||||
// Zero uses 1: passes serialize behind a shared slot so a pass burst
|
||||
// Zero uses 1: passes serialise behind a shared slot so a pass burst
|
||||
// can never saturate the model runtime against chat turns.
|
||||
MaxConcurrentPasses int
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ type SubjectBinding interface {
|
||||
BindSubject(context.Context, IdentityID, Subject, Audit) error
|
||||
}
|
||||
|
||||
// LoginFlow is the browser authorization flow an identity provider requires, as
|
||||
// LoginFlow is the browser authorisation flow an identity provider requires, as
|
||||
// a dashboard driving it needs it: the URL to send a browser to, then the
|
||||
// completion of the flow when the browser returns. It is a contract here rather
|
||||
// than in the transport because what it yields is an identity.
|
||||
@@ -83,7 +83,7 @@ type SubjectResolver interface {
|
||||
ClaimSubject(ctx context.Context, placeholder, subject Subject) (Identity, error)
|
||||
}
|
||||
|
||||
// ProviderSession is what a completed authorization flow yields: the credential
|
||||
// ProviderSession is what a completed authorisation flow yields: the credential
|
||||
// the provider proved, and the provider's own token to present on later requests.
|
||||
// Archie holds no session of its own -- the token belongs to the provider and is
|
||||
// re-verified on every later request, so nothing archie stores can outlive it.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package messaging
|
||||
|
||||
// ModelDetails carries read-only catalog metadata for one model reference.
|
||||
// ModelDetails carries read-only catalogue metadata for one model reference.
|
||||
type ModelDetails struct {
|
||||
Ref string `json:"ref"`
|
||||
Name string `json:"name,omitempty"`
|
||||
@@ -14,7 +14,7 @@ type ModelDetails struct {
|
||||
}
|
||||
|
||||
// DetailedModelManager optionally enriches model selection confirmation with
|
||||
// catalog metadata such as context window and modalities.
|
||||
// catalogue metadata such as context window and modalities.
|
||||
type DetailedModelManager interface {
|
||||
ModelDetails(ref string) (ModelDetails, bool)
|
||||
}
|
||||
@@ -25,7 +25,7 @@ var (
|
||||
ErrUnavailable = errors.New("runtime task control is unavailable")
|
||||
)
|
||||
|
||||
// Task is the state needed to authorize and apply an operator action.
|
||||
// Task is the state needed to authorise and apply an operator action.
|
||||
type Task struct {
|
||||
Org org.OrgID
|
||||
ID int64
|
||||
|
||||
@@ -68,7 +68,7 @@ func ReportWindow(days int, now time.Time) (from, to time.Time) {
|
||||
|
||||
// TotalRow is one cell of a usage report: the day, source and model an org's
|
||||
// calls used and the tokens they spent. Cost is not carried; the reader
|
||||
// prices the tokens against the model catalog.
|
||||
// prices the tokens against the model catalogue.
|
||||
type TotalRow struct {
|
||||
Day string
|
||||
Source Source
|
||||
|
||||
@@ -90,7 +90,7 @@ type Task struct {
|
||||
// Identity is the identity that created this task: a chat user, the
|
||||
// polling identity, a calling workflow's declared identity, or System for
|
||||
// instance-level work. Never empty. Used to scope /approve and
|
||||
// /cancel authorization so one identity cannot control another's
|
||||
// /cancel authorisation so one identity cannot control another's
|
||||
// chat-spawned tasks. While the daemon processes the task it holds the
|
||||
// identity the workflow declares, which is never stored here.
|
||||
Identity string `json:"identity"`
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
workflowtask "github.com/samcharles93/archie-core/internal/domain/workflow/task"
|
||||
)
|
||||
|
||||
// ReviewTaskLookup is the authorization query review reactions require.
|
||||
// ReviewTaskLookup is the authorisation query review reactions require.
|
||||
type ReviewTaskLookup interface {
|
||||
OpenTaskByPR(ctx context.Context, owner, repo string, number int) (*workflowtask.Task, error)
|
||||
}
|
||||
@@ -60,7 +60,7 @@ func SubjectFor(identity, base string) string {
|
||||
return "archie.forge." + string(domainidentity.StableID(identity)) + "." + strings.TrimPrefix(base, "archie.forge.")
|
||||
}
|
||||
|
||||
// Target is what every request acts on and the credential that authorizes
|
||||
// Target is what every request acts on and the credential that authorises
|
||||
// it: the run credential of the task asking, which only reaches that task's
|
||||
// own repository.
|
||||
type Target struct {
|
||||
|
||||
@@ -27,7 +27,7 @@ func (r runsByToken) TaskForCredential(_ context.Context, token string) (*workfl
|
||||
return nil, errors.New("unknown")
|
||||
}
|
||||
|
||||
// TestForgeCallStaysInItsRunsAuthority pins that a forge call is authorized
|
||||
// TestForgeCallStaysInItsRunsAuthority pins that a forge call is authorised
|
||||
// only by a live run credential, on its identity's server, for its own
|
||||
// repository, and for a package's workflow only within the forge permissions
|
||||
// accepted for that package.
|
||||
|
||||
@@ -63,7 +63,7 @@ func CompressionConfigForModel(details ModelDetails, promptReserve int) (Compres
|
||||
cfg := DefaultCompressionConfig()
|
||||
if details.ContextWindow <= 0 {
|
||||
// ModelDetails is an optional extension on ModelManager. Preserve
|
||||
// compatibility for minimal adapters, while production catalog-backed
|
||||
// compatibility for minimal adapters, while production catalogue-backed
|
||||
// managers still take the model-specific path below.
|
||||
cfg.MaxPromptTokens = max(cfg.ContextWindow-max(promptReserve, 0), 1)
|
||||
return cfg, nil
|
||||
|
||||
@@ -52,7 +52,7 @@ type LLMStreamResponder func(ctx context.Context, in Inbound, stream TurnStream)
|
||||
|
||||
// ModelManager provides access to available models and allows switching the
|
||||
// active LLM model. The daemon supplies an implementation backed by its
|
||||
// runtime provider catalog. When nil on a Router, /model returns a
|
||||
// runtime provider catalogue. When nil on a Router, /model returns a
|
||||
// "not configured" message.
|
||||
type ModelManager interface {
|
||||
ModelsFor(ctx context.Context) ([]string, error)
|
||||
@@ -61,11 +61,11 @@ type ModelManager interface {
|
||||
SetActiveModel(ctx context.Context, selection string) error
|
||||
}
|
||||
|
||||
// ModelDetails is the catalog metadata rendered after an interactive model
|
||||
// selection. Limits are zero when the upstream catalog does not publish them.
|
||||
// ModelDetails is the catalogue metadata rendered after an interactive model
|
||||
// selection. Limits are zero when the upstream catalogue does not publish them.
|
||||
type ModelDetails = messaging.ModelDetails
|
||||
|
||||
// DetailedModelManager is the optional catalog-aware extension used by rich
|
||||
// DetailedModelManager is the optional catalogue-aware extension used by rich
|
||||
// model selectors. Runtime routing remains on ModelManager.
|
||||
type DetailedModelManager interface {
|
||||
ModelManager
|
||||
@@ -300,8 +300,8 @@ func (r *Router) route(ctx context.Context, in Inbound) (string, error) {
|
||||
return reply, err
|
||||
}
|
||||
|
||||
// dispatchLocal handles recognized local commands. Returns (reply,
|
||||
// true) when the command was recognized and handled.
|
||||
// dispatchLocal handles recognised local commands. Returns (reply,
|
||||
// true) when the command was recognised and handled.
|
||||
func (r *Router) dispatchLocal(ctx context.Context, msg messaging.Message, platform, text, cmd string) (string, bool, error) {
|
||||
rest := restAfter(text, cmd, r.gatewayName)
|
||||
|
||||
@@ -344,7 +344,7 @@ func (r *Router) dispatchLocal(ctx context.Context, msg messaging.Message, platf
|
||||
return r.dispatchLocalMisc(ctx, msg, platform, cmd, rest)
|
||||
}
|
||||
|
||||
// dispatchLocalMisc handles the remaining recognized local commands not
|
||||
// dispatchLocalMisc handles the remaining recognised local commands not
|
||||
// covered by dispatchLocal's first switch. Split out to keep cyclomatic
|
||||
// complexity down.
|
||||
func (r *Router) dispatchLocalMisc(ctx context.Context, msg messaging.Message, platform, cmd, rest string) (string, bool, error) {
|
||||
@@ -861,7 +861,7 @@ func formatStatus(ctx context.Context, counts map[string]int, report HealthRepor
|
||||
return b.String()
|
||||
}
|
||||
|
||||
// formatQueueDepth summarizes in-flight work as one line: how many tasks
|
||||
// formatQueueDepth summarises in-flight work as one line: how many tasks
|
||||
// are running, waiting on a human reply, or parked. Queued and terminal
|
||||
// states are excluded -- neither is a health concern an operator needs
|
||||
// /status to surface.
|
||||
|
||||
@@ -18,7 +18,7 @@ const (
|
||||
defaultSessionListLimit = 20
|
||||
|
||||
// maxSessionListLimit bounds what the model can ask for. A chat that has
|
||||
// churned for months could otherwise land its whole session catalog in the
|
||||
// churned for months could otherwise land its whole session catalogue in the
|
||||
// context window whole.
|
||||
maxSessionListLimit = 100
|
||||
|
||||
@@ -120,7 +120,7 @@ func sessionListTool(store SessionStore, platform, channelID string) tools.ToolE
|
||||
if len(all) > limit {
|
||||
all = all[:limit]
|
||||
}
|
||||
// Non-nil even when empty: an empty catalog is an answer, and a
|
||||
// Non-nil even when empty: an empty catalogue is an answer, and a
|
||||
// null would read to the model as a failed call worth retrying.
|
||||
sessions := make([]ChatSessionEntry, 0, len(all))
|
||||
for _, s := range all {
|
||||
@@ -361,7 +361,7 @@ func sessionTranscriptTool(store SessionStore, platform, channelID string) tools
|
||||
return nil, fmt.Errorf("session_transcript: %w", err)
|
||||
}
|
||||
|
||||
// Serialize to JSON
|
||||
// Serialise to JSON
|
||||
data, err := json.MarshalIndent(messages, "", " ")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("session_transcript: %w", err)
|
||||
|
||||
@@ -95,7 +95,7 @@ func splitOwnerRepo(s string) (owner, repo string, ok bool) {
|
||||
}
|
||||
|
||||
// ChatTaskStatus is the minimal task state StoreTaskController needs to
|
||||
// authorize and validate /approve and /cancel.
|
||||
// authorise and validate /approve and /cancel.
|
||||
type ChatTaskStatus struct {
|
||||
Status string
|
||||
Identity string
|
||||
|
||||
@@ -20,7 +20,7 @@ type TurnPrepareContext struct {
|
||||
Model string
|
||||
Extra []tools.ToolEntry
|
||||
ContextWindow int
|
||||
// Reasoning reports the catalog's class for the active model. It rides
|
||||
// Reasoning reports the catalogue's class for the active model. It rides
|
||||
// the prepare context because the seam that translates a provider-neutral
|
||||
// request into provider options is the only place that knows the wire
|
||||
// parameter differs by class.
|
||||
|
||||
@@ -95,7 +95,7 @@ func (rc *Receiver) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// Resolved before the delivery check so the check runs against the
|
||||
// source's owning org, not always the default org. An unknown source
|
||||
// authorizes as the default org.
|
||||
// authorises as the default org.
|
||||
src := rc.resolveSource(r, path)
|
||||
|
||||
if code := rc.refusal(r, path, orgOf(src)); code != 0 {
|
||||
@@ -191,7 +191,7 @@ func (rc *Receiver) refusal(r *http.Request, path string, owner org.OrgID) int {
|
||||
}
|
||||
|
||||
// orgOf reports the org that owns src, or the default org when the source
|
||||
// is unknown: an unknown source has no owner to authorize against.
|
||||
// is unknown: an unknown source has no owner to authorise against.
|
||||
func orgOf(src *source.Source) org.OrgID {
|
||||
if src == nil || src.OrgID == "" {
|
||||
return org.DefaultOrgID
|
||||
|
||||
@@ -100,7 +100,7 @@ func TestPutDraftAttributesTheCaller(t *testing.T) {
|
||||
|
||||
// TestStepTypesReadsTheServedVocabulary pins the catalogue's production
|
||||
// reader: StepTypes returns the x-step-types extension of the
|
||||
// workflow-definitions descriptor the control plane's catalog serves, the
|
||||
// workflow-definitions descriptor the control plane's catalogue serves, the
|
||||
// payload the dashboard workflow editor and the workflow_step_types tool
|
||||
// consume, and it reports an absent catalogue or an unavailable control
|
||||
// plane rather than inventing an empty one.
|
||||
|
||||
@@ -29,7 +29,7 @@ func TestInstanceOnlyKindsRefuseOtherOrgs(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestCatalogHidesInstanceOnlyKinds pins what the catalog advertises: the
|
||||
// TestCatalogHidesInstanceOnlyKinds pins what the catalogue advertises: the
|
||||
// system org sees an instance setting, another org does not (its write would
|
||||
// be refused), and an org-scoped kind stays visible to both.
|
||||
func TestCatalogHidesInstanceOnlyKinds(t *testing.T) {
|
||||
|
||||
@@ -44,7 +44,7 @@ func operationalDefinitions() []Definition {
|
||||
// Restart-required: the Messaging Service, which owns the channel
|
||||
// transports, reconciles them live and archied re-layers each update, but
|
||||
// the Gateway's chat surfaces (workspace tools, rate limit, model
|
||||
// catalogs) are boot-built, so a change cannot promise live apply
|
||||
// catalogues) are boot-built, so a change cannot promise live apply
|
||||
// everywhere the record reports it.
|
||||
{Kind: ChannelSettingsKind, Title: "Channel settings", ApplyMode: "restart-required", Document: channelSettings{}, Seed: seedChannels, Validate: validateChannels, Normalize: normalizeChannels},
|
||||
{Kind: SchedulingPolicyKind, Title: "Scheduling policy", ApplyMode: "live", Document: schedulingPolicy{}, Seed: func(cfg config.Config) any {
|
||||
|
||||
@@ -35,7 +35,7 @@ type CalloutOptions struct {
|
||||
Tasks TaskAuthority
|
||||
}
|
||||
|
||||
// Callout is the authorization service of an external broker.
|
||||
// Callout is the authorisation service of an external broker.
|
||||
type Callout struct {
|
||||
svc *callout.AuthorizationService
|
||||
nc *natsio.Conn
|
||||
|
||||
@@ -61,7 +61,7 @@ func StartEmbedded(ctx context.Context, opts EmbeddedOptions, log *slog.Logger)
|
||||
Port: opts.Port,
|
||||
JetStream: true,
|
||||
StoreDir: opts.StoreDir,
|
||||
// Replaces token authorization: the instance token and task users
|
||||
// Replaces token authorisation: the instance token and task users
|
||||
// are both checked here.
|
||||
CustomClientAuthentication: authenticator{token: token, tasks: opts.Tasks},
|
||||
NoSigs: true, // the daemon owns signals, not the embedded server
|
||||
|
||||
@@ -55,7 +55,7 @@ func (p *pendingAsks) answer(id, answer string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// remoteAsker poses a turn's questions on its stream. send is serialized with
|
||||
// remoteAsker poses a turn's questions on its stream. send is serialised with
|
||||
// the turn's own frames by the caller.
|
||||
type remoteAsker struct {
|
||||
pending *pendingAsks
|
||||
|
||||
@@ -43,7 +43,7 @@ type CuratorAction struct {
|
||||
}
|
||||
|
||||
// Catalog supplies the process-owned runtime surfaces the dashboard reads over
|
||||
// ChatService. A zero Catalog answers empty lists and an Unavailable reload,
|
||||
// ChatService. A zero Catalogue answers empty lists and an Unavailable reload,
|
||||
// which is the honest answer from a process that hosts none of them.
|
||||
type Catalog struct {
|
||||
// CheckSecret reports whether ref resolves; an error means the engine
|
||||
@@ -55,7 +55,7 @@ type Catalog struct {
|
||||
ReloadChannel func(context.Context, string) error
|
||||
}
|
||||
|
||||
// CatalogClient is the subset of the Gateway client the dashboard's catalog
|
||||
// CatalogClient is the subset of the Gateway client the dashboard's catalogue
|
||||
// surfaces consume.
|
||||
type CatalogClient interface {
|
||||
CheckSecret(context.Context, secret.SecretRef) (bool, error)
|
||||
|
||||
@@ -30,9 +30,9 @@ type server struct {
|
||||
fetch *http.Client
|
||||
}
|
||||
|
||||
// RegisterServer serves the Gateway chat contract. catalog supplies the
|
||||
// RegisterServer serves the Gateway chat contract. catalogue supplies the
|
||||
// process-owned runtime surfaces (skill catalogue, curator registry, channel
|
||||
// reload) the dashboard reads over the same contract; a zero Catalog answers
|
||||
// reload) the dashboard reads over the same contract; a zero Catalogue answers
|
||||
// empty lists and an Unavailable reload.
|
||||
func RegisterServer(registrar grpc.ServiceRegistrar, chat messaging.ChatContract, sessions messaging.SessionStore, catalog Catalog) {
|
||||
pb.RegisterChatServiceServer(registrar, &server{chat: chat, sessions: sessions, catalog: catalog, fetch: publicnet.Client(10*time.Second, 15*time.Second)})
|
||||
|
||||
@@ -107,14 +107,14 @@ func (s *Store) MaxBytes() int {
|
||||
return s.maxBytes
|
||||
}
|
||||
|
||||
// Render returns the current serialized document. Safe for concurrent use.
|
||||
// Render returns the current serialised document. Safe for concurrent use.
|
||||
func (s *Store) Render() string {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
return renderSections(s.preamble, s.sections)
|
||||
}
|
||||
|
||||
// Size returns the current serialized document length in bytes.
|
||||
// Size returns the current serialised document length in bytes.
|
||||
func (s *Store) Size() int {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
@@ -267,7 +267,7 @@ func (s *Store) Remove(sectionName, substring string, caseSensitive bool) (Remov
|
||||
rendered := renderSections(s.preamble, candidate)
|
||||
// Removal only ever shrinks the file, but a bound check is kept for
|
||||
// consistency with Add/Replace and to guard against pathological
|
||||
// preamble/header growth from re-serialization.
|
||||
// preamble/header growth from re-serialisation.
|
||||
if len(rendered) > s.maxBytes {
|
||||
return RemoveResult{}, fmt.Errorf("builtin: remove from section %q would exceed max file size (%d > %d bytes)", sectionName, len(rendered), s.maxBytes)
|
||||
}
|
||||
@@ -350,7 +350,7 @@ func splitBlocks(lines []string) []string {
|
||||
return blocks
|
||||
}
|
||||
|
||||
// renderSections serializes a preamble and ordered sections back into the
|
||||
// renderSections serialises a preamble and ordered sections back into the
|
||||
// on-disk markdown format.
|
||||
func renderSections(preamble string, sections []*section) string {
|
||||
var sb strings.Builder
|
||||
@@ -383,7 +383,7 @@ func renderSections(preamble string, sections []*section) string {
|
||||
return sb.String()
|
||||
}
|
||||
|
||||
// sectionChars returns the serialized character count of a single section's
|
||||
// sectionChars returns the serialised character count of a single section's
|
||||
// body (blocks only, joined as they would appear on disk).
|
||||
func sectionChars(sec *section) int {
|
||||
return len(strings.Join(sec.blocks, "\n\n"))
|
||||
|
||||
@@ -12,10 +12,10 @@ import (
|
||||
"github.com/samcharles93/archie-core/internal/secret"
|
||||
)
|
||||
|
||||
// RefreshInterval is how often a running service re-reads the catalog.
|
||||
// RefreshInterval is how often a running service re-reads the catalogue.
|
||||
const RefreshInterval = time.Hour
|
||||
|
||||
// Catalog holds the last model catalog a service loaded.
|
||||
// Catalog holds the last model catalogue a service loaded.
|
||||
type Catalog struct {
|
||||
cachePath string
|
||||
|
||||
@@ -23,7 +23,7 @@ type Catalog struct {
|
||||
snapshot Snapshot
|
||||
}
|
||||
|
||||
// NewCatalog caches the catalog beside the config file at cfgPath.
|
||||
// NewCatalog caches the catalogue beside the config file at cfgPath.
|
||||
func NewCatalog(cfgPath string) *Catalog {
|
||||
return &Catalog{cachePath: filepath.Join(filepath.Dir(cfgPath), "models.json")}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ func (c *Catalog) Set(snapshot Snapshot) {
|
||||
c.snapshot = snapshot
|
||||
}
|
||||
|
||||
// Fetch reads the catalog, resolving provider keys through getenv.
|
||||
// Fetch reads the catalogue, resolving provider keys through getenv.
|
||||
func (c *Catalog) Fetch(ctx context.Context, getenv func(string) string, configured map[string]config.Provider) (Snapshot, error) {
|
||||
return Load(ctx, Options{CachePath: c.cachePath, Getenv: getenv, Configured: configured})
|
||||
}
|
||||
@@ -63,8 +63,8 @@ func Every(ctx context.Context, interval time.Duration, fn func()) {
|
||||
}()
|
||||
}
|
||||
|
||||
// Apply layers the catalog's providers and model limits under cfg's
|
||||
// own and returns the catalog's model references, sorted.
|
||||
// Apply layers the catalogue's providers and model limits under cfg's
|
||||
// own and returns the catalogue's model references, sorted.
|
||||
func Apply(cfg *config.Config, snapshot Snapshot) []string {
|
||||
discovered := make(map[string]config.Provider, len(snapshot.Providers))
|
||||
limits := make(map[string]config.ModelLimits)
|
||||
|
||||
@@ -51,8 +51,8 @@ type Model struct {
|
||||
Cost Cost
|
||||
}
|
||||
|
||||
// Cost is a model's list price in USD per million tokens, as the catalog
|
||||
// publishes it. A zero field means the catalog published no price.
|
||||
// Cost is a model's list price in USD per million tokens, as the catalogue
|
||||
// publishes it. A zero field means the catalogue published no price.
|
||||
type Cost struct {
|
||||
Input float64 `json:"input,omitempty"`
|
||||
Output float64 `json:"output,omitempty"`
|
||||
@@ -78,7 +78,7 @@ func Load(ctx context.Context, opts Options) (Snapshot, error) {
|
||||
snapshot, parseErr := parse(raw, opts)
|
||||
if parseErr == nil {
|
||||
if opts.CachePath != "" {
|
||||
// The downloaded catalog is already usable. A cache persistence
|
||||
// The downloaded catalogue is already usable. A cache persistence
|
||||
// failure must not prevent startup with valid in-memory data.
|
||||
_ = writeCache(opts.CachePath, raw)
|
||||
}
|
||||
@@ -182,8 +182,8 @@ func usableProvider(key string, source catalogProvider, opts Options) (Provider,
|
||||
// providerCredentialEnv returns the environment variable whose value is the
|
||||
// provider's key, and whether the provider may be served at all. A configured
|
||||
// provider is disabled when its key failed to resolve and must never fall
|
||||
// back to the catalog's ambient environment, which would send a turn with a
|
||||
// key the operator did not choose: the catalog names the environment
|
||||
// back to the catalogue's ambient environment, which would send a turn with a
|
||||
// key the operator did not choose: the catalogue names the environment
|
||||
// variables it would use, and a configured provider overrides that with the
|
||||
// variable its own resolution exported.
|
||||
func providerCredentialEnv(configured bool, override config.Provider, source catalogProvider, getenv func(string) string) (string, bool) {
|
||||
|
||||
@@ -12,7 +12,7 @@ func envFrom(values map[string]string) func(string) string {
|
||||
return func(name string) string { return values[name] }
|
||||
}
|
||||
|
||||
// modelProvider is one catalog entry shaped so usableProvider keeps it: it
|
||||
// modelProvider is one catalogue entry shaped so usableProvider keeps it: it
|
||||
// drops any provider with no tool-calling model.
|
||||
func modelProvider(env []string) catalogProvider {
|
||||
return catalogProvider{
|
||||
@@ -96,7 +96,7 @@ func TestUsableProviderCredentials(t *testing.T) {
|
||||
|
||||
// TestMergeProvidersKeepsDisabled covers the other half of a disabled
|
||||
// provider's lifetime: Apply rewrites cfg.Providers through mergeProviders,
|
||||
// and a dropped flag would let the next catalog refresh serve the ambient key
|
||||
// and a dropped flag would let the next catalogue refresh serve the ambient key
|
||||
// again.
|
||||
func TestMergeProvidersKeepsDisabled(t *testing.T) {
|
||||
merged := mergeProviders(
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"github.com/samcharles93/archie-core/internal/domain/identity"
|
||||
)
|
||||
|
||||
// Flow runs the authorization code flow with PKCE, so a person signs in at the
|
||||
// Flow runs the authorisation code flow with PKCE, so a person signs in at the
|
||||
// provider and the dashboard learns who they are without archie ever seeing a
|
||||
// password, holding a session, or writing any of the protocol itself: discovery,
|
||||
// the code exchange, PKCE and token verification are the libraries'.
|
||||
|
||||
@@ -122,7 +122,7 @@ func (s *Store) ResolveLegacyName(ctx context.Context, name string) (identity.Id
|
||||
// Create inserts a new identity, its display-name alias and its create audit
|
||||
// event in one transaction. An agent is assigned in the same transaction to
|
||||
// the org the request acts in, with the shipped developer role, so it is
|
||||
// authorized as soon as it exists.
|
||||
// authorised as soon as it exists.
|
||||
func (s *Store) Create(ctx context.Context, value identity.Identity, audit identity.Audit) (identity.Identity, error) {
|
||||
return s.create(ctx, value, audit, value.Kind.Agent())
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ const (
|
||||
// required frontmatter field.
|
||||
ActionIncomplete = "skill.incomplete"
|
||||
// ActionNormalized records a skill whose content was rewritten by
|
||||
// whitespace normalization.
|
||||
// whitespace normalisation.
|
||||
ActionNormalized = "skill.normalized"
|
||||
)
|
||||
|
||||
@@ -88,7 +88,7 @@ func (c *Curator) Pass(ctx context.Context, in curator.PassInput) (curator.PassR
|
||||
return curator.PassResult{Actions: actions}, nil
|
||||
}
|
||||
|
||||
// reviewOne classifies one skill and writes back a normalized version when
|
||||
// reviewOne classifies one skill and writes back a normalised version when
|
||||
// possible. It returns at most one Action.
|
||||
func (c *Curator) reviewOne(ctx context.Context, name string) ([]curator.Action, error) {
|
||||
sk, err := c.host.Skills.Read(ctx, name)
|
||||
|
||||
@@ -49,7 +49,7 @@ type Runs interface {
|
||||
TaskForCredential(ctx context.Context, token string) (*workflow.Task, error)
|
||||
}
|
||||
|
||||
// Server delivers authorized requests through Deliver.
|
||||
// Server delivers authorised requests through Deliver.
|
||||
type Server struct {
|
||||
Runs Runs
|
||||
// Deliver sends through a channel the run's org owns.
|
||||
|
||||
@@ -71,7 +71,7 @@ func FromJSON(raw jsontext.Value) Payload {
|
||||
}
|
||||
|
||||
// Redact replaces every credential in a JSON value with a marker. A key that
|
||||
// names a credential is redacted whole; a value that reads as an authorization
|
||||
// names a credential is redacted whole; a value that reads as an authorisation
|
||||
// header is redacted wherever it appears. A payload that can't be decoded is
|
||||
// replaced rather than stored unchanged, because its credentials can't be
|
||||
// found.
|
||||
@@ -132,7 +132,7 @@ func sensitiveKey(key string) bool {
|
||||
return compact == "token" || strings.HasSuffix(compact, "token")
|
||||
}
|
||||
|
||||
// looksSecret reports whether a value is an authorization header, whatever
|
||||
// looksSecret reports whether a value is an authorisation header, whatever
|
||||
// key it arrived under.
|
||||
func looksSecret(value string) bool {
|
||||
s := strings.TrimSpace(value)
|
||||
|
||||
@@ -86,7 +86,7 @@ func Authorized[A, K ~string](action A, kind K) Access {
|
||||
return Access{kind: accessAuthorized, action: string(action), resource: string(kind)}
|
||||
}
|
||||
|
||||
// AdminAuthorized is Authorized for an operation that also needs an instance
|
||||
// AdminAuthorized is Authorised for an operation that also needs an instance
|
||||
// administrator, whatever the policy chain would allow.
|
||||
func AdminAuthorized[A, K ~string](action A, kind K) Access {
|
||||
a := Authorized(action, kind)
|
||||
@@ -94,7 +94,7 @@ func AdminAuthorized[A, K ~string](action A, kind K) Access {
|
||||
return a
|
||||
}
|
||||
|
||||
// Declared reports the action and resource kind an authorized operation is
|
||||
// Declared reports the action and resource kind an authorised operation is
|
||||
// decided on, and false for any other operation.
|
||||
func (a Access) Declared() (action, kind string, ok bool) {
|
||||
return a.action, a.resource, a.kind == accessAuthorized
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Archie is event-driven automation: events start workflows, workflows run agent and tool steps, and results can wait for review. A repository is one optional input to a workflow. Use this guide for product questions. Archie's own source code is not needed to answer them; code details need a file or tool lookup in an authorized workspace, so never invent a checkout or assume access to a repository.
|
||||
Archie is event-driven automation: events start workflows, workflows run agent and tool steps, and results can wait for review. A repository is one optional input to a workflow. Use this guide for product questions. Archie's own source code is not needed to answer them; code details need a file or tool lookup in an authorised workspace, so never invent a checkout or assume access to a repository.
|
||||
|
||||
Accounts and organisation:
|
||||
- The first visit creates the organisation, its first workspace, the instance URL and the first admin account.
|
||||
|
||||
@@ -132,7 +132,7 @@ func (s *Service) Check(ctx context.Context, recipient int64) (Snapshot, error)
|
||||
}
|
||||
|
||||
// Defer records only the exact versions the caller displayed. It refuses a
|
||||
// changed catalog rather than silently suppressing a release the user never saw.
|
||||
// changed catalogue rather than silently suppressing a release the user never saw.
|
||||
func (s *Service) Defer(ctx context.Context, recipient int64, expected Snapshot) error {
|
||||
if s == nil || s.Catalog == nil {
|
||||
return errors.New("update discovery is not configured")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Package secret provides a pluggable secrets-engine registry. Engines
|
||||
// resolve SecretRef values (engine + key) into strings, keeping credentials
|
||||
// out of config files and serialized worker contracts.
|
||||
// out of config files and serialised worker contracts.
|
||||
//
|
||||
// Only the "env" engine is compiled in. Every other backend is an extension
|
||||
// served over the secretengine.v1 gRPC surface and registered here while it
|
||||
|
||||
@@ -36,13 +36,13 @@ type CatalogEntry struct {
|
||||
Description string
|
||||
Workflow string // from metadata.archie.workflow -- which workflow this skill handles
|
||||
Dir string // skill directory name
|
||||
Root string // catalog root containing.agents/skills
|
||||
Root string // catalogue root containing.agents/skills
|
||||
// Body is the skill's instructions when they are held in memory rather
|
||||
// than in Dir under Root.
|
||||
Body string
|
||||
}
|
||||
|
||||
// EntryFromContent builds a catalog entry for a SKILL.md held in memory.
|
||||
// EntryFromContent builds a catalogue entry for a SKILL.md held in memory.
|
||||
func EntryFromContent(content []byte) (CatalogEntry, error) {
|
||||
fm, body, err := Parse(content)
|
||||
if err != nil {
|
||||
@@ -164,7 +164,7 @@ func normaliseRoot(root string) string {
|
||||
return filepath.Clean(root)
|
||||
}
|
||||
|
||||
// SkillForWorkflow returns the catalog entry whose Workflow field matches
|
||||
// SkillForWorkflow returns the catalogue entry whose Workflow field matches
|
||||
// the given workflow name, or nil if no skill declares that workflow.
|
||||
// Replaces hardcoded workflow→skill lookup tables.
|
||||
func SkillForWorkflow(catalog []CatalogEntry, workflow string) *CatalogEntry {
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"github.com/samcharles93/archie-core/internal/tools"
|
||||
)
|
||||
|
||||
// ActivateTool returns a single skill_activate tool over catalog, or nil when
|
||||
// the catalog is empty.
|
||||
// ActivateTool returns a single skill_activate tool over catalogue, or nil when
|
||||
// the catalogue is empty.
|
||||
func ActivateTool(dir string, catalog []CatalogEntry) *tools.ToolEntry {
|
||||
if len(catalog) == 0 {
|
||||
return nil
|
||||
|
||||
@@ -22,7 +22,7 @@ type Request struct {
|
||||
// transports, discover tools, and register them locally. Absent/empty
|
||||
// means no MCP servers (backward compatible).
|
||||
MCPServers []config.MCPServer `json:"mcp_servers,omitempty"`
|
||||
// RunCredential is the task's run credential: it authorizes the push of
|
||||
// RunCredential is the task's run credential: it authorises the push of
|
||||
// this task's branch and forge calls on its own repository. Repository
|
||||
// coordinates never cross back from the sandbox as authority.
|
||||
RunCredential string `json:"run_credential,omitempty"`
|
||||
|
||||
@@ -179,7 +179,7 @@ func ResolveRetryMode(mode string) (RetryMode, bool) {
|
||||
}
|
||||
|
||||
// RetryModeMeta describes how to present a retry mode. The dashboard renders
|
||||
// the operator's choice from this catalog rather than keeping its own copy.
|
||||
// the operator's choice from this catalogue rather than keeping its own copy.
|
||||
type RetryModeMeta struct {
|
||||
ID string `json:"id"`
|
||||
Label string `json:"label"`
|
||||
@@ -191,7 +191,7 @@ type RetryModeMeta struct {
|
||||
RequiresBranch bool `json:"requires_branch"`
|
||||
}
|
||||
|
||||
// RetryModes returns the presentation catalog for the retry modes, in display
|
||||
// RetryModes returns the presentation catalogue for the retry modes, in display
|
||||
// order. Callers receive a fresh slice.
|
||||
func RetryModes() []RetryModeMeta {
|
||||
return []RetryModeMeta{
|
||||
@@ -230,7 +230,7 @@ type ActionMeta struct {
|
||||
Confirm string `json:"confirm"` // optional confirm prompt, may be ""
|
||||
}
|
||||
|
||||
// Statuses returns the presentation catalog for every lifecycle status, in
|
||||
// Statuses returns the presentation catalogue for every lifecycle status, in
|
||||
// display order. Callers receive a fresh slice.
|
||||
func Statuses() []StatusMeta {
|
||||
return []StatusMeta{
|
||||
@@ -247,7 +247,7 @@ func Statuses() []StatusMeta {
|
||||
}
|
||||
}
|
||||
|
||||
// ActionCatalog returns the presentation catalog for every operator control.
|
||||
// ActionCatalog returns the presentation catalogue for every operator control.
|
||||
// Callers receive a fresh slice.
|
||||
func ActionCatalog() []ActionMeta {
|
||||
return []ActionMeta{
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
// MutationQueue serializes writes per file path. File mutations share a read
|
||||
// MutationQueue serialises writes per file path. File mutations share a read
|
||||
// lock; shell commands take the write lock.
|
||||
type MutationQueue struct {
|
||||
mu sync.Mutex
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// setProcessGroup configures cmd to start in a new process group on
|
||||
// Windows (see docs/specs/agents/02-spawning-and-lifecycle.md, Process
|
||||
// group management / Platform behavior).
|
||||
// group management / Platform behaviour).
|
||||
func setProcessGroup(cmd *exec.Cmd) {
|
||||
if cmd.SysProcAttr == nil {
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{}
|
||||
|
||||
@@ -78,7 +78,7 @@ func suggestPaths(cwd, missing string) string {
|
||||
// If the directory exists, its contents are the most useful answer: the
|
||||
// model had the location right and only the filename wrong. This is the
|
||||
// shape of the real misses (internal/theme/theme.go, where the directory
|
||||
// exists but holds colors.go), and it avoids the walk entirely.
|
||||
// exists but holds colours.go), and it avoids the walk entirely.
|
||||
if dir := filepath.Dir(missing); dir != "" {
|
||||
if suggestion := dirContentsSuggestion(cwd, dir); suggestion != "" {
|
||||
return suggestion
|
||||
|
||||
@@ -96,7 +96,7 @@ func makeShellExecutor(cwd string, mq *MutationQueue) Executor {
|
||||
}
|
||||
}
|
||||
|
||||
// Serialize with file-mutation tools: shell commands may modify
|
||||
// Serialise with file-mutation tools: shell commands may modify
|
||||
// files that write/edit are working on.
|
||||
if mq != nil {
|
||||
mq.GlobalLock()
|
||||
|
||||
@@ -2,7 +2,7 @@ package tools
|
||||
|
||||
import "strings"
|
||||
|
||||
// ToolClassification is a bitmask that describes a tool's behavioral
|
||||
// ToolClassification is a bitmask that describes a tool's behavioural
|
||||
// characteristics for dispatch gating, guardrail decisions, and per-result
|
||||
// limit enforcement.
|
||||
type ToolClassification int
|
||||
|
||||
@@ -363,7 +363,7 @@ func (g *ContextPressureGate) alwaysVisibleCopy() map[string]bool {
|
||||
|
||||
// totalSchemaSize estimates the total size in characters of the JSON
|
||||
// schema representations for the given tools. This is a conservative
|
||||
// estimate -- the actual serialized size may be slightly larger.
|
||||
// estimate -- the actual serialised size may be slightly larger.
|
||||
func totalSchemaSize(tools []ToolEntry) int {
|
||||
total := 0
|
||||
for _, e := range tools {
|
||||
|
||||
@@ -64,7 +64,7 @@ type Provider struct {
|
||||
connect Connector
|
||||
client *sdk.Client
|
||||
|
||||
// connectMu serializes connecting, so a slow handshake never holds mu.
|
||||
// connectMu serialises connecting, so a slow handshake never holds mu.
|
||||
connectMu sync.Mutex
|
||||
mu sync.Mutex
|
||||
// session is the live connection, or nil before Start, after Stop, and
|
||||
@@ -72,7 +72,7 @@ type Provider struct {
|
||||
session *sdk.ClientSession
|
||||
stopped bool
|
||||
|
||||
// callMu serializes tools/call unless the server opted into parallel
|
||||
// callMu serialises tools/call unless the server opted into parallel
|
||||
// calls. Nil allows concurrent calls.
|
||||
callMu *sync.Mutex
|
||||
|
||||
@@ -86,7 +86,7 @@ type Provider struct {
|
||||
}
|
||||
|
||||
// New creates an MCP tool provider. parallelToolCalls mirrors the configured
|
||||
// server's own flag: false (the default) serializes tools/call. A nil
|
||||
// server's own flag: false (the default) serialises tools/call. A nil
|
||||
// sampling handler leaves sampling unadvertised, so the SDK refuses it.
|
||||
func New(name string, connect Connector, parallelToolCalls bool, sampling SamplingHandler) *Provider {
|
||||
p := &Provider{
|
||||
|
||||
@@ -18,7 +18,7 @@ type JSONSchema map[string]any
|
||||
// Handler is the function signature for executing a tool. It receives the
|
||||
// caller-provided input (deserialized from JSON) and returns structured
|
||||
// output. The returned error is surfaced to the caller; the output is
|
||||
// serialized to JSON and included in the tool result.
|
||||
// serialised to JSON and included in the tool result.
|
||||
type Handler func(ctx context.Context, input map[string]any) (output any, err error)
|
||||
|
||||
// CheckFn is a predicate that determines whether a tool is currently
|
||||
@@ -48,7 +48,7 @@ type ToolEntry struct {
|
||||
// construct valid invocations. nil means no parameters.
|
||||
Schema JSONSchema `json:"schema,omitempty"`
|
||||
|
||||
// Handler executes the tool. It is a runtime field (not serialized).
|
||||
// Handler executes the tool. It is a runtime field (not serialised).
|
||||
// Must be non-nil for the tool to be functional.
|
||||
Handler Handler `json:"-"`
|
||||
|
||||
@@ -63,7 +63,7 @@ type ToolEntry struct {
|
||||
// (the check only matters at invocation time).
|
||||
RequiresEnv []string `json:"requires_env,omitempty"`
|
||||
|
||||
// Classification is a bitmask describing the tool's behavioral
|
||||
// Classification is a bitmask describing the tool's behavioural
|
||||
// characteristics (idempotent, mutating, etc.). Zero means no
|
||||
// special classification. See [ToolClassification] for valid flags.
|
||||
Classification ToolClassification `json:"classification,omitempty"`
|
||||
@@ -181,7 +181,7 @@ func deepCopyAny(v any) any {
|
||||
}
|
||||
|
||||
// MarshalJSON implements json.Marshaler, stripping runtime-only fields so
|
||||
// that a ToolEntry can be serialized for debugging without panicking on
|
||||
// that a ToolEntry can be serialised for debugging without panicking on
|
||||
// the function fields.
|
||||
func (e ToolEntry) MarshalJSON() ([]byte, error) {
|
||||
type wire ToolEntry // avoid recursion
|
||||
|
||||
@@ -110,7 +110,7 @@ func channelStateDetail(state status.State, configured bool) string {
|
||||
}
|
||||
|
||||
// ConfigView is the daemon's secret-free snapshot for dashboard handlers.
|
||||
// Only catalog and reload are exposed by /api/config.
|
||||
// Only catalogue and reload are exposed by /api/config.
|
||||
type ConfigView struct {
|
||||
SecretEngines []secret.EngineInfo `json:"secret_engines"`
|
||||
Identity IdentityView `json:"identity"`
|
||||
@@ -200,11 +200,11 @@ type ConfigViewInput struct {
|
||||
Config config.Config
|
||||
// Reload is the most recent reload outcome, or nil when unavailable.
|
||||
Reload *config.ReloadStatus
|
||||
// Catalog is the usable-provider catalog the configuration owner loaded.
|
||||
// Catalog is the usable-provider catalogue the configuration owner loaded.
|
||||
Catalog []CatalogProviderView
|
||||
}
|
||||
|
||||
// CatalogProviderView is one usable provider from the model catalog. It
|
||||
// CatalogProviderView is one usable provider from the model catalogue. It
|
||||
// names the environment variable its key was found in, never the key.
|
||||
type CatalogProviderView struct {
|
||||
ID string `json:"id"`
|
||||
@@ -214,12 +214,12 @@ type CatalogProviderView struct {
|
||||
BaseURL string `json:"base_url,omitempty"`
|
||||
Models []string `json:"models"`
|
||||
// Costs is each listed model's list price, keyed by model id. A model the
|
||||
// catalog did not price is absent, so a report shows tokens rather than a
|
||||
// catalogue did not price is absent, so a report shows tokens rather than a
|
||||
// guessed cost.
|
||||
Costs map[string]ModelCostView `json:"costs,omitempty"`
|
||||
}
|
||||
|
||||
// ModelCostView is one model's catalog list price in USD per million tokens.
|
||||
// ModelCostView is one model's catalogue list price in USD per million tokens.
|
||||
type ModelCostView struct {
|
||||
Input float64 `json:"input,omitempty"`
|
||||
Output float64 `json:"output,omitempty"`
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
// componentStatus is the per-component update status enum surfaced to the
|
||||
// dashboard: an operator scanning this list needs "is this component fine,
|
||||
// or does it need attention, and why" at a glance, not a bare color that
|
||||
// or does it need attention, and why" at a glance, not a bare colour that
|
||||
// means something different on every row.
|
||||
const (
|
||||
// statusOK means the running version matches what the check command
|
||||
|
||||
@@ -95,7 +95,7 @@ type auditRecordView struct {
|
||||
}
|
||||
|
||||
// auditSettingsKind is one control-plane resource kind and the title the
|
||||
// catalog gives it, so the dashboard labels a settings row without carrying
|
||||
// catalogue gives it, so the dashboard labels a settings row without carrying
|
||||
// its own copy of the vocabulary.
|
||||
type auditSettingsKind struct {
|
||||
Kind string `json:"kind"`
|
||||
@@ -493,7 +493,7 @@ func auditTime(value string) (time.Time, error) {
|
||||
}
|
||||
|
||||
// auditLabels resolves the display names one response needs. Actor names and
|
||||
// catalog titles are fetched once; workflow names are loaded only when a row
|
||||
// catalogue titles are fetched once; workflow names are loaded only when a row
|
||||
// actually targets a workflow.
|
||||
type auditLabels struct {
|
||||
actorName func(string) string
|
||||
@@ -513,7 +513,7 @@ func (l *auditLabels) workflow(id string) string {
|
||||
}
|
||||
|
||||
// auditLabels builds the label resolver and the settings-kind facet in one
|
||||
// catalog read. A failed catalog read degrades labels to their ids; it never
|
||||
// catalogue read. A failed catalogue read degrades labels to their ids; it never
|
||||
// fails the feed.
|
||||
func (a *auditAPI) auditLabels(ctx context.Context) (*auditLabels, []auditSettingsKind) {
|
||||
labels := &auditLabels{actorName: a.actorNames(ctx), titles: map[string]string{}}
|
||||
@@ -586,7 +586,7 @@ func auditTarget(entry audit.Entry, labels *auditLabels) auditTargetView {
|
||||
view := auditTargetView{Kind: entry.TargetKind, ID: entry.TargetID}
|
||||
switch entry.TargetKind {
|
||||
case "resource":
|
||||
// A settings row's id is the control-plane kind the catalog names.
|
||||
// A settings row's id is the control-plane kind the catalogue names.
|
||||
view.Label = labels.titles[entry.TargetID]
|
||||
case "task":
|
||||
if entry.TargetID != "" {
|
||||
|
||||
@@ -148,7 +148,7 @@ func (s *Server) bearerCredential(r *http.Request) (string, bool) {
|
||||
}
|
||||
|
||||
// handleLogin sends a browser to the provider with the audience requested at the
|
||||
// authorization endpoint, and keeps the state and PKCE verifier the callback needs
|
||||
// authorisation endpoint, and keeps the state and PKCE verifier the callback needs
|
||||
// in cookies scoped to the callback path.
|
||||
func (s *Server) handleLogin(w http.ResponseWriter, r *http.Request) {
|
||||
if s.Login == nil {
|
||||
|
||||
@@ -21,7 +21,7 @@ func (authorizationTasks) TaskByID(context.Context, int64) (*task.Task, error) {
|
||||
}
|
||||
|
||||
// These are the policy-governed HTTP surfaces. Protocol entry points and
|
||||
// private account resources have separate credential/ownership behavior tests.
|
||||
// private account resources have separate credential/ownership behaviour tests.
|
||||
func TestHTTPPolicyCannotBeBypassed(t *testing.T) {
|
||||
routes := []struct{ method, path string }{
|
||||
{"DELETE", "/api/access/policies"},
|
||||
|
||||
@@ -196,7 +196,7 @@ func ignoreNotFound(err, notFound error) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// refuseUngated answers a request the dashboard cannot authorize because no
|
||||
// refuseUngated answers a request the dashboard cannot authorise because no
|
||||
// policy chain is available. It serves nothing ungated: without a chain the
|
||||
// credential check would be the whole gate and every call would act as the
|
||||
// system org. The detailed health report names only the unloaded chain, so
|
||||
|
||||
@@ -276,7 +276,7 @@ func TestPersonalTokensWithoutPerson(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// sourcesIn serves GetSource, the one read authorization makes: one source
|
||||
// sourcesIn serves GetSource, the one read authorisation makes: one source
|
||||
// per path, in the workspace it names.
|
||||
type sourcesIn struct {
|
||||
storecontract.SourceStore
|
||||
|
||||
@@ -113,7 +113,7 @@ func (f *fakeOrgs) AssignAgent(_ context.Context, value org.AgentAssignment) err
|
||||
return nil
|
||||
}
|
||||
|
||||
// orgRoutes is the org mux behind the same credential and authorize wrappers
|
||||
// orgRoutes is the org mux behind the same credential and authorise wrappers
|
||||
// the real server mounts.
|
||||
func orgRoutes(s *Server) http.Handler {
|
||||
mux := http.NewServeMux()
|
||||
|
||||
@@ -95,7 +95,7 @@ func orgSchedule(id, orgID string) scheduling.Schedule {
|
||||
}
|
||||
}
|
||||
|
||||
// scheduleRoutes is the schedule mux behind the same credential and authorize
|
||||
// scheduleRoutes is the schedule mux behind the same credential and authorise
|
||||
// wrappers the real server mounts.
|
||||
func scheduleRoutes(s *Server) http.Handler {
|
||||
mux := http.NewServeMux()
|
||||
@@ -326,7 +326,7 @@ func TestScheduleRoutesSystemOrgUnchanged(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
// TestScheduleRouteMapping pins the action the authorize chain derives for
|
||||
// TestScheduleRouteMapping pins the action the authorise chain derives for
|
||||
// the schedule routes: instance administration in the system org, an
|
||||
// ordinary org-resource write for any other org.
|
||||
func TestScheduleRouteMapping(t *testing.T) {
|
||||
|
||||
@@ -46,7 +46,7 @@ func buildTaskMeta() taskMetaView {
|
||||
}
|
||||
}
|
||||
|
||||
// handleTaskMeta serves the catalog. See buildTaskMeta for what it carries.
|
||||
// handleTaskMeta serves the catalogue. See buildTaskMeta for what it carries.
|
||||
func (a *tasksAPI) handleTaskMeta(w http.ResponseWriter, _ *http.Request) {
|
||||
writeJSON(w, buildTaskMeta())
|
||||
}
|
||||
@@ -84,7 +84,7 @@ func (s *Server) handleUsage(w http.ResponseWriter, r *http.Request) {
|
||||
writeJSON(w, usageReport(days, rows, s.modelPrices(r.Context()), s.identityNames(r.Context())))
|
||||
}
|
||||
|
||||
// modelPrices prices each model from the catalog view the configuration owner
|
||||
// modelPrices prices each model from the catalogue view the configuration owner
|
||||
// publishes. A model it does not price is absent, so its calls are counted as
|
||||
// unpriced instead of costed at zero.
|
||||
func (s *Server) modelPrices(ctx context.Context) map[string]ModelCostView {
|
||||
@@ -125,7 +125,7 @@ func usagePriceKey(provider, model string) string {
|
||||
return provider + "\x00" + model
|
||||
}
|
||||
|
||||
// add accumulates one usage row, pricing it when the catalog published a
|
||||
// add accumulates one usage row, pricing it when the catalogue published a
|
||||
// price for its model.
|
||||
func (b *usageBucketView) add(row usage.TotalRow, prices map[string]ModelCostView) {
|
||||
b.Calls += row.Calls
|
||||
@@ -147,7 +147,7 @@ func (b *usageBucketView) add(row usage.TotalRow, prices map[string]ModelCostVie
|
||||
|
||||
// modelCallCost prices one row's tokens at the model's list price, netting
|
||||
// cache hits: cached tokens are part of the input count and are charged the
|
||||
// cache-read rate. A catalog that publishes no cache-read price is charged at
|
||||
// cache-read rate. A catalogue that publishes no cache-read price is charged at
|
||||
// the input rate, because reporting less than the provider bills is worse
|
||||
// than reporting more.
|
||||
func modelCallCost(row usage.TotalRow, cost ModelCostView) float64 {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Package worktreerpc lets archie-agent ask archied to push the task branch
|
||||
// over NATS, authorized by a per-dispatch grant.
|
||||
// over NATS, authorised by a per-dispatch grant.
|
||||
package worktreerpc
|
||||
|
||||
import (
|
||||
@@ -43,7 +43,7 @@ type Runs interface {
|
||||
TaskForCredential(ctx context.Context, token string) (*workflow.Task, error)
|
||||
}
|
||||
|
||||
// publishable returns the task a credential authorizes this identity's
|
||||
// publishable returns the task a credential authorises this identity's
|
||||
// server to push for.
|
||||
func publishable(ctx context.Context, runs Runs, token, identity string) (*workflow.Task, error) {
|
||||
if runs == nil || token == "" {
|
||||
|
||||
@@ -17,7 +17,7 @@ func (r runsByToken) TaskForCredential(_ context.Context, token string) (*workfl
|
||||
return nil, errors.New("unknown")
|
||||
}
|
||||
|
||||
// TestPushNeedsTheRunsOwnCredential pins that a push is authorized only by a
|
||||
// TestPushNeedsTheRunsOwnCredential pins that a push is authorised only by a
|
||||
// live run credential, only on the server of the run's identity, and only for
|
||||
// that run's branch.
|
||||
func TestPushNeedsTheRunsOwnCredential(t *testing.T) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Package approvals manages requests for human approval and records responses.
|
||||
// A response to an action request resumes the waiting run. The request binds
|
||||
// the approval to the decision ID and action digest so it cannot authorize a
|
||||
// the approval to the decision ID and action digest so it cannot authorise a
|
||||
// different action.
|
||||
package approvals
|
||||
|
||||
@@ -371,7 +371,7 @@ func proposalSummary(r *judgement.AutonomyProposal) string {
|
||||
|
||||
// Settle processes a response from a channel account, such as the Telegram
|
||||
// user 1001 on the "telegram" connector. It records why it rejected an
|
||||
// unlinked or unauthorized response. It returns false without an error for
|
||||
// unlinked or unauthorised response. It returns false without an error for
|
||||
// recorded rejections and for requests that are missing, expired or already
|
||||
// answered, since retrying won't help. An unlinked account returns
|
||||
// ErrUnlinked so the caller can tell it how to link.
|
||||
|
||||
@@ -57,7 +57,7 @@ var errUnbound = errors.New("the action's binding is incomplete")
|
||||
|
||||
// Digest returns the hex SHA-256 of the binding's canonical JSON (RFC 8785)
|
||||
// under a domain prefix. It refuses a binding with a missing field: an
|
||||
// approval that doesn't name everything it covers covers nothing.
|
||||
// approval that doesn't name everything it covers nothing.
|
||||
func (b Binding) Digest() (string, error) {
|
||||
if err := b.complete(); err != nil {
|
||||
return "", err
|
||||
|
||||
@@ -358,7 +358,7 @@ type PrincipalSource interface {
|
||||
PrincipalFor(context.Context, IdentityID) (Principal, error)
|
||||
}
|
||||
|
||||
// Outcome is the result of an authorization decision.
|
||||
// Outcome is the result of an authorisation decision.
|
||||
type Outcome string
|
||||
|
||||
// Decision outcomes.
|
||||
@@ -367,7 +367,7 @@ const (
|
||||
OutcomeDenied Outcome = "denied"
|
||||
)
|
||||
|
||||
// DecisionRecord is one recorded authorization decision, allowed or denied according
|
||||
// DecisionRecord is one recorded authorisation decision, allowed or denied according
|
||||
// to Outcome: the principal, action, resource and deciding policies. It never
|
||||
// holds request credentials.
|
||||
type DecisionRecord struct {
|
||||
|
||||
@@ -253,13 +253,13 @@ type SubjectBinding interface {
|
||||
BindSubject(context.Context, IdentityID, Subject, IdentityAudit) error
|
||||
}
|
||||
|
||||
// LoginFlow is the browser authorization flow an identity provider requires.
|
||||
// LoginFlow is the browser authorisation flow an identity provider requires.
|
||||
type LoginFlow interface {
|
||||
AuthCodeURL(ctx context.Context, state string) (string, string, error)
|
||||
Exchange(ctx context.Context, code, codeVerifier string) (ProviderSession, error)
|
||||
}
|
||||
|
||||
// ProviderSession is what a completed provider authorization flow yields.
|
||||
// ProviderSession is what a completed provider authorisation flow yields.
|
||||
type ProviderSession struct {
|
||||
Credential Credential
|
||||
Token string
|
||||
|
||||
@@ -57,7 +57,7 @@ type PolicyRow struct {
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
|
||||
// DecisionRow is a coalesced authorization decision in governance.access_decisions.
|
||||
// DecisionRow is a coalesced authorisation decision in governance.access_decisions.
|
||||
type DecisionRow struct {
|
||||
ID int64 `db:"id"`
|
||||
OrgID string `db:"org_id"`
|
||||
|
||||
@@ -23,7 +23,7 @@ type oidcLogin struct {
|
||||
provider *oidcProvider
|
||||
}
|
||||
|
||||
// flow returns the authorization code flow for the saved settings, or
|
||||
// flow returns the authorisation code flow for the saved settings, or
|
||||
// ErrNoCredential when no provider is configured.
|
||||
func (o *oidcLogin) flow(ctx context.Context, settings AuthenticationSettingsStore) (*oidcFlow, error) {
|
||||
value, err := settings.AuthenticationSettings(ctx)
|
||||
@@ -83,7 +83,7 @@ func (p *oidcProvider) get(ctx context.Context) (*gooidc.Provider, error) {
|
||||
return discovered, nil
|
||||
}
|
||||
|
||||
// oidcFlow runs the authorization code flow with PKCE. Discovery, the code
|
||||
// oidcFlow runs the authorisation code flow with PKCE. Discovery, the code
|
||||
// exchange, PKCE and token verification are the libraries'.
|
||||
type oidcFlow struct {
|
||||
provider *oidcProvider
|
||||
|
||||
@@ -446,7 +446,7 @@ type Approval struct {
|
||||
DecisionID uuid.UUID `json:"decision_id"`
|
||||
Digest string `json:"digest"`
|
||||
By string `json:"by"`
|
||||
// ByID is the identity ID of the account named by By.
|
||||
// ByID is the approver's immutable identity ID; By holds their display name.
|
||||
ByID string `json:"by_id,omitzero"`
|
||||
At time.Time `json:"at"`
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ func (w Interface) unsupported() error {
|
||||
// checkInputs rejects values that don't satisfy the declared inputs: a
|
||||
// required input that is missing or null, or a value whose type is not the
|
||||
// declared one. A value for an undeclared input is left alone, since a
|
||||
// trigger passes the whole event whether or not a workflow reads it.
|
||||
// trigger passes the whole event whether a workflow reads it.
|
||||
func (w Interface) checkInputs(values map[string]any) error {
|
||||
for _, name := range sortedKeys(w.Inputs) {
|
||||
spec := w.Inputs[name]
|
||||
|
||||
@@ -108,7 +108,7 @@ func vocabulary(types ...StepType) map[string]StepType {
|
||||
return out
|
||||
}
|
||||
|
||||
// StepTypes is the vocabulary, in name order, for editors and the catalog.
|
||||
// StepTypes is the vocabulary, in name order, for editors and the catalogue.
|
||||
func StepTypes() []StepType {
|
||||
out := make([]StepType, 0, len(stepTypes))
|
||||
for _, name := range sortedKeys(stepTypes) {
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
# Handoff: organisation-owned automation
|
||||
|
||||
Read this file and `GUIDELINES.md` before running a numbered implementation
|
||||
prompt. The maintainer approved the architecture below. Implement it; do not
|
||||
restart a navigation brainstorming exercise. The initial Antigravity navigation
|
||||
proposal was rejected. A later externally authored design or issue description
|
||||
field is not additional approval.
|
||||
|
||||
## Approved product model
|
||||
|
||||
| Scope | Ownership |
|
||||
| ------------ | --------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Account | Login methods, personal API tokens, preferences |
|
||||
| Instance | Authentication providers, execution infrastructure, installed extensions, secret-engine infrastructure, organisation limits |
|
||||
| Organisation | Members, execution identities, external connections, model configuration, workflows, schedules, channels |
|
||||
| Workspace | Groups organisation work and resources; initially inherits organisation permissions |
|
||||
| Task/run | Requesting actor, execution identity, resolved workflow and resource references |
|
||||
|
||||
External connections are explicit organisation resources. A forge connection
|
||||
identifies its host, authentication reference and verified external account.
|
||||
Repositories reference connections. Execution identities receive permission for
|
||||
specified operations on those resources. Git commit authorship is separate from
|
||||
authentication. Database-backed execution identities are authoritative.
|
||||
|
||||
Preserve existing service boundaries: State Store/control plane persists
|
||||
resources and authority; archied resolves execution resources, performs Git
|
||||
operations and verifies repository access; Gateway owns conversations and
|
||||
organisation-scoped model use; UI presents contracts and diagnostics. Use
|
||||
existing gRPC contracts for service communication. Do not add a service or
|
||||
access another service's tables.
|
||||
|
||||
A saved change must become effective without a server login. Connection state
|
||||
must distinguish saved, applied, verified and failed. A resolved secret is not
|
||||
proof of repository access. Setup follows the requested capability:
|
||||
repositories, chat channels and a global default model are not universal
|
||||
prerequisites.
|
||||
|
||||
## Starting state to verify
|
||||
|
||||
The last implementation commit recorded at handoff was `57456b3e`, containing
|
||||
independent settings/workflow/task diagnostic fixes. Architecture implementation
|
||||
has not begun. No application source was edited in the architecture approval
|
||||
session. Verify current history, checkout and working tree rather than assuming
|
||||
that snapshot is current. Other agents may have worked since this handoff.
|
||||
|
||||
## Execution sequence
|
||||
|
||||
1. `01-execution-identities.md` — #300.
|
||||
2. `02-connections-and-repositories.md` — #385.
|
||||
3. `03-organisation-ownership.md` — #57.
|
||||
4. `04-navigation-and-setup.md` — #47.
|
||||
|
||||
Gitea issues are authoritative for progress and dependencies. The parent is
|
||||
#1043. These files are reusable instructions, not completion records. Read each
|
||||
issue before claiming it. Complete the current slice end to end before starting
|
||||
the next. Do not close the parent until all acceptance criteria have actual
|
||||
evidence. Do not delegate unless the maintainer explicitly authorises it.
|
||||
|
||||
## Final acceptance scenario
|
||||
|
||||
An organisation administrator configures a forge connection through the
|
||||
dashboard, binds a private repository, permits an execution identity to
|
||||
clone/push/open a PR, verifies access using the daemon, selects that identity in
|
||||
a workflow, and runs or retries a task successfully. No configuration-file edit,
|
||||
restart, root credential fallback or daemon secret in a container is needed. A
|
||||
separate repository-free workflow runs without a forge connection.
|
||||
Cross-organisation use is refused.
|
||||
|
||||
Use an isolated authenticated private-repository equivalent for verification.
|
||||
Production configuration, deployment, pushes and external posting require the
|
||||
maintainer's explicit instruction. Do not use a dummy public/nonexistent
|
||||
repository's failure as evidence for private-repository authentication.
|
||||
@@ -1,70 +0,0 @@
|
||||
# Implement live database execution identities
|
||||
|
||||
Read `00-start-here.md` and `GUIDELINES.md`. Work against `archie-core-kgxw.13`;
|
||||
read and claim it before editing.
|
||||
|
||||
## Outcome
|
||||
|
||||
A bot or service account created and assigned through the dashboard can execute
|
||||
a repository-free workflow without a configuration-file entry or process
|
||||
restart. The database is the lifecycle and identity authority. A database
|
||||
identity cannot silently acquire the root forge account, model authority or
|
||||
container grants.
|
||||
|
||||
## Source investigation
|
||||
|
||||
Trace `internal/domain/identity`, organisation agent assignment, State Store
|
||||
identity RPC and principal assembly, `internal/app/archied/bootstrap.go`,
|
||||
`internal/app/archied/main.go`, `internal/daemon/workflow_identity.go`,
|
||||
`internal/daemon/workflow_org.go`, and identity-dependent paths in daemon.go and
|
||||
kit_task.go. Inspect `ui/src/workflows/WorkflowSettings.vue` and the
|
||||
organisation agent screen. Inspect every caller of declaredIdentity,
|
||||
identityMayAct, identityFor, publisherIdentity, configFor, forgeFor, treesFor
|
||||
and repoFor.
|
||||
|
||||
At handoff, the UI offered database IDs but execution used startup-built
|
||||
IdentityRunner objects from cfg.Identities. Forge/worktree NATS registrations
|
||||
were also startup-only. Verify these facts. Changing just the identity lookup
|
||||
while keeping root fallback paths would create a credential exposure.
|
||||
|
||||
## Required behaviour
|
||||
|
||||
1. Resolve a workflow's execution reference to a durable active agent identity.
|
||||
Canonical references use stable IDs, independent of editable display names.
|
||||
Refuse human, suspended, retired, missing and unassigned identities.
|
||||
2. Establish the identity's organisation from authoritative assignment. Refuse
|
||||
cross-organisation use even when a caller knows the other identity ID. Retain
|
||||
checks for both workflow invocation and execution, including binding context.
|
||||
3. Keep the persisted requesting actor distinct from the executing principal.
|
||||
Check the record and worker handoff, not just in-memory task mutation.
|
||||
4. New dashboard identities work live. Lifecycle or assignment changes affect
|
||||
subsequent attempts. An unavailable identity authority causes an explicit
|
||||
local refusal/dependency error, not permissive fallback.
|
||||
5. Audit all resource and RPC resolution. Database agents must not inherit root
|
||||
forge tokens, repository permissions or container credential grants. Do not
|
||||
create a second cached identity authority to patch over the split.
|
||||
6. Preserve existing configured identities through a narrowly scoped migration
|
||||
into their actual owning organisation. Do not delete settings or silently
|
||||
assign every identity to the system organisation. Preserve effective grants
|
||||
without granting anything to newly created agents by default.
|
||||
7. Keep repository authentication separate. A repository-free agent needs no
|
||||
forge connection. Until the connection slice is implemented, reject
|
||||
unsupported repository access explicitly rather than borrowing root
|
||||
credentials.
|
||||
8. Make workflow identity selection use eligible identities of the active
|
||||
organisation and display their names while saving stable IDs. Show loading,
|
||||
unavailable and empty states truthfully.
|
||||
|
||||
Do not invent new meanings for `root` or replace it with another organisation's
|
||||
agent automatically. Migrate existing references only with a deterministic,
|
||||
organisation-correct mapping; surface genuinely ambiguous records for
|
||||
resolution.
|
||||
|
||||
## Acceptance evidence
|
||||
|
||||
Show a dashboard-created agent running a repository-free workflow through the
|
||||
actual daemon path. Cover refused human, inactive, unassigned and cross-org
|
||||
identities; authority outages; retry rechecks; and absence of root credential
|
||||
inheritance. Verify a renamed agent still resolves by ID. Verify existing mapped
|
||||
identities retain their permissions. Run the project gate and record evidence
|
||||
and any remaining limitations in the issue before closing it.
|
||||
@@ -1,73 +0,0 @@
|
||||
# Implement organisation forge connections and repository access
|
||||
|
||||
Read `00-start-here.md` and `GUIDELINES.md`. Work against `archie-core-oygqd`.
|
||||
Its prerequisite is `archie-core-kgxw.13`; verify acceptance before claiming
|
||||
this slice. Do not treat a closed issue without evidence as proof.
|
||||
|
||||
## Outcome and resource relationships
|
||||
|
||||
An organisation owns a named external connection. It identifies the forge host,
|
||||
authentication reference and verified external account. A repository references
|
||||
that connection. An execution identity is authorised for specified operations
|
||||
such as clone, push and opening a PR. Commit author name/email remain
|
||||
independent of the authenticating external account. Choose the smallest
|
||||
representation that fits the existing control-plane resource and policy
|
||||
contracts; do not build a new integration service or expose root config fields
|
||||
as the domain model.
|
||||
|
||||
## Investigate first
|
||||
|
||||
Trace existing control-plane resource registration and organisation validation,
|
||||
repository policies, SecretRef handling, forge extensions and resolveForge in
|
||||
archied, worktree.Manager authentication, task-scoped forge/worktree RPC
|
||||
authority, apply-status reporting and settings API authorisation. Check every
|
||||
Git and forge consumer, including intake polling, review handling, retries and
|
||||
post-run actions. A secret-reference check currently performed by another
|
||||
service is not evidence that archied can resolve and use that reference.
|
||||
|
||||
## Required behaviour
|
||||
|
||||
1. Organisation administrators manage connections and repository bindings
|
||||
through API/dashboard with server-side authorisation. Other organisations
|
||||
cannot read, modify, select, verify or execute against them by guessing an
|
||||
ID.
|
||||
2. Reuse secret references and installed forge capabilities. Do not hardcode a
|
||||
closed GitHub/Gitea list if enabled extensions already supply discovery.
|
||||
Never return token values to the browser. Any credential-entry path must have
|
||||
a real secure storage consumer, not store plaintext in generic config/audit.
|
||||
3. Authorise operations for the actual execution identity and selected resource.
|
||||
A valid token does not itself grant an agent permission. Do not grant blanket
|
||||
write/issue/PR permissions when only clone/read is requested.
|
||||
4. Resolve the selected connection in archied for the actual repository
|
||||
operation. Apply updates live. Saved revision, applied revision and verified
|
||||
access are distinct; failed changes must not falsely report that the new
|
||||
revision runs.
|
||||
5. Test access through the daemon's real forge/Git path for the selected
|
||||
repository and base branch, under the relevant execution identity's
|
||||
permissions. Report which operation was checked. Read success cannot prove
|
||||
push or PR permission. Verification must not create commits, branches or PRs
|
||||
as an incidental probe.
|
||||
6. Credential rotation reaches subsequent operations without process restart.
|
||||
Revoked permissions are enforced on subsequent operations/attempts. Avoid
|
||||
stale cached credentials silently surviving changes.
|
||||
7. Produce structured failures with a cause, affected resource/operation and an
|
||||
authorised recovery action. Distinguish missing configuration, unavailable
|
||||
secret/extension, denied authority and remote authentication/access failure.
|
||||
A remote 401 or 'Repository not found' does not prove which underlying cause
|
||||
occurred. Do not implement frontend substring/regex diagnosis.
|
||||
8. Populate task repository choices from authorised configured repositories, not
|
||||
only prior tasks. A failed task can lead to its connection and return to
|
||||
retry.
|
||||
9. Migrate existing forge/repository configuration to its existing owner without
|
||||
widening grants; remove obsolete runtime paths after all consumers migrate.
|
||||
Do not force connection setup for repository-free workflows.
|
||||
|
||||
## Acceptance evidence
|
||||
|
||||
Use an isolated authenticated private-repository equivalent. Demonstrate
|
||||
dashboard configuration, actual daemon clone, permitted push/PR execution where
|
||||
the test workflow calls for it, credential rotation and refused unauthorised
|
||||
operations. Show that another org and an ungranted agent cannot use the same
|
||||
connection. Inspect worker handoff/logs to confirm tokens do not leak. Run a
|
||||
repository-free workflow independently. Record exact limitations; no production
|
||||
configuration or external posting is authorised by this prompt.
|
||||
@@ -1,54 +0,0 @@
|
||||
# Migrate automation resources to organisation ownership
|
||||
|
||||
Read `00-start-here.md` and `GUIDELINES.md`. Work against `archie-core-3z4fd.8`.
|
||||
Read prior identity/connection changes before deciding what remains; do not
|
||||
duplicate their resources or migrations.
|
||||
|
||||
## Outcome
|
||||
|
||||
Every automation resource resolves within its owning organisation and every
|
||||
instance resource remains an explicitly administered infrastructure capability.
|
||||
Existing settings retain their values, ownership and effective access.
|
||||
|
||||
## Required scope
|
||||
|
||||
Inspect the control plane's instanceOnlyKinds, runtime layering, org model
|
||||
policy, provider/model selection, workflow definitions/enablement, schedules,
|
||||
channel settings, event sources/bindings, execution profiles and task/container
|
||||
policies. Inspect all runtime consumers and authorization paths before changing
|
||||
scope. Use the ownership table in `00-start-here.md` as the approved target. Do
|
||||
not mechanically remove kinds from instanceOnlyKinds and declare completion.
|
||||
|
||||
## Rules and implementation requirements
|
||||
|
||||
1. Resolve organisational resources from the task/request's authoritative org
|
||||
context. Do not trust a submitted org field, retain a root context by
|
||||
accident, or query a different service's tables.
|
||||
2. Preserve the distinction between installed instance capability, organisation
|
||||
configuration and organisation permission to use shared infrastructure.
|
||||
Existing org model policy must remain effective. Instance infrastructure
|
||||
limits remain enforceable even when organisations configure automation.
|
||||
3. Keep workspace semantics narrow: group organisation work/resources and
|
||||
inherit organisation permission initially. Do not invent a second workspace
|
||||
policy system or weaken existing explicit restrictions.
|
||||
4. Establish deterministic ownership for existing records before migration.
|
||||
Preserve valid instance defaults only where the model explicitly allows
|
||||
inherited infrastructure defaults. Do not copy secrets or permissions into
|
||||
every tenant. Ambiguous ownership must be visible, never guessed.
|
||||
5. Make migrations safe to resume and maintain atomicity where records must
|
||||
agree. An interrupted migration must not silently lose settings or broaden
|
||||
access. Regenerate affected contracts and update every reader/writer/fixture.
|
||||
6. Saved org settings need functioning runtime consumers, apply status and
|
||||
dependency failure handling. Watches/caches must be keyed by organisation as
|
||||
well as resource/revision wherever shared processes consume multiple tenants.
|
||||
7. Remove superseded global paths after callers and data move. Do not maintain
|
||||
two independent sources of truth. Preserve accepted work while peers restart.
|
||||
|
||||
## Acceptance evidence
|
||||
|
||||
Demonstrate two organisations with distinct effective resources using actual
|
||||
service/API paths. Verify configuration changes and restarts retain separation,
|
||||
and that requests/tasks cannot read or use another org's configuration. Verify
|
||||
migration of representative existing configuration without widened permissions,
|
||||
including interrupted/repeated migration semantics where applicable. Follow
|
||||
AGENTS.md for SQL/security regression tests and run the final project gate.
|
||||
@@ -1,59 +0,0 @@
|
||||
# Implement navigation and contextual setup from working contracts
|
||||
|
||||
Read `00-start-here.md` and `GUIDELINES.md`. Work against `archie-core-3z4fd.1`.
|
||||
Verify its connection and ownership prerequisites before starting. The old
|
||||
page-rearrangement proposal is rejected, not a UI specification.
|
||||
|
||||
## Outcome
|
||||
|
||||
The visible application reflects actual resource ownership. An operator can find
|
||||
and complete the setup needed for a particular workflow and recover a failed run
|
||||
without guessing which settings page owns the problem.
|
||||
|
||||
## Required behaviour
|
||||
|
||||
1. An organisation selector establishes context. Workflows, Tasks, Connections
|
||||
and Organisation settings operate in that context. Switching org must clear
|
||||
or refetch scoped state and prevent stale responses from contaminating it.
|
||||
2. Instance administration is a separate administrator destination for
|
||||
infrastructure and instance limits. Personal login security, API tokens and
|
||||
preferences live in the account menu. Do not recreate a catch-all Access
|
||||
page.
|
||||
3. Connections are discoverable organisation resources. A repository opens its
|
||||
connection; a workflow shows the execution identity/resources it needs; a
|
||||
failed task links to an authorised recovery action. Show names with stable
|
||||
references, without duplicate organisation labels or unexplained internal
|
||||
IDs.
|
||||
4. Setup is contextual. A repo-required workflow offers missing connection,
|
||||
repository, identity or model configuration where needed. A repository-free
|
||||
workflow never demands GitHub. Chat channels and a global default model are
|
||||
not universal setup prerequisites. Do not add a mandatory global wizard.
|
||||
5. Readiness comes from backend capability diagnostics for the selected org,
|
||||
identity, workflow and resource. Distinguish saved/applied/verified/failed.
|
||||
Do not infer readiness from nonempty fields, task counts or a resolved
|
||||
secret.
|
||||
6. Recovery consumes structured service errors. The browser must not classify
|
||||
root causes using error-string patterns or display actions the user cannot
|
||||
perform. Preserve task context when moving to configuration and returning.
|
||||
7. Preserve the prior working settings draft/save flow, readable width, review
|
||||
diffs, workflow validation and truthful loading/error states. Do not
|
||||
reintroduce native navigation prompts that discard drafts or collisions with
|
||||
the chat FAB.
|
||||
8. Keep technical implementation details out of normal product copy. Explain
|
||||
connection/account/permission problems in terms useful to the operator, not
|
||||
daemon config keys, NATS subjects or secret plumbing.
|
||||
|
||||
## Acceptance evidence
|
||||
|
||||
Drive the real local UI: create or select an org, configure the
|
||||
private-repository connection, choose a valid execution identity, verify
|
||||
repository access, start a workflow, encounter and recover a controlled access
|
||||
failure, then retry. Also run repository-free automation without forge setup.
|
||||
Verify a second org cannot see or select the first org's resources, including
|
||||
after switching org during an in-flight fetch. Check administrator, ordinary
|
||||
member and personal account views, loading/error states, keyboard access and a
|
||||
narrow viewport. Capture evidence, regenerate embedded UI output and run the
|
||||
exact final tree's project gate.
|
||||
|
||||
Do not claim a successful user journey based solely on mocked screenshots or
|
||||
fixture state. Leave unmet criteria explicitly open in the issue.
|
||||
@@ -1,73 +0,0 @@
|
||||
# Mandatory execution guidelines
|
||||
|
||||
These rules apply to every numbered prompt. Read the current root and scoped
|
||||
AGENTS.md files first; the maintainer's current instructions take precedence.
|
||||
|
||||
## Before edits
|
||||
|
||||
- Verify the requested checkout, branch, working tree and other active writers.
|
||||
Preserve unrelated changes. Do not reset, stash or overwrite another agent.
|
||||
- Read and claim the named issue. Create any missing issue before starting its
|
||||
work. Record implementation discoveries and remaining work in the issue, never
|
||||
a second Markdown task ledger. Do not post to another tracker unless told.
|
||||
- Trace the complete affected path: UI, API, service contract, authorisation,
|
||||
persistence, runtime consumer, retries, fixtures and generated artifacts.
|
||||
- Name the smallest complete change. Reuse existing resource, secret-reference,
|
||||
authorisation, apply-status and service-contract mechanisms. If a new
|
||||
mechanism or a change exceeding roughly 100 lines is needed, assess simpler
|
||||
alternatives and record why they fail. This assessment does not mean asking
|
||||
again for an already approved direction.
|
||||
- Treat file names and line references in these prompts as investigation leads.
|
||||
Verify the current source; do not implement from stale notes alone.
|
||||
|
||||
## Implementation boundaries
|
||||
|
||||
- Preserve service isolation, durable acknowledgement and local failure. An
|
||||
unavailable peer must not terminate unrelated services or discard accepted
|
||||
work.
|
||||
- Enforce organisation ownership and operation permissions on the server. Hidden
|
||||
UI controls are not an authorisation boundary. Caller-supplied organisation or
|
||||
identity values are not trusted facts.
|
||||
- Keep requesting actor, execution principal, external account and commit author
|
||||
distinct. Never infer authority from a display name or a matching account
|
||||
name.
|
||||
- Never fall back to root credentials or broad grants when resolution fails.
|
||||
Never grant every existing organisation access to migrated global resources.
|
||||
- The model never runs Git. Daemon credentials never enter agent containers,
|
||||
task briefs, browser responses or logs. Task-scoped grants expire/revoke when
|
||||
execution ends. Task briefs remain under `.git/task.json`.
|
||||
- Persist settings through the control plane and implement their runtime
|
||||
consumer in the same slice. Do not ship parse-only fields, decorative
|
||||
readiness badges, restart instructions or a server-login workaround as
|
||||
completion.
|
||||
- Remove obsolete paths only after migrating their data and callers. No parallel
|
||||
identity authority, duplicated ownership model or indefinite compatibility
|
||||
shim.
|
||||
- No new service, binary, generic framework, broad cleanup or speculative
|
||||
feature. File unrelated discoveries as issues instead of fixing them in
|
||||
passing.
|
||||
|
||||
## Verification and delivery
|
||||
|
||||
- For a reported bug, reproduce it with a meaningful failing regression before
|
||||
fixing it. Cover changed security, workflow and SQL semantics as required by
|
||||
AGENTS.md. Do not add tests of constants, wiring or struct shapes.
|
||||
- Verify through real API/runtime/browser paths when the acceptance requires
|
||||
them. State Store fixtures and mocks must be labelled; they do not prove
|
||||
actual private Git access, credential rotation or successful agent execution.
|
||||
- Do not open a real database or require Docker in unit tests. Use the isolated
|
||||
integration/e2e environment for real service verification.
|
||||
- Follow current project instructions for framework/library documentation. Never
|
||||
send secrets, production identifiers or credential contents to documentation
|
||||
tools.
|
||||
- Regenerate protobuf and embedded UI assets when their sources change; do not
|
||||
hand-edit generated output. Run appropriate targeted checks, then `task check`
|
||||
on the exact final tree before committing. Never run concurrent full gates.
|
||||
- Stage only your own paths, never binaries or scratch output. Commit finished
|
||||
work with a short scoped Conventional Commit. Do not push or deploy.
|
||||
- Close an issue only when its stated acceptance is demonstrated. If something
|
||||
remains unverified, record exactly what and why; leave the issue open. Never
|
||||
describe a partial implementation as end-to-end completion.
|
||||
- Report what changed, what was verified and the material remaining limitation.
|
||||
Keep useful progress updates concise. Ask only for unresolved product
|
||||
decisions or explicitly restricted external/destructive actions.
|
||||
+42
-41
@@ -8,17 +8,17 @@ CLAUDE.md points here so both agents use one policy.
|
||||
|
||||
The dashboard is Vue 3, TypeScript, Pinia and Vue Router, with Tailwind and
|
||||
vendored shadcn-vue components backed by Reka UI. It talks to the control plane
|
||||
through src/lib/api.ts. The server owns contracts, authorization and durable
|
||||
through src/lib/api.ts. The server owns contracts, authorisation and durable
|
||||
state; the UI presents them and submits operator choices.
|
||||
|
||||
- Fix broken behavior with the smallest complete change. Finish existing
|
||||
features before adding new ones. Do not add an abstraction or dependency for
|
||||
a few lines of code.
|
||||
- Read the affected callers and existing components before editing. Keep
|
||||
feature state and behavior in its feature folder; shared code must have real
|
||||
- Fix broken behaviour with the smallest complete change. Finish existing
|
||||
features before adding new ones. Do not add an abstraction or dependency for a
|
||||
few lines of code.
|
||||
- Read the affected callers and existing components before editing. Keep feature
|
||||
state and behaviour in its feature folder; shared code must have real
|
||||
consumers. Do not extract production helpers solely to make them testable.
|
||||
- Preserve server vocabulary and typed wire values. Do not invent local status,
|
||||
action or model catalogs when the server supplies them.
|
||||
action or model catalogues when the server supplies them.
|
||||
- Keep requests in src/lib/api.ts and shared live updates in the existing store.
|
||||
Preserve its authentication, CSRF, timeout and error handling.
|
||||
- Keep unavailable, loading, empty and failed states distinct. Show failures
|
||||
@@ -28,8 +28,8 @@ state; the UI presents them and submits operator choices.
|
||||
- Build in safety. Edits go to a draft and reach the running workflow only when
|
||||
you publish.
|
||||
- Never lose work silently. If two things can write the same state (e.g., Archie
|
||||
and the operator), lock one out or merge them; never let one silently overwrite
|
||||
the other.
|
||||
and the operator), lock one out or merge them; never let one silently
|
||||
overwrite the other.
|
||||
- Phone width is a real target. No global CSS rule may deform controls. Desktop
|
||||
layouts must collapse cleanly: dropdowns instead of side lists, stacked panes,
|
||||
and nothing overlapping the canvas.
|
||||
@@ -37,27 +37,27 @@ state; the UI presents them and submits operator choices.
|
||||
## Product scope
|
||||
|
||||
- Respect the existing feature set. New features honour instructions, policies,
|
||||
grants and the access model (ReBAC/ABAC with Cedar). An agent tool never reaches
|
||||
further than its caller could through the dashboard.
|
||||
grants and the access model (ReBAC/ABAC with Cedar). An agent tool never
|
||||
reaches further than its caller could through the dashboard.
|
||||
- Agentic automation, not a coding agent. A repository is one optional input to
|
||||
a workflow, not the frame for anything.
|
||||
- Smallest change first. Reuse what exists, such as the change-review list, drafts
|
||||
and the existing MCP bridge, before adding new mechanism.
|
||||
- Smallest change first. Reuse what exists, such as the change-review list,
|
||||
drafts and the existing MCP bridge, before adding new mechanism.
|
||||
|
||||
## Components and interaction
|
||||
|
||||
- Build pages only from components/ui and the page frame in src/base
|
||||
(PageHeader for a page title and its actions, CodeView for code or a payload
|
||||
with a copy button). Use Section for a titled card, SettingRow for a
|
||||
setting, MetadataList for label/value pairs, DataTable for a table with
|
||||
optional columns, Item for a list row, Field for a form field, Badge and
|
||||
StatusDot for state, Timestamp for times, MoreMenu for overflow actions,
|
||||
Empty for empty states (including an empty value or result), ReadError for a
|
||||
failed read, Skeleton while loading, Trace for an agent's steps,
|
||||
CodeBlockCopyButton to copy an ID or value, and the type scale (text-caption,
|
||||
text-label, text-title) instead of pixel sizes. Never hand-roll a card,
|
||||
heading, caption, status dot, copy button or date format; if a pattern is
|
||||
missing, add it to components/ui with a real consumer first.
|
||||
- Build pages only from components/ui and the page frame in src/base (PageHeader
|
||||
for a page title and its actions, CodeView for code or a payload with a copy
|
||||
button). Use Section for a titled card, SettingRow for a setting, MetadataList
|
||||
for label/value pairs, DataTable for a table with optional columns, Item for a
|
||||
list row, Field for a form field, Badge and StatusDot for state, Timestamp for
|
||||
times, MoreMenu for overflow actions, Empty for empty states (including an
|
||||
empty value or result), ReadError for a failed read, Skeleton while loading,
|
||||
Trace for an agent's steps, CodeBlockCopyButton to copy an ID or value, and
|
||||
the type scale (text-caption, text-label, text-title) instead of pixel sizes.
|
||||
Never hand-roll a card, heading, caption, status dot, copy button or date
|
||||
format; if a pattern is missing, add it to components/ui with a real consumer
|
||||
first.
|
||||
- Add and update components/ui components with the shadcn-vue CLI, never by
|
||||
writing or copying them by hand: `pnpm dlx shadcn-vue@latest add <name>` from
|
||||
`ui/`, or the component's registry URL when the maintainer names one. Search
|
||||
@@ -69,8 +69,8 @@ state; the UI presents them and submits operator choices.
|
||||
- Use semantic theme tokens, existing variants and cn() for conditional classes.
|
||||
Support both themes, compact density and reduced motion.
|
||||
- Keep controls compact and contextual. Use on-demand panels and inline
|
||||
hover/focus icon actions rather than permanent chrome. Do not repeat labels
|
||||
in explanatory text or add controls without working behavior.
|
||||
hover/focus icon actions rather than permanent chrome. Do not repeat labels in
|
||||
explanatory text or add controls without working behaviour.
|
||||
- Text states a problem or an action, nothing else. Delete lines that only
|
||||
describe what the screen already shows (e.g., "Compared with the current
|
||||
definition", "Same as the current definition", "Refreshed every 5 seconds",
|
||||
@@ -83,19 +83,19 @@ state; the UI presents them and submits operator choices.
|
||||
- Name things after what you are working with. The page sets context, so use
|
||||
"Restore default" not "Restore shipped workflows".
|
||||
- No filler or guidance text. Delete empty-state essays, hints that repeat the
|
||||
label, and sentences explaining how the UI works. Don't say that secret
|
||||
values are hidden when the control only displays credential names.
|
||||
label, and sentences explaining how the UI works. Don't say that secret values
|
||||
are hidden when the control only displays credential names.
|
||||
- Product names are our own. The editor helper is "Build with Archie" or
|
||||
"Iterate with Archie", never generic terms like "Ask bar".
|
||||
- Actions live where their scope lives. Bulk or instance-wide actions (e.g.,
|
||||
restoring defaults) belong on the settings page for that area, not in a
|
||||
working view's header menu.
|
||||
- No side panels for editing workflows. Settings, trigger and steps expand
|
||||
in place on the canvas, one at a time, with the main field first and the rest
|
||||
- No side panels for editing workflows. Settings, trigger and steps expand in
|
||||
place on the canvas, one at a time, with the main field first and the rest
|
||||
tucked away.
|
||||
- Editor and live view are one surface. Runs show on the same cards you edit.
|
||||
- Use Select components wherever the options are known. Avoid native selects
|
||||
and free text. Use the same button and badge styles as the settings pages.
|
||||
- Use Select components wherever the options are known. Avoid native selects and
|
||||
free text. Use the same button and badge styles as the settings pages.
|
||||
- Preserve keyboard operation, visible focus, accessible names, dialog titles
|
||||
and table semantics. A hover action must also be reachable by keyboard.
|
||||
- Keep filtering and pagination consistent with the server. State limitations
|
||||
@@ -107,25 +107,26 @@ The default is no new test. Add one for a reproduced bug or a change to a
|
||||
security boundary or workflow contract, following the root policy. A regression
|
||||
must fail on the relevant assertion before the fix.
|
||||
|
||||
- Test observable behavior with realistic inputs. Do not test source text,
|
||||
- Test observable behaviour with realistic inputs. Do not test source text,
|
||||
imports, wiring, constants, defaults, type shapes, CSS classes, copied labels,
|
||||
fakes or call order. A fake may support a behavior test; it is not the subject.
|
||||
- Use one table-driven test per behavior. Extend its cases rather than adding
|
||||
fakes or call order. A fake may support a behaviour test; it is not the
|
||||
subject.
|
||||
- Use one table-driven test per behaviour. Extend its cases rather than adding
|
||||
tests for each branch. Retain meaningful edge cases; reducing the count alone
|
||||
is not a cleanup.
|
||||
- Keep tests fast and cheap to maintain. Test helpers and fixtures belong in
|
||||
test/, never in production code solely for tests.
|
||||
- For mirrored control-plane validators, extend the shared fixture at
|
||||
internal/infrastructure/controlplanestore/testdata/dashboard-validators.json rather than
|
||||
duplicating accept/reject cases in UI-only tests.
|
||||
- Use browser checks for rendered behavior. Matching a Vue file with a regex
|
||||
does not verify what the user sees. Mocked API checks verify UI behavior, not
|
||||
internal/infrastructure/controlplanestore/testdata/dashboard-validators.json
|
||||
rather than duplicating accept/reject cases in UI-only tests.
|
||||
- Use browser checks for rendered behaviour. Matching a Vue file with a regex
|
||||
does not verify what the user sees. Mocked API checks verify UI behaviour, not
|
||||
live service integration; report that distinction.
|
||||
|
||||
## Verification and delivery
|
||||
|
||||
```bash
|
||||
pnpm test # behavior tests
|
||||
pnpm test # behaviour tests
|
||||
pnpm run typecheck # TypeScript and Vue checks
|
||||
pnpm run build # rebuild the embedded dashboard
|
||||
pnpm audit # after dependency changes
|
||||
|
||||
Reference in new issue
Block a user