chore(runtime): remove code left dead by the Kit removal (#1877)
Drops Client.TaskPrincipalForCredential and the principal_id field only it read, Reporter.ReportToolCall, Pool.EnsureImage and Pool.Instance, and the binding cipher's exported domain API. Clears the remaining harness references from the audit target kinds, docs and comments.
This commit is contained in:
10 files changed
+26
-67
No files matched your search
@@ -29,9 +29,9 @@ and calls its composition root in `internal/app/<service>`.
|
||||
| --- | --- | --- |
|
||||
| `archie-state-store` | State Store and Control Plane contracts; owns the task and control-plane PostgreSQL tables | PostgreSQL |
|
||||
| `archie-gateway` | Chat, conversation state, task tools | State Store |
|
||||
| `archied` | Scheduling, workflow runs, harness, Daemon contract | State Store, Gateway, Messaging |
|
||||
| `archied` | Scheduling, workflow runs, task containers, Daemon contract | State Store, Gateway, Messaging |
|
||||
| `archie-messaging` | External channel frontends | Gateway |
|
||||
| `archie-ui` | Dashboard HTTP API (`internal/webui`) and the embedded SPA | State Store, Gateway, daemon, harness |
|
||||
| `archie-ui` | Dashboard HTTP API (`internal/webui`) and the embedded SPA | State Store, Gateway, daemon |
|
||||
| `archie-agent` | The worker inside each task container | NATS |
|
||||
|
||||
`internal/domain` holds behaviour and interfaces; `internal/infrastructure`
|
||||
|
||||
@@ -147,9 +147,6 @@ func (p *Pool) current() Config {
|
||||
// daemonLabel marks containers a pool owns; its value is the instance name.
|
||||
const daemonLabel = "archie-daemon"
|
||||
|
||||
// Instance is the name of the archie instance the pool belongs to.
|
||||
func (p *Pool) Instance() string { return p.cfg.Instance }
|
||||
|
||||
// Config is the subset of daemon container configuration the pool needs.
|
||||
type Config struct {
|
||||
Image string
|
||||
@@ -616,13 +613,6 @@ func (p *Pool) Close() error {
|
||||
|
||||
// ── helpers ──────────────────────────────────────────────────────────
|
||||
|
||||
// EnsureImage pulls ref under the live pull policy unless the pool has
|
||||
// already made it available. The configured image was pulled by NewPool and
|
||||
// recorded, so a caller naming it skips a second pull.
|
||||
func (p *Pool) EnsureImage(ctx context.Context, ref string) error {
|
||||
return p.ensureImage(ctx, p.current(), ref)
|
||||
}
|
||||
|
||||
// ensureImage pulls ref under cfg's pull policy unless it is already present
|
||||
// in the pool. It is the live read an acquire uses; EnsureImage is the
|
||||
// exported form for callers that only name a ref.
|
||||
|
||||
@@ -248,10 +248,8 @@ type ResolveTaskGrantResponse struct {
|
||||
TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
// Canonical execution identity; empty names the instance root RPC route.
|
||||
ExecutionIdentity string `protobuf:"bytes,2,opt,name=execution_identity,json=executionIdentity,proto3" json:"execution_identity,omitempty"`
|
||||
// Canonical principal, including the instance root.
|
||||
PrincipalId string `protobuf:"bytes,3,opt,name=principal_id,json=principalId,proto3" json:"principal_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ResolveTaskGrantResponse) Reset() {
|
||||
@@ -298,13 +296,6 @@ func (x *ResolveTaskGrantResponse) GetExecutionIdentity() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ResolveTaskGrantResponse) GetPrincipalId() string {
|
||||
if x != nil {
|
||||
return x.PrincipalId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_state_v1_task_grant_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_state_v1_task_grant_proto_rawDesc = "" +
|
||||
@@ -319,11 +310,10 @@ const file_state_v1_task_grant_proto_rawDesc = "" +
|
||||
"\x05token\x18\x01 \x01(\tR\x05token\"\x19\n" +
|
||||
"\x17RevokeTaskGrantResponse\"/\n" +
|
||||
"\x17ResolveTaskGrantRequest\x12\x14\n" +
|
||||
"\x05token\x18\x01 \x01(\tR\x05token\"\x85\x01\n" +
|
||||
"\x05token\x18\x01 \x01(\tR\x05token\"v\n" +
|
||||
"\x18ResolveTaskGrantResponse\x12\x17\n" +
|
||||
"\atask_id\x18\x01 \x01(\x03R\x06taskId\x12-\n" +
|
||||
"\x12execution_identity\x18\x02 \x01(\tR\x11executionIdentity\x12!\n" +
|
||||
"\fprincipal_id\x18\x03 \x01(\tR\vprincipalId2\xa3\x02\n" +
|
||||
"\x12execution_identity\x18\x02 \x01(\tR\x11executionIdentityJ\x04\b\x03\x10\x04R\fprincipal_id2\xa3\x02\n" +
|
||||
"\x10TaskGrantService\x12\\\n" +
|
||||
"\x11RegisterTaskGrant\x12\".state.v1.RegisterTaskGrantRequest\x1a#.state.v1.RegisterTaskGrantResponse\x12V\n" +
|
||||
"\x0fRevokeTaskGrant\x12 .state.v1.RevokeTaskGrantRequest\x1a!.state.v1.RevokeTaskGrantResponse\x12Y\n" +
|
||||
|
||||
@@ -27,13 +27,6 @@ type Reporter struct {
|
||||
Transcript func(TranscriptEntry)
|
||||
}
|
||||
|
||||
// ReportToolCall forwards report to r.ToolCall, if set.
|
||||
func (r Reporter) ReportToolCall(report ToolCallReport) {
|
||||
if r.ToolCall != nil {
|
||||
r.ToolCall(report)
|
||||
}
|
||||
}
|
||||
|
||||
// ReportTranscript forwards entry to r.Transcript, if set.
|
||||
func (r Reporter) ReportTranscript(entry TranscriptEntry) {
|
||||
if r.Transcript != nil {
|
||||
|
||||
@@ -109,7 +109,7 @@ func TargetKinds() []string {
|
||||
"capture", "secret", "member", "dashboard", "event",
|
||||
"orgs", "workspaces", "memberships", "org_agents",
|
||||
"mappings", "bindings", "event_types", "sources",
|
||||
"installed_packages", "harness_secrets",
|
||||
"installed_packages",
|
||||
// audit_retention is the retention sweep's coverage table, audit is
|
||||
// the resource kind a denied feed read names, and audit_export is the
|
||||
// row a completed export writes; all reach the feed as target kinds.
|
||||
|
||||
@@ -165,7 +165,7 @@ func validSurface(surface string) bool {
|
||||
return surface == SurfaceSecretEngine || surface == SurfaceForge || surface == SurfaceChannel
|
||||
}
|
||||
|
||||
// PackageRef identifies a required package or Kit. References are pinned to
|
||||
// PackageRef identifies a required package. References are pinned to
|
||||
// immutable content digests so dependency resolution cannot drift by tag.
|
||||
type PackageRef struct {
|
||||
Name string `yaml:"name"`
|
||||
|
||||
@@ -29,7 +29,7 @@ const (
|
||||
// entry kind; data: agentrun.TranscriptEntry's fields.
|
||||
KindAgentTranscript = "agent_transcript"
|
||||
// KindDeliveryRecorded records one outward delivery a test run did not
|
||||
// perform: a forge write, a push, an HTTP request, a central tool call.
|
||||
// perform: a forge write, a push or an HTTP request.
|
||||
// detail: what it would have done, phrased "would ...".
|
||||
KindDeliveryRecorded = "delivery_recorded"
|
||||
KindParked = "parked" // data: reason
|
||||
|
||||
@@ -23,17 +23,17 @@ const bindingEnvelopeVersion = "v1"
|
||||
// bindingNonceLen is GCM's recommended 12-byte nonce.
|
||||
const bindingNonceLen = 12
|
||||
|
||||
// Domain is an envelope's marker and additional-authenticated-data: the
|
||||
// domain is an envelope's marker and additional-authenticated-data: the
|
||||
// separator that stops a ciphertext sealed for one column being relocated to
|
||||
// a different one and still authenticating.
|
||||
// Domains share the same keyring; only the marker and AAD differ.
|
||||
type Domain struct {
|
||||
type domain struct {
|
||||
marker string
|
||||
aad []byte
|
||||
}
|
||||
|
||||
// BindingDomain seals binding and source webhook secrets. Not row-bound.
|
||||
var BindingDomain = Domain{marker: "arcie-binding", aad: []byte("arcie-binding-secret")}
|
||||
// bindingDomain seals binding and source webhook secrets. Not row-bound.
|
||||
var bindingDomain = domain{marker: "arcie-binding", aad: []byte("arcie-binding-secret")}
|
||||
|
||||
// bindingKeyFingerprintLen is the number of hex characters of the
|
||||
// SHA-256(material) fingerprint embedded in the envelope (8 bytes, far more
|
||||
@@ -46,16 +46,11 @@ const bindingKeyFingerprintLen = 16
|
||||
// use.
|
||||
type BindingCipher interface {
|
||||
// Encrypt returns the sealed envelope for a plaintext secret, under
|
||||
// BindingDomain.
|
||||
// bindingDomain.
|
||||
Encrypt(plaintext string) (string, error)
|
||||
// Decrypt returns the plaintext secret for a sealed envelope sealed
|
||||
// under BindingDomain.
|
||||
// under bindingDomain.
|
||||
Decrypt(envelope string) (string, error)
|
||||
// EncryptDomain and DecryptDomain are Encrypt/Decrypt for a caller-named
|
||||
// domain, so a second column can share this
|
||||
// cipher's keyring without sharing BindingDomain's AAD.
|
||||
EncryptDomain(d Domain, plaintext string) (string, error)
|
||||
DecryptDomain(d Domain, envelope string) (string, error)
|
||||
}
|
||||
|
||||
// bindingCipher is AES-256-GCM with keys SHA-256(material). The active key
|
||||
@@ -88,19 +83,19 @@ func NewBindingCipher(active string, previous []string) (*bindingCipher, error)
|
||||
return c, nil
|
||||
}
|
||||
|
||||
// Encrypt seals plaintext under BindingDomain with the active key.
|
||||
// Encrypt seals plaintext under bindingDomain with the active key.
|
||||
func (c *bindingCipher) Encrypt(plaintext string) (string, error) {
|
||||
return c.EncryptDomain(BindingDomain, plaintext)
|
||||
return c.encryptDomain(bindingDomain, plaintext)
|
||||
}
|
||||
|
||||
// Decrypt opens an envelope sealed under BindingDomain.
|
||||
// Decrypt opens an envelope sealed under bindingDomain.
|
||||
func (c *bindingCipher) Decrypt(envelope string) (string, error) {
|
||||
return c.DecryptDomain(BindingDomain, envelope)
|
||||
return c.decryptDomain(bindingDomain, envelope)
|
||||
}
|
||||
|
||||
// EncryptDomain seals plaintext with the active key and returns the versioned
|
||||
// encryptDomain seals plaintext with the active key and returns the versioned
|
||||
// envelope: "<marker>:v1:<fingerprint>:<base64url(nonce‖ct‖tag)>".
|
||||
func (c *bindingCipher) EncryptDomain(d Domain, plaintext string) (string, error) {
|
||||
func (c *bindingCipher) encryptDomain(d domain, plaintext string) (string, error) {
|
||||
block, err := aes.NewCipher(c.activeKey)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("store: binding cipher: %w", err)
|
||||
@@ -121,9 +116,9 @@ func (c *bindingCipher) EncryptDomain(d Domain, plaintext string) (string, error
|
||||
c.activeFingerprint, base64.RawURLEncoding.EncodeToString(payload)), nil
|
||||
}
|
||||
|
||||
// DecryptDomain decrypts an envelope sealed under d. An unknown key or wrong
|
||||
// decryptDomain decrypts an envelope sealed under d. An unknown key or wrong
|
||||
// domain is an error.
|
||||
func (c *bindingCipher) DecryptDomain(d Domain, envelope string) (string, error) {
|
||||
func (c *bindingCipher) decryptDomain(d domain, envelope string) (string, error) {
|
||||
parts := strings.SplitN(envelope, ":", 4)
|
||||
if len(parts) != 4 || parts[0] != d.marker || parts[1] != bindingEnvelopeVersion {
|
||||
return "", errors.New("store: binding cipher: unrecognised envelope")
|
||||
|
||||
@@ -282,7 +282,7 @@ func (s *taskGrantServer) ResolveTaskGrant(ctx context.Context, r *pb.ResolveTas
|
||||
if err != nil {
|
||||
return nil, status.Error(codes.Unavailable, "execution identity unavailable")
|
||||
}
|
||||
return &pb.ResolveTaskGrantResponse{TaskId: id, ExecutionIdentity: string(principal), PrincipalId: string(principal)}, nil
|
||||
return &pb.ResolveTaskGrantResponse{TaskId: id, ExecutionIdentity: string(principal)}, nil
|
||||
}
|
||||
|
||||
// RegisterTaskGrant creates fresh random material at the daemon and registers
|
||||
@@ -421,15 +421,6 @@ func (s *server) executionPrincipal(ctx context.Context, t *task.Task) (identity
|
||||
return value.ID, nil
|
||||
}
|
||||
|
||||
// TaskPrincipalForCredential resolves the task and its canonical execution principal.
|
||||
func (c *Client) TaskPrincipalForCredential(ctx context.Context, token string) (*task.Task, identity.IdentityID, error) {
|
||||
r, err := c.taskGrant.ResolveTaskGrant(ctx, &pb.ResolveTaskGrantRequest{Token: token})
|
||||
if err != nil {
|
||||
return nil, "", unmapError(err)
|
||||
}
|
||||
t, err := c.TaskByID(ctx, r.TaskId)
|
||||
return t, identity.IdentityID(r.PrincipalId), err
|
||||
}
|
||||
|
||||
type taskGrantServer struct {
|
||||
pb.UnimplementedTaskGrantServiceServer
|
||||
|
||||
@@ -26,6 +26,6 @@ message ResolveTaskGrantResponse {
|
||||
int64 task_id = 1;
|
||||
// Canonical execution identity; empty names the instance root RPC route.
|
||||
string execution_identity = 2;
|
||||
// Canonical principal, including the instance root.
|
||||
string principal_id = 3;
|
||||
reserved 3;
|
||||
reserved "principal_id";
|
||||
}
|
||||
Reference in new issue
Block a user