Compare commits
142
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21980f9ced | ||
|
|
08988692c1
|
||
|
|
6b4ff8101a
|
||
|
|
24a3efcf60
|
||
|
|
bc4ac4436d
|
||
|
|
c538017523
|
||
|
|
2ea0062bef
|
||
|
|
5dc2d79fdb | ||
|
|
f0f09e9189 | ||
|
|
8bf3ace96b
|
||
|
|
8dd28b90be
|
||
|
|
e4663c22c0
|
||
|
|
fa4a078a34
|
||
|
|
f27317738d
|
||
|
|
a7686042e5
|
||
|
|
bc031880bf
|
||
|
|
eb7d852567
|
||
|
|
8c9c19efb0
|
||
|
|
cd8fad1b66
|
||
|
|
2d83b50837
|
||
|
|
4b399e44aa
|
||
|
|
7904ccdfe0
|
||
|
|
56dbb31923
|
||
|
|
74a560533e
|
||
|
|
6127ded28d
|
||
|
|
fe4d574976
|
||
|
|
c9ed3b1ae2
|
||
|
|
afdb0a0c97
|
||
|
|
d1e85c6e2a
|
||
|
|
16f17f702c
|
||
|
|
ba077f3779
|
||
|
|
58f1f9ce57
|
||
|
|
19b273a87b
|
||
|
|
ef3b5f98ea
|
||
|
|
26e19f3de4
|
||
|
|
c5591d95da
|
||
|
|
1c10378a40
|
||
|
|
efe7069bc1
|
||
|
|
67ce2901a5
|
||
|
|
21d1d2e8bf
|
||
|
|
dd57e6563a
|
||
|
|
da941f05aa
|
||
|
|
9c04b74e6f
|
||
|
|
152e7b4d2f
|
||
|
|
911152c9d1
|
||
|
|
0d25c93ea0
|
||
|
|
bed51c4bd1
|
||
|
|
f24c2b4455
|
||
|
|
2ae793cc94
|
||
|
|
b47e98e25f
|
||
|
|
8265e99466
|
||
|
|
30aa351eb6
|
||
|
|
7e701f9a50
|
||
|
|
4a9f30ef04
|
||
|
|
eb4136ffe6
|
||
|
|
383d7d6dad
|
||
|
|
dad6924a0c
|
||
|
|
de05bc2cbd
|
||
|
|
2bfb262e9c
|
||
|
|
0ad4374a2a
|
||
|
|
7f5220dea3
|
||
|
|
4b60033429
|
||
|
|
062336db91
|
||
|
|
60d9b6b7aa
|
||
|
|
e1ada94d78
|
||
|
|
8c267b6edd
|
||
|
|
33f7ebdff4
|
||
|
|
e801306c15
|
||
|
|
4707427759
|
||
|
|
faeaa0d7f0
|
||
|
|
240dc52226
|
||
|
|
7f89b03507
|
||
|
|
787a213db6
|
||
|
|
3e4b020311
|
||
|
|
51a1cf5128
|
||
|
|
d9e993e2b9
|
||
|
|
de3bfe296d
|
||
|
|
53719c6859
|
||
|
|
456c08751a
|
||
|
|
07d14c8d50
|
||
|
|
c1b4ba2b6b
|
||
|
|
84284d59c3
|
||
|
|
5c8fb901f9
|
||
|
|
501338ffbd
|
||
|
|
61f576a25c
|
||
|
|
a5826156a3
|
||
|
|
682995bdf7
|
||
|
|
9c0d043b57
|
||
|
|
aefe2b81e9
|
||
|
|
eadb88d3bf
|
||
|
|
8b9f5b2c60
|
||
|
|
a420b742e8
|
||
|
|
bc56b71539
|
||
|
|
a1347dbfc8
|
||
|
|
34c97ce8e8
|
||
|
|
bd212ec9ac
|
||
|
|
037ab0623a
|
||
|
|
9aceaa15bc
|
||
|
|
0a2aeb65ce
|
||
|
|
5004e8b40b
|
||
|
|
9c5af2c2d3
|
||
|
|
f8c572ebef
|
||
|
|
e72d9313e2
|
||
|
|
f4bfa59dec
|
||
|
|
a54654b0c8
|
||
|
|
81dcc7d94e
|
||
|
|
e3130d53e7
|
||
|
|
098d8cc328
|
||
|
|
6c59d6b742
|
||
|
|
1a0c697858
|
||
|
|
65a8b7cd47
|
||
|
|
970fb2ab84
|
||
|
|
e127b2b05d
|
||
|
|
02227a0b22
|
||
|
|
9c0ea938b8
|
||
|
|
763cd0e581
|
||
|
|
48d0212784
|
||
|
|
f6e9d48da6
|
||
|
|
46238afd62
|
||
|
|
4b494bf75b
|
||
|
|
b9a60e03a3
|
||
|
|
bc72655c8e
|
||
|
|
592d36e0d1
|
||
|
|
d318f912a8
|
||
|
|
31b2827048
|
||
|
|
01fd0fbf97
|
||
|
|
9c0da07807
|
||
|
|
14060675cd
|
||
|
|
74928925c8
|
||
|
|
35e2a216ab
|
||
|
|
b6907d8366
|
||
|
|
4b5c60330d
|
||
|
|
69b5b2aba6
|
||
|
|
d6f3a1a01d
|
||
|
|
ca279a200a
|
||
|
|
5d8c9303e0
|
||
|
|
23f23a6cab
|
||
|
|
64ef2c9af7
|
||
|
|
c091d33a44
|
||
|
|
96342c1564
|
||
|
|
1989948ab3
|
||
|
|
2e48acfc92
|
No files matched your search
@@ -1,24 +1,20 @@
|
||||
# Live reload for archied during dashboard work.
|
||||
# Live reload for the single archie binary during development.
|
||||
#
|
||||
# The frontend has its own loop -- `task ui:dev` runs Vite with HMR and proxies
|
||||
# /api and /events here -- so this watcher deliberately ignores ui/. Watching
|
||||
# it would rebuild the Go binary on every keystroke in a CSS file, and
|
||||
# rebuilding on ui/dist changes would loop against `task ui`.
|
||||
# The frontend has its own loop -- `task dev:ui` runs Vite with HMR and proxies
|
||||
# /api here -- so this watcher deliberately ignores ui/. Watching it would
|
||||
# rebuild the Go binary on every keystroke in a CSS file, and rebuilding on
|
||||
# ui/dist changes would loop against `task ui`.
|
||||
#
|
||||
# ui/dist is NOT rebuilt here. During development the Vite server serves the
|
||||
# frontend directly with HMR, so dist is not what you are looking at; it only
|
||||
# matters for the embedded build, and `task ui` produces it before a commit.
|
||||
# An earlier rule here claimed to keep dist current and never ran: air
|
||||
# requires a file to satisfy include_dir AND include_file together, and ui/ is
|
||||
# excluded from the walk anyway.
|
||||
# Built with `-tags no_ui`: during development Vite serves the frontend
|
||||
# directly with HMR, so embedding ui/dist would only slow down reloads.
|
||||
root = "."
|
||||
tmp_dir = ".air"
|
||||
|
||||
[build]
|
||||
cmd = "go build -o ./.air/archied ./cmd/archied"
|
||||
cmd = "go build -tags no_ui -o ./.air/archie ./cmd/archie"
|
||||
# `bin` is deprecated in air; entrypoint is the current key.
|
||||
entrypoint = "./.air/archied"
|
||||
include_ext = ["go", "toml"]
|
||||
entrypoint = "./.air/archie"
|
||||
include_ext = ["go", "toml", "sql", "yaml", "cedar", "tmpl", "md"]
|
||||
exclude_dir = ["ui", "bin", "docs", ".git", ".task", ".air", "tmp"]
|
||||
exclude_regex = ["_test\\.go"]
|
||||
stop_on_error = true
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
---
|
||||
name: technical-prose-cleanup
|
||||
description: Use when asked to clean up awkward or machine-generated technical writing in Archie's modules without changing behaviour. Reviews one module at a time.
|
||||
---
|
||||
|
||||
# Technical prose cleanup
|
||||
|
||||
Follow `AGENTS.md`. Improve wording without changing behaviour, contracts or
|
||||
technical meaning. Use Australian English.
|
||||
|
||||
## Set the scope
|
||||
|
||||
1. Check the working tree for existing changes. Inspect `modules/` without
|
||||
editing and choose the smallest module with enough clear problems to justify
|
||||
a pass, unless the maintainer has specified one.
|
||||
2. Set the complete file scope before editing: exactly one module, at most
|
||||
15 files. Do not expand into other modules or start another batch.
|
||||
3. Use subagents only when independent work warrants it. Assign at most three
|
||||
in parallel, each with a disjoint list of owned files, this writing standard
|
||||
and relevant examples. Instruct them to inspect the implementation, leave
|
||||
clear prose alone, report ambiguities and make no commits or pushes.
|
||||
The coordinator owns integration and validation. In a shared worktree,
|
||||
avoid broad staging, resets, checkouts and formatters that rewrite other work.
|
||||
|
||||
## Edit in context
|
||||
|
||||
Check comments, errors, logs, test names, schema descriptions, CLI help,
|
||||
prompts, user-facing strings and module documentation. Look for unnatural word
|
||||
order, awkward possessives, unusual verbs, needless synonyms and wording that
|
||||
obscures the operation. Read the surrounding implementation and tests before
|
||||
rewriting. Do not mechanically replace words or edit text that already reads well.
|
||||
|
||||
Use conventional terms, even when they repeat. Keep established idioms such as
|
||||
“pin a dependency”, “drain a stream” and “acquire a lock”. Prefer precision over
|
||||
brevity when conditions, timing, ownership or guarantees matter.
|
||||
|
||||
| Instead of | Write |
|
||||
| --- | --- |
|
||||
| “PrepareRequest names the release to stage and who hears the outcome.” | “PrepareRequest specifies the release to stage and notification recipients.” |
|
||||
| “ReadOnly leaves the agent only the tools that change nothing.” | “ReadOnly restricts the agent to read-only tools.” |
|
||||
| “a release another key signed” | “a release signed by a different key” |
|
||||
| “it recalls earlier incidents and files what it found” | “it retrieves previous incidents and stores new findings” |
|
||||
|
||||
Comments explain why. Remove narration that adds nothing, but keep
|
||||
non-obvious constraints, invariants and decisions. Retain required Go
|
||||
documentation. Don't shorten a comment about replay into a generic retry
|
||||
description: say what is recorded and what is rebuilt or resolved at runtime.
|
||||
Likewise, distinguish a per-action reapproval limit from a run-wide limit,
|
||||
and escalation within one request from a new request.
|
||||
|
||||
Do not refactor or rename identifiers, configuration keys or API fields.
|
||||
Do not edit generated files by hand, add tooling or dependencies, or reformat
|
||||
unrelated code. Check consumers and tests before changing errors, logs or other
|
||||
output. Keep machine-readable values and exact text used as a contract. If a
|
||||
safe edit needs changes outside the scope or the meaning is unclear, leave
|
||||
the text alone and report why.
|
||||
|
||||
For prompts, preserve instructions, conditions, tool semantics and output
|
||||
requirements. Check what the agent actually sees. For example, judgement runs
|
||||
inside an action tool call; it is not a separate tool the agent calls directly.
|
||||
The investigation prompt says: “If a tool call returns a judgement decision,
|
||||
report the decision and any reasons it gives.” Keep matching fixtures in sync
|
||||
when editing prompt text.
|
||||
|
||||
## Review and stop
|
||||
|
||||
Review the combined diff against both the implementation and the starting
|
||||
working tree. Verify the module and file limits, check that unrelated edits
|
||||
are intact, and confirm that no logic or contract changed. If implementation
|
||||
work already shares a file, keep it out of the prose diff; separate by hunk
|
||||
if asked to commit both.
|
||||
|
||||
Run the relevant checks on the final tree and follow `AGENTS.md` for the
|
||||
commit gate. Report failed or unavailable checks; do not fix unrelated
|
||||
failures in this batch. Summarise the module, file count, main edits,
|
||||
deliberately unchanged ambiguities and validation. Stop after this batch.
|
||||
+10
@@ -52,3 +52,13 @@ __pycache__/
|
||||
/.pnpm-store/
|
||||
deployments/archie/.build/
|
||||
.codebase-memory/
|
||||
|
||||
# Vale synced packages, dictionaries, and grammars (recreated by `vale sync`).
|
||||
# Local house rules (.vale/styles/Archie/) and vocabulary stay tracked.
|
||||
/.vale/styles/*
|
||||
!/.vale/styles/Archie/
|
||||
!/.vale/styles/config/
|
||||
/.vale/styles/config/*
|
||||
!/.vale/styles/config/vocabularies/
|
||||
/.vale/styles/config/vocabularies/*
|
||||
!/.vale/styles/config/vocabularies/Archie/
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"buildPath": "code",
|
||||
"hook": {
|
||||
"enabled": true,
|
||||
"limits": {
|
||||
"maxFindings": 5,
|
||||
"maxChars": 8000
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
{
|
||||
"schemaVersion": 2,
|
||||
"generatedAt": "2026-11-24T00:00:00+11:00",
|
||||
"title": "Design System: Archie",
|
||||
"extensions": {
|
||||
"colorMeta": {
|
||||
"signal-sage": { "role": "primary", "displayName": "Signal Sage", "canonical": "#51a580", "tonalRamp": ["#0f2a1e", "#17402e", "#1f5740", "#2e795a", "#51a580", "#7dbf9f", "#acd8c2", "#dcefe5"] },
|
||||
"signal-sage-deep": { "role": "primary", "displayName": "Signal Sage Deep", "canonical": "#2e795a" },
|
||||
"signal-sage-ink": { "role": "primary", "displayName": "Signal Sage Ink", "canonical": "#0c6f4d" },
|
||||
"graphite-card": { "role": "neutral", "displayName": "Graphite Card", "canonical": "#1c1d21", "tonalRamp": ["#0e0f10", "#16171a", "#1c1d21", "#26282c", "#3c3f45", "#70727a", "#a6a39b", "#e8e6e1"] },
|
||||
"paper-canvas": { "role": "neutral", "displayName": "Paper Canvas", "canonical": "#e9e7e2", "tonalRamp": ["#1f1f1d", "#5c5a55", "#8a877f", "#c7c4bd", "#dcdad4", "#e9e7e2", "#f5f4f1", "#ffffff"] },
|
||||
"amber-warn": { "role": "tertiary", "displayName": "Amber Warn", "canonical": "#d9a45b", "tonalRamp": ["#3a2a10", "#5c4116", "#8a5a12", "#b5833a", "#d9a45b", "#e5bf87", "#efd7b3", "#f8eddc"] },
|
||||
"clay-danger": { "role": "tertiary", "displayName": "Clay Danger", "canonical": "#d9776b", "tonalRamp": ["#3d1714", "#5e2420", "#b3413a", "#c75d53", "#d9776b", "#e49d94", "#eec3bd", "#f8e6e3"] },
|
||||
"slate-info": { "role": "tertiary", "displayName": "Slate Info", "canonical": "#8aa4c2", "tonalRamp": ["#17222f", "#24364b", "#3d5f86", "#6283a8", "#8aa4c2", "#adc0d5", "#cfdae6", "#ecf1f6"] },
|
||||
"stone-idle": { "role": "neutral", "displayName": "Stone Idle", "canonical": "#9a978f" }
|
||||
},
|
||||
"typographyMeta": {
|
||||
"page-title": { "displayName": "Page title", "purpose": "One per page, in PageHeader beside the page's actions." },
|
||||
"title": { "displayName": "Title", "purpose": "Card and panel titles." },
|
||||
"label": { "displayName": "Label", "purpose": "Body copy, rows, navigation, buttons and fields." },
|
||||
"caption": { "displayName": "Caption", "purpose": "Metadata, column labels, step-type labels and badges." },
|
||||
"section-label": { "displayName": "Section label", "purpose": "Uppercase group headings in sidebars and settings navigation." },
|
||||
"micro": { "displayName": "Micro", "purpose": "The smallest annotations, used sparingly." },
|
||||
"mono": { "displayName": "Mono", "purpose": "IDs, short hashes, durations, log fields and code." }
|
||||
},
|
||||
"shadows": [
|
||||
{ "name": "rest", "value": "0 1px 2px rgba(0, 0, 0, 0.4)", "purpose": "Top bar and canvas nodes at rest (dark). Light: 0 1px 2px rgba(31, 31, 29, 0.06)." },
|
||||
{ "name": "float", "value": "0 8px 28px rgba(0, 0, 0, 0.4)", "purpose": "Popovers, menus, dialogs and the expanded step node (dark). Light: 0 8px 28px rgba(31, 31, 29, 0.1)." }
|
||||
],
|
||||
"motion": [
|
||||
{ "name": "transition", "value": "140ms cubic-bezier(0.4, 0, 0.2, 1)", "purpose": "Default colour and state transitions." },
|
||||
{ "name": "node-expand", "value": "200ms", "purpose": "Step node width and shadow when it expands in place." },
|
||||
{ "name": "reduced-motion", "value": "0.01ms", "purpose": "All animation and transition durations under prefers-reduced-motion or the reduced-motion setting." }
|
||||
],
|
||||
"breakpoints": [
|
||||
{ "name": "sm", "value": "640px" },
|
||||
{ "name": "md", "value": "768px" },
|
||||
{ "name": "lg", "value": "1024px" }
|
||||
]
|
||||
},
|
||||
"components": [
|
||||
{
|
||||
"name": "Primary Button",
|
||||
"kind": "button",
|
||||
"refersTo": "button-primary",
|
||||
"description": "The one filled action per view.",
|
||||
"html": "<button class=\"ds-btn-primary\">Run workflow</button>",
|
||||
"css": ".ds-btn-primary { height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: var(--primary, #2e795a); color: var(--primary-foreground, #fff); font: 500 0.8125rem 'IBM Plex Sans Variable', system-ui, sans-serif; cursor: pointer; transition: all 140ms cubic-bezier(0.4, 0, 0.2, 1); } .ds-btn-primary:hover { background: color-mix(in srgb, var(--primary, #2e795a) 80%, transparent); } .ds-btn-primary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring, #51a580); } .ds-btn-primary:active { transform: translateY(1px); }"
|
||||
},
|
||||
{
|
||||
"name": "Ghost Button",
|
||||
"kind": "button",
|
||||
"refersTo": "button-ghost",
|
||||
"description": "Default for secondary and contextual actions.",
|
||||
"html": "<button class=\"ds-btn-ghost\">Cancel</button>",
|
||||
"css": ".ds-btn-ghost { height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--foreground, #e8e6e1); font: 500 0.8125rem 'IBM Plex Sans Variable', system-ui, sans-serif; cursor: pointer; transition: all 140ms cubic-bezier(0.4, 0, 0.2, 1); } .ds-btn-ghost:hover { background: var(--muted, #26282c); } .ds-btn-ghost:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring, #51a580); } .ds-btn-ghost:active { transform: translateY(1px); }"
|
||||
},
|
||||
{
|
||||
"name": "Attention Button",
|
||||
"kind": "button",
|
||||
"refersTo": "button-attention",
|
||||
"description": "An action that exists because something is waiting.",
|
||||
"html": "<button class=\"ds-btn-attention\">Review approval</button>",
|
||||
"css": ".ds-btn-attention { height: 36px; padding: 0 10px; border: 1px solid var(--warn, #d9a45b); border-radius: 8px; background: var(--warn-soft, rgba(217,164,91,0.08)); color: var(--warn, #d9a45b); font: 500 0.8125rem 'IBM Plex Sans Variable', system-ui, sans-serif; cursor: pointer; transition: all 140ms cubic-bezier(0.4, 0, 0.2, 1); } .ds-btn-attention:hover { background: rgba(217,164,91,0.16); } .ds-btn-attention:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring, #51a580); }"
|
||||
},
|
||||
{
|
||||
"name": "Text Input",
|
||||
"kind": "input",
|
||||
"refersTo": "input",
|
||||
"description": "Single-line field on the card surface.",
|
||||
"html": "<input class=\"ds-input\" placeholder=\"Workflow name\" />",
|
||||
"css": ".ds-input { height: 36px; width: 240px; padding: 4px 10px; border: 1px solid var(--input, #70727a); border-radius: 8px; background: var(--card, #1c1d21); color: var(--foreground, #e8e6e1); font: 400 0.8125rem 'IBM Plex Sans Variable', system-ui, sans-serif; outline: none; transition: border-color 140ms, box-shadow 140ms; } .ds-input::placeholder { color: var(--fg-muted, #a6a39b); } .ds-input:focus-visible { border-color: var(--ring, #51a580); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring, #51a580) 50%, transparent); }"
|
||||
},
|
||||
{
|
||||
"name": "Status Badges",
|
||||
"kind": "chip",
|
||||
"refersTo": "badge-ok",
|
||||
"description": "Solid tone on its soft background; the only place status colour is decided.",
|
||||
"html": "<span class=\"ds-badge ds-ok\">Succeeded</span> <span class=\"ds-badge ds-warn\">Waiting</span> <span class=\"ds-badge ds-danger\">Failed</span> <span class=\"ds-badge ds-info\">Working</span> <span class=\"ds-badge ds-idle\">Idle</span>",
|
||||
"css": ".ds-badge { display: inline-flex; align-items: center; height: 20px; padding: 2px 8px; border-radius: 4px; font: 500 0.6875rem 'IBM Plex Sans Variable', system-ui, sans-serif; white-space: nowrap; } .ds-ok { background: var(--ok-soft, rgba(81,165,128,0.12)); color: var(--ok, #51a580); } .ds-warn { background: var(--warn-soft, rgba(217,164,91,0.08)); color: var(--warn, #d9a45b); } .ds-danger { background: var(--danger-soft, rgba(217,119,107,0.08)); color: var(--danger, #d9776b); } .ds-info { background: var(--info-soft, rgba(138,164,194,0.1)); color: var(--info, #8aa4c2); } .ds-idle { background: var(--idle-soft, rgba(143,140,133,0.1)); color: var(--idle, #9a978f); }"
|
||||
},
|
||||
{
|
||||
"name": "Section Card",
|
||||
"kind": "card",
|
||||
"refersTo": "card",
|
||||
"description": "Titled card on the workspace; ring, no shadow.",
|
||||
"html": "<section class=\"ds-card\"><h3 class=\"ds-card-title\">Event sources</h3><p class=\"ds-card-body\">prometheus <span class=\"ds-mono\">a41f9c2e</span></p></section>",
|
||||
"css": ".ds-card { width: 320px; padding: 16px; border-radius: 12px; background: var(--card, #1c1d21); color: var(--card-foreground, #e8e6e1); box-shadow: 0 0 0 1px color-mix(in srgb, var(--foreground, #e8e6e1) 10%, transparent); font-family: 'IBM Plex Sans Variable', system-ui, sans-serif; } .ds-card-title { margin: 0 0 8px; font-size: 0.9375rem; font-weight: 500; line-height: 1.375; } .ds-card-body { margin: 0; font-size: 0.8125rem; color: var(--fg-muted, #a6a39b); } .ds-mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 0.6875rem; color: var(--fg-subtle, #99968f); }"
|
||||
},
|
||||
{
|
||||
"name": "Top Bar",
|
||||
"kind": "nav",
|
||||
"refersTo": "top-bar",
|
||||
"description": "Sticky 56px bar with breadcrumb and account controls.",
|
||||
"html": "<header class=\"ds-topbar\"><nav class=\"ds-crumbs\"><a href=\"#\">Workflows</a><span>/</span><span class=\"ds-current\">disk-pressure</span></nav><span class=\"ds-pill\"><i></i>Connected</span></header>",
|
||||
"css": ".ds-topbar { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 16px; background: var(--card, #1c1d21); border-bottom: 1px solid var(--border-strong, #3c3f45); box-shadow: 0 1px 2px rgba(0,0,0,0.4); font: 400 0.8125rem 'IBM Plex Sans Variable', system-ui, sans-serif; } .ds-crumbs { display: flex; gap: 6px; color: var(--fg-muted, #a6a39b); } .ds-crumbs a { color: inherit; text-decoration: none; } .ds-crumbs a:hover { color: var(--foreground, #e8e6e1); } .ds-crumbs a:focus-visible { outline: 2px solid var(--ring, #51a580); outline-offset: 2px; } .ds-current { color: var(--foreground, #e8e6e1); } .ds-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.6875rem; color: var(--fg-muted, #a6a39b); } .ds-pill i { width: 6px; height: 6px; border-radius: 9999px; background: var(--ok, #51a580); }"
|
||||
},
|
||||
{
|
||||
"name": "Step Node",
|
||||
"kind": "custom",
|
||||
"refersTo": "step-node",
|
||||
"description": "The workflow canvas card; the same card shows edit state and live run state.",
|
||||
"html": "<div class=\"ds-node\" tabindex=\"0\"><div class=\"ds-node-meta\"><svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 8V4H8\"/><rect width=\"16\" height=\"12\" x=\"4\" y=\"8\" rx=\"2\"/></svg><span>Agent</span><span class=\"ds-node-dur\">4.2s</span><i class=\"ds-node-dot\"></i></div><div class=\"ds-node-title\">2 Investigate disk usage</div></div>",
|
||||
"css": ".ds-node { width: 240px; padding: 10px 12px; border: 1px solid var(--border, #313338); border-radius: 8px; background: var(--card, #1c1d21); box-shadow: 0 1px 2px rgba(0,0,0,0.4); font-family: 'IBM Plex Sans Variable', system-ui, sans-serif; color: var(--foreground, #e8e6e1); cursor: pointer; transition: width 200ms, box-shadow 200ms, border-color 140ms; } .ds-node:hover { border-color: var(--muted-foreground, #a6a39b); } .ds-node:focus-visible { outline: none; width: 416px; box-shadow: 0 8px 28px rgba(0,0,0,0.4), 0 0 0 2px var(--ring, #51a580); } .ds-node-meta { display: flex; align-items: center; gap: 6px; font-size: 0.6875rem; color: var(--fg-muted, #a6a39b); } .ds-node-meta svg { color: var(--link, #51a580); } .ds-node-dur { margin-left: auto; font-family: 'IBM Plex Mono', ui-monospace, monospace; color: var(--fg-subtle, #99968f); } .ds-node-dot { width: 6px; height: 6px; border-radius: 9999px; background: var(--info, #8aa4c2); } .ds-node-title { margin-top: 6px; font-size: 0.8125rem; font-weight: 500; }"
|
||||
}
|
||||
],
|
||||
"narrative": {
|
||||
"northStar": "The Operations Console",
|
||||
"overview": "Archie's dashboard is a calm instrument panel for someone responsible for a live estate. It is dense and legible, and it stays quiet until something needs the operator. The mood is calm, precise and trustworthy: restraint is how the interface shows it is in control, and nothing raises its voice unless state demands it.\n\nThe palette is Graphite: warm neutral greys with no hue cast and a single accent, Signal Sage. Hierarchy comes from surface steps, hairlines and type weight, never from tinted backgrounds. Colour is a signal, not decoration. Sage marks what is live, healthy or actionable, and the four status hues (amber, clay, slate, stone) each keep one meaning everywhere they appear. Dark and light themes carry the same variable set and the same rules; the operator's OS chooses unless they pick one.\n\nDensity is a first-class setting. The default is already compact, and compact mode tightens the whole spacing scale without shrinking text or hit targets. Controls are compact and contextual: they appear where the work is, on hover or focus, rather than as permanent chrome. The interface never looks like a toy and never borrows generic SaaS gloss.",
|
||||
"keyCharacteristics": [
|
||||
"Warm graphite neutrals, one sage accent, four fixed status hues.",
|
||||
"IBM Plex Sans with Plex Mono for IDs, durations and payloads, on a compact type scale (11 to 15px).",
|
||||
"Flat tonal layers; shadows only for things that float.",
|
||||
"Compact density by default, with a tighter compact mode.",
|
||||
"Both themes, reduced motion and keyboard focus are invariants, not options."
|
||||
],
|
||||
"rules": [
|
||||
{ "name": "The Semantic Names Rule", "body": "Components reference `--primary`, `--ok`, `--warn` and the rest, never a raw hex or a hue name such as `--violet`. A palette change is one file.", "section": "colors" },
|
||||
{ "name": "The One Meaning Rule", "body": "A status colour means the same thing wherever it appears: a task state, a gate result, a log level and a trend all draw from the same five tones.", "section": "colors" },
|
||||
{ "name": "The Measured Contrast Rule", "body": "Every foreground is checked against every surface it lands on, hover states included, at 4.5:1. Nothing dimmer than Text Subtle is allowed as text.", "section": "colors" },
|
||||
{ "name": "The Type Scale Rule", "body": "Use the named steps (`text-micro`, `text-caption`, `text-label`, `text-title`), never pixel sizes. Headings are separated by weight and placement, not by size jumps.", "section": "typography" },
|
||||
{ "name": "The Data Is Mono Rule", "body": "Anything the operator might copy or compare (an ID, a version, a duration, a payload) is set in Plex Mono.", "section": "typography" },
|
||||
{ "name": "The Flat By Default Rule", "body": "Cards sit on the page with a 1px ring, not a shadow. A larger shadow means the element floats above the page.", "section": "elevation" }
|
||||
],
|
||||
"dos": [
|
||||
"Do use semantic tokens (`bg-card`, `text-fg-muted`, `bg-ok-soft`) and the named type steps, so both themes and compact density work without extra code.",
|
||||
"Do keep one filled primary button per view; everything else is ghost, outline or secondary.",
|
||||
"Do set IDs, versions, durations and payloads in Plex Mono.",
|
||||
"Do show actions on hover or focus where the work is, and make every hover action reachable by keyboard.",
|
||||
"Do honour reduced motion: nothing animates when the operator asks it not to."
|
||||
],
|
||||
"donts": [
|
||||
"Don't use generic SaaS gloss: no purple or multicolour gradients, no glow shadows, no glassmorphism cards, no gradient text.",
|
||||
"Don't make it toy-like on phones: no blanket 44px minimum sizes on buttons, links and fields. Widen the tap area invisibly with `touch-hit` instead.",
|
||||
"Don't tint backgrounds for hierarchy; use surface steps and borders.",
|
||||
"Don't introduce a new hue or reuse a status colour for decoration.",
|
||||
"Don't put white text on a status fill; use the soft background and the solid tone.",
|
||||
"Don't add a shadow to a resting card."
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
StylesPath = .vale/styles
|
||||
MinAlertLevel = warning
|
||||
Vocab = Archie
|
||||
|
||||
# Run `vale sync` to install external packages and the Go comment grammar.
|
||||
Packages = Google, Microsoft, Voices, TechTerms, Comments, Prompts
|
||||
Grammars = go
|
||||
|
||||
[formats]
|
||||
tmpl = md
|
||||
|
||||
[*.{md,tmpl}]
|
||||
# Ignore Go/workflow template expressions such as {{ steps.plan.summary }}.
|
||||
TokenIgnores = (\{\{[^}]*\}\})
|
||||
|
||||
BasedOnStyles = Vale, Voices, Direct, Google, Archie
|
||||
|
||||
# Australian English and Archie's technical prose conventions:
|
||||
Google.Spelling = NO
|
||||
Google.Quotes = NO
|
||||
Google.DateFormat = NO
|
||||
Google.OxfordComma = NO
|
||||
Google.EmDash = NO
|
||||
Google.Contractions = NO
|
||||
Google.Parens = NO
|
||||
Google.Semicolons = NO
|
||||
Google.Colons = NO
|
||||
Google.Units = NO
|
||||
Google.Acronyms = NO
|
||||
Google.WordList = NO
|
||||
Google.WordListCase = NO
|
||||
|
||||
# Keep style nudges advisory (visible with --minAlertLevel=suggestion).
|
||||
Google.Headings = suggestion
|
||||
Google.Latin = suggestion
|
||||
Google.Exclamation = warning
|
||||
Google.FirstPerson = suggestion
|
||||
Google.We = suggestion
|
||||
Google.Will = suggestion
|
||||
|
||||
# Selective Microsoft rules (UI verbs, inclusive terminology, hyphens) without
|
||||
# pulling in Microsoft-specific product jargon (e.g. agent -> personal digital assistant).
|
||||
Microsoft.UIVerbs = warning
|
||||
Microsoft.BiasFree = warning
|
||||
Microsoft.Auto = warning
|
||||
Microsoft.Suspended = warning
|
||||
Microsoft.Accessibility = suggestion
|
||||
Microsoft.Uppercase = suggestion
|
||||
|
||||
# "Term: explanation" is idiomatic throughout Archie's docs and comments.
|
||||
Voices.ColonReveal = NO
|
||||
|
||||
# Replaced by Archie.Readability and Archie.SentenceLength, calibrated for technical docs.
|
||||
Direct.Ease = NO
|
||||
Direct.Length = NO
|
||||
Direct.Hedging = warning
|
||||
Direct.Preamble = warning
|
||||
|
||||
# Agent instruction and skill files get additional prompt-quality checks.
|
||||
[{AGENTS,CLAUDE,SKILL}.md]
|
||||
BasedOnStyles = Vale, Voices, Direct, Google, Archie, Prompts
|
||||
# A rule file states each rule once, and many of those rules are absolutes.
|
||||
# The prompt heuristic against repeated absolutes does not apply here.
|
||||
Prompts.Absolutes = NO
|
||||
|
||||
# Model prompts are plain text (no Markdown bold) and reference tool names inline.
|
||||
[internal/prompts/*.{md,tmpl}]
|
||||
Vale.Spelling = suggestion
|
||||
Archie.UILabelFormat = NO
|
||||
|
||||
# Go source comments: doc conventions, spelling, clarity, and no migration narration.
|
||||
[*.go]
|
||||
BasedOnStyles = Vale, Voices, Comments, GoDoc, Archie
|
||||
|
||||
# Go comments often mention camelCase/snake_case identifiers without backticks,
|
||||
# so keep spelling advisory here.
|
||||
Vale.Spelling = suggestion
|
||||
|
||||
# Upstream GoDoc.Sentence regex backtracks heavily on long comment blocks.
|
||||
GoDoc.Sentence = NO
|
||||
Voices.ColonReveal = NO
|
||||
Archie.Readability = NO
|
||||
Archie.SentenceLength = NO
|
||||
Archie.UIElementType = NO
|
||||
Archie.UILabelFormat = NO
|
||||
|
||||
# Never lint generated Go files (protobuf, sqlc).
|
||||
[*.{pb,sql}.go]
|
||||
BasedOnStyles =
|
||||
@@ -0,0 +1,154 @@
|
||||
# Enforce Australian English spelling in prose.
|
||||
# Intentionally omits computing standards that use US forms in Australia
|
||||
# (program, disk, artifact) and verb/noun pairs (licence/license, practise/practice).
|
||||
extends: substitution
|
||||
message: "Use Australian English '%s' instead of '%s'."
|
||||
level: warning
|
||||
ignorecase: true
|
||||
action:
|
||||
name: replace
|
||||
# Exact-case exceptions for HTTP headers and Go method names.
|
||||
exceptions:
|
||||
- Authorize
|
||||
- Authorization
|
||||
swap:
|
||||
analyze: analyse
|
||||
analyzed: analysed
|
||||
analyzes: analyses
|
||||
analyzing: analysing
|
||||
authorization: authorisation
|
||||
authorizations: authorisations
|
||||
authorize: authorise
|
||||
authorized: authorised
|
||||
authorizes: authorises
|
||||
authorizing: authorising
|
||||
behavior: behaviour
|
||||
behavioral: behavioural
|
||||
behaviors: behaviours
|
||||
canceled: cancelled
|
||||
canceling: cancelling
|
||||
canonicalize: canonicalise
|
||||
canonicalized: canonicalised
|
||||
canonicalizes: canonicalises
|
||||
canonicalizing: canonicalising
|
||||
catalog: catalogue
|
||||
cataloged: catalogued
|
||||
cataloging: cataloguing
|
||||
catalogs: catalogues
|
||||
categorization: categorisation
|
||||
categorize: categorise
|
||||
categorized: categorised
|
||||
categorizes: categorises
|
||||
categorizing: categorising
|
||||
center: centre
|
||||
centered: centred
|
||||
centering: centring
|
||||
centers: centres
|
||||
color: colour
|
||||
colored: coloured
|
||||
coloring: colouring
|
||||
colors: colours
|
||||
customization: customisation
|
||||
customize: customise
|
||||
customized: customised
|
||||
customizes: customises
|
||||
customizing: customising
|
||||
favor: favour
|
||||
favored: favoured
|
||||
favoring: favouring
|
||||
favorite: favourite
|
||||
favorites: favourites
|
||||
favors: favours
|
||||
finalize: finalise
|
||||
finalized: finalised
|
||||
finalizes: finalises
|
||||
finalizing: finalising
|
||||
fulfill: fulfil
|
||||
fulfillment: fulfilment
|
||||
fulfills: fulfils
|
||||
initialization: initialisation
|
||||
initialize: initialise
|
||||
initialized: initialised
|
||||
initializes: initialises
|
||||
initializing: initialising
|
||||
judgment: judgement
|
||||
judgments: judgements
|
||||
labeled: labelled
|
||||
labeling: labelling
|
||||
maximize: maximise
|
||||
maximized: maximised
|
||||
maximizes: maximises
|
||||
maximizing: maximising
|
||||
minimize: minimise
|
||||
minimized: minimised
|
||||
minimizes: minimises
|
||||
minimizing: minimising
|
||||
modeled: modelled
|
||||
modeling: modelling
|
||||
normalization: normalisation
|
||||
normalize: normalise
|
||||
normalized: normalised
|
||||
normalizes: normalises
|
||||
normalizing: normalising
|
||||
optimization: optimisation
|
||||
optimizations: optimisations
|
||||
optimize: optimise
|
||||
optimized: optimised
|
||||
optimizes: optimises
|
||||
optimizing: optimising
|
||||
organization: organisation
|
||||
organizational: organisational
|
||||
organizations: organisations
|
||||
organize: organise
|
||||
organized: organised
|
||||
organizes: organises
|
||||
organizing: organising
|
||||
parameterize: parameterise
|
||||
parameterized: parameterised
|
||||
parameterizes: parameterises
|
||||
parameterizing: parameterising
|
||||
prioritize: prioritise
|
||||
prioritized: prioritised
|
||||
prioritizes: prioritises
|
||||
prioritizing: prioritising
|
||||
recognize: recognise
|
||||
recognized: recognised
|
||||
recognizes: recognises
|
||||
recognizing: recognising
|
||||
sanitization: sanitisation
|
||||
sanitize: sanitise
|
||||
sanitized: sanitised
|
||||
sanitizes: sanitises
|
||||
sanitizing: sanitising
|
||||
serialization: serialisation
|
||||
serialize: serialise
|
||||
serialized: serialised
|
||||
serializes: serialises
|
||||
serializing: serialising
|
||||
stabilize: stabilise
|
||||
stabilized: stabilised
|
||||
stabilizes: stabilises
|
||||
stabilizing: stabilising
|
||||
summarize: summarise
|
||||
summarized: summarised
|
||||
summarizes: summarises
|
||||
summarizing: summarising
|
||||
synchronization: synchronisation
|
||||
synchronize: synchronise
|
||||
synchronized: synchronised
|
||||
synchronizes: synchronises
|
||||
synchronizing: synchronising
|
||||
unauthorized: unauthorised
|
||||
|
||||
tests:
|
||||
- name: flags US spelling
|
||||
input: |
|
||||
The organization enforces authorization behavior.
|
||||
want: |
|
||||
1:5:Archie.AustralianEnglish:Use Australian English 'organisation' instead of 'organization'.
|
||||
1:27:Archie.AustralianEnglish:Use Australian English 'authorisation' instead of 'authorization'.
|
||||
1:41:Archie.AustralianEnglish:Use Australian English 'behaviour' instead of 'behavior'.
|
||||
- name: accepts Australian spelling and inline code
|
||||
input: |
|
||||
The organisation enforces authorisation behaviour via `behavior_flag`.
|
||||
want: ""
|
||||
@@ -0,0 +1,29 @@
|
||||
# AGENTS.md: "Comments explain why, not what the code already says.
|
||||
# No migration history, phase names or issue narration in code."
|
||||
extends: existence
|
||||
message: "Avoid migration or plan narration ('%s') in code comments. Explain what the code does or why."
|
||||
level: warning
|
||||
scope: comment.go
|
||||
ignorecase: true
|
||||
nonword: true
|
||||
tokens:
|
||||
- '\b(?:phase|wave|slice|sprint)\s+\d+\b'
|
||||
- '\bepic\s+#\d+\b'
|
||||
- '\b(?:formerly|previously)\s+(?:called|named|known as)\b'
|
||||
- '\b(?:migrated|moved|extracted|ported)\s+from\b'
|
||||
|
||||
tests:
|
||||
- name: flags migration narration in Go comments
|
||||
format: go
|
||||
input: |
|
||||
// Phase 2 moved from internal/legacy.
|
||||
package demo
|
||||
want: |
|
||||
1:4:Archie.NoMigrationNarration:Avoid migration or plan narration ('Phase 2') in code comments. Explain what the code does or why.
|
||||
1:12:Archie.NoMigrationNarration:Avoid migration or plan narration ('moved from') in code comments. Explain what the code does or why.
|
||||
- name: allows normal rationale comments
|
||||
format: go
|
||||
input: |
|
||||
// Verify the HMAC before parsing so malformed payloads cannot trigger work.
|
||||
package demo
|
||||
want: ""
|
||||
@@ -0,0 +1,21 @@
|
||||
# Calibrated for developer documentation: crisp technical docs with domain
|
||||
# terminology typically score 8-11 on Flesch-Kincaid; higher scores usually
|
||||
# signal dense paragraphs that benefit from simpler structure.
|
||||
extends: metric
|
||||
message: "Try to keep the Flesch-Kincaid grade level (%s) at or below 11."
|
||||
link: https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests
|
||||
level: warning
|
||||
formula: |
|
||||
(0.39 * (words / sentences)) + (11.8 * (syllables / words)) - 15.59
|
||||
condition: "> 11"
|
||||
|
||||
tests:
|
||||
- name: flags dense technical prose
|
||||
input: |
|
||||
Notwithstanding architectural encapsulation prerequisites, interdepartmental orchestration mechanisms necessitate comprehensive deterministic authentication verification across heterogeneous distributed administrative infrastructures.
|
||||
want: |
|
||||
1:1:Archie.Readability:Try to keep the Flesch-Kincaid grade level (42.40) at or below 11.
|
||||
- name: accepts clear technical prose
|
||||
input: |
|
||||
A source receives events and checks their HMAC signature. A mapping extracts named fields from the payload. A binding selects the workflow to run.
|
||||
want: ""
|
||||
@@ -0,0 +1,17 @@
|
||||
# Flag overly long sentences in documentation. Set to 35 words so precise
|
||||
# technical constraints fit comfortably while runaway sentences are caught.
|
||||
extends: Std.Readability.SentenceLength
|
||||
message: "This sentence has %d words. Consider splitting it for readability."
|
||||
level: warning
|
||||
max: 35
|
||||
|
||||
tests:
|
||||
- name: flags long sentence
|
||||
input: |
|
||||
When the daemon starts a new workflow run for an incoming event that matched a signed binding, it loads the published workflow definition from storage, allocates an isolated container workspace, prepares task-scoped credentials, and dispatches the first step immediately without waiting.
|
||||
want: |
|
||||
1:1:Archie.SentenceLength:This sentence has 42 words. Consider splitting it for readability.
|
||||
- name: accepts concise technical sentences
|
||||
input: |
|
||||
The daemon loads the published workflow definition and allocates an isolated container workspace. It prepares task-scoped credentials before dispatching the first step.
|
||||
want: ""
|
||||
@@ -0,0 +1,22 @@
|
||||
# Microsoft Writing Style Guide: "Don't include the type of UI element, such as
|
||||
# button or checkbox, unless including it adds needed clarity."
|
||||
extends: existence
|
||||
message: "Omit the UI element type after a bold label ('%s') unless it adds clarity."
|
||||
link: https://learn.microsoft.com/en-us/style-guide/procedures-instructions/describing-interactions-with-ui
|
||||
level: warning
|
||||
scope: raw
|
||||
nonword: true
|
||||
tokens:
|
||||
- '\*\*[^*\n]{1,40}\*\*\s+(?:button|checkbox|check box|dropdown|drop-down|field|icon|link|menu|option|switch|tab|toggle)\b'
|
||||
|
||||
tests:
|
||||
- name: flags bold label followed by UI element type
|
||||
input: |
|
||||
Select the **Save** button and leave the **Shared secret** field blank.
|
||||
want: |
|
||||
1:12:Archie.UIElementType:Omit the UI element type after a bold label ('**Save** button') unless it adds clarity.
|
||||
1:42:Archie.UIElementType:Omit the UI element type after a bold label ('**Shared secret** field') unless it adds clarity.
|
||||
- name: allows bold UI label without element type
|
||||
input: |
|
||||
Select **Save** and leave **Shared secret** blank.
|
||||
want: ""
|
||||
@@ -0,0 +1,46 @@
|
||||
# Input-neutral UI interaction verbs complementing Microsoft.UIVerbs.
|
||||
# Based on Microsoft Writing Style Guide: Describing interactions with UI.
|
||||
extends: substitution
|
||||
message: "Use the input-neutral UI verb '%s' instead of '%s'."
|
||||
link: https://learn.microsoft.com/en-us/style-guide/procedures-instructions/describing-interactions-with-ui
|
||||
level: warning
|
||||
ignorecase: true
|
||||
action:
|
||||
name: replace
|
||||
swap:
|
||||
deselect: clear
|
||||
deselected: cleared
|
||||
deselecting: clearing
|
||||
deselects: clears
|
||||
drag and drop: drag
|
||||
drag-and-drop: drag
|
||||
key in: enter
|
||||
keyed in: entered
|
||||
keying in: entering
|
||||
mouse over: hover over
|
||||
moused over: hovered over
|
||||
mousing over: hovering over
|
||||
navigate to: go to
|
||||
navigated to: went to
|
||||
navigating to: going to
|
||||
press and hold: select and hold
|
||||
tap and hold: select and hold
|
||||
tap on: select
|
||||
tapped on: selected
|
||||
tapping on: selecting
|
||||
uncheck: clear
|
||||
unchecking: clearing
|
||||
unchecks: clears
|
||||
|
||||
tests:
|
||||
- name: flags input-specific UI verbs
|
||||
input: |
|
||||
Navigate to Settings, uncheck Auto-save, and mouse over the badge.
|
||||
want: |
|
||||
1:1:Archie.UIInteractions:Use the input-neutral UI verb 'go to' instead of 'Navigate to'.
|
||||
1:23:Archie.UIInteractions:Use the input-neutral UI verb 'clear' instead of 'uncheck'.
|
||||
1:46:Archie.UIInteractions:Use the input-neutral UI verb 'hover over' instead of 'mouse over'.
|
||||
- name: accepts input-neutral UI verbs
|
||||
input: |
|
||||
Go to Settings, clear Auto-save, and hover over the badge.
|
||||
want: ""
|
||||
@@ -0,0 +1,26 @@
|
||||
# Microsoft Writing Style Guide:
|
||||
# - Use bold formatting for UI element names, not quotation marks.
|
||||
# - Omit trailing colons or ellipses from UI labels in instructions.
|
||||
extends: existence
|
||||
message: "Format UI labels in bold without quotes or trailing punctuation ('%s')."
|
||||
link: https://learn.microsoft.com/en-us/style-guide/procedures-instructions/describing-interactions-with-ui
|
||||
level: warning
|
||||
scope: raw
|
||||
ignorecase: true
|
||||
nonword: true
|
||||
tokens:
|
||||
- '\b(?:select|choose|open|clear|go to|hover over)\s+"[^"\n]{1,40}"'
|
||||
- '\b(?:select|choose|open|clear|go to|hover over)\s+\*\*[^*\n]{1,40}(?::|\.{3}|…)\*\*'
|
||||
|
||||
tests:
|
||||
- name: flags quoted UI labels and trailing punctuation
|
||||
input: |
|
||||
Select "Save" or choose **Export...** and open **Settings:**.
|
||||
want: |
|
||||
1:1:Archie.UILabelFormat:Format UI labels in bold without quotes or trailing punctuation ('Select "Save"').
|
||||
1:18:Archie.UILabelFormat:Format UI labels in bold without quotes or trailing punctuation ('choose **Export...**').
|
||||
1:43:Archie.UILabelFormat:Format UI labels in bold without quotes or trailing punctuation ('open **Settings:**').
|
||||
- name: accepts clean bold UI labels
|
||||
input: |
|
||||
Select **Save**, choose **Export**, and open **Settings**.
|
||||
want: ""
|
||||
@@ -0,0 +1,44 @@
|
||||
# Prefer concise wording over wordy phrases.
|
||||
extends: substitution
|
||||
message: "Use '%s' instead of '%s'."
|
||||
level: warning
|
||||
ignorecase: true
|
||||
action:
|
||||
name: replace
|
||||
swap:
|
||||
a large number of: many
|
||||
a majority of: most
|
||||
a sufficient number of: enough
|
||||
as a means of: to
|
||||
at this point in time: now
|
||||
due to the fact that: because
|
||||
for the purpose of: to
|
||||
has the capability to: can
|
||||
in close proximity to: near
|
||||
in excess of: more than
|
||||
in spite of the fact that: although
|
||||
in the event that: if
|
||||
in the near future: soon
|
||||
make use of: use
|
||||
on a daily basis: daily
|
||||
on a monthly basis: monthly
|
||||
on a weekly basis: weekly
|
||||
prior to: before
|
||||
subsequent to: after
|
||||
take advantage of: use
|
||||
until such time as: until
|
||||
whether or not: whether
|
||||
with regard to: about
|
||||
with respect to: about
|
||||
|
||||
tests:
|
||||
- name: flags wordy phrases
|
||||
input: |
|
||||
Check the signature prior to parsing due to the fact that payloads are untrusted.
|
||||
want: |
|
||||
1:21:Archie.Wordiness:Use 'before' instead of 'prior to'.
|
||||
1:38:Archie.Wordiness:Use 'because' instead of 'due to the fact that'.
|
||||
- name: accepts concise wording
|
||||
input: |
|
||||
Check the signature before parsing because payloads are untrusted.
|
||||
want: ""
|
||||
@@ -0,0 +1,30 @@
|
||||
# Case-insensitive common terms (matched in any capitalisation)
|
||||
(?i)approvers?
|
||||
(?i)archipelago
|
||||
(?i)canonicalis(?:e[ds]?|ing)
|
||||
(?i)carina
|
||||
(?i)confirmers?
|
||||
(?i)fulfilment
|
||||
(?i)passkeys?
|
||||
(?i)reapprovals?
|
||||
(?i)redemptions?
|
||||
(?i)retags?
|
||||
(?i)undispatched
|
||||
(?i)unpushed
|
||||
(?i)worktrees?
|
||||
|
||||
# Proper nouns, tools, and exact-case technical terms
|
||||
archied
|
||||
Catlow
|
||||
depguard
|
||||
gosec
|
||||
govulncheck
|
||||
hclog
|
||||
Huma
|
||||
Miessler
|
||||
Pdeathsig
|
||||
prbench
|
||||
Reka
|
||||
releaseupdate
|
||||
secretengine
|
||||
sqlc
|
||||
@@ -5,9 +5,9 @@ here changes a decision. If a rule stops changing decisions, delete it.
|
||||
|
||||
## What this is
|
||||
|
||||
**archie-core** is event-driven agentic automation. An event (an alert, a
|
||||
webhook, a schedule, a chat message, an issue) is matched to a workflow, the
|
||||
workflow runs an agent whose every action is judged before it runs, and the
|
||||
**archie-core** is event-driven agentic automation. It matches an event (an
|
||||
alert, a webhook, a schedule, a chat message, an issue) to a workflow. The
|
||||
workflow runs an agent, and archie-core judges every action before it runs. The
|
||||
result lands somewhere for review or action. A repository is an optional input
|
||||
to a workflow, not the point of the product. A forge is one of many inputs or
|
||||
outputs; core code never assumes one.
|
||||
@@ -33,9 +33,9 @@ there:
|
||||
needs the maintainer's verdict on its row. Before building anything an old
|
||||
package already does, read that package and carry its behaviour.
|
||||
|
||||
### The services being replaced
|
||||
### The services the binary replaces
|
||||
|
||||
The six services below are deleted slice by slice as the binary replaces them,
|
||||
Delete the six services below slice by slice as the binary replaces them,
|
||||
each only once MIGRATION.md has a verdict for every package it holds. Don't
|
||||
add features to them; fix them only when a bug blocks work.
|
||||
|
||||
@@ -79,13 +79,14 @@ When sources disagree, the higher one wins:
|
||||
the plan, offer options, or ask "shall I proceed?". Stop only for destructive
|
||||
or outward-facing actions (deleting data, pushing, touching a live host).
|
||||
- **Push back when it matters.** If a request competes with something clearly
|
||||
more urgent (a bug that loses work, a failure that shows nothing, a security
|
||||
gap, a broken setup path), or looks like the wrong call, say so once in a
|
||||
sentence or two and suggest whether it belongs in the backlog. Then do what
|
||||
was asked: don't repeat the point or hold work back on your own judgement.
|
||||
more urgent, or looks like the wrong call, say so once in a sentence or two.
|
||||
A bug that loses work, a failure that shows nothing, a security gap and a
|
||||
broken setup path are all more urgent. Suggest whether it belongs in the
|
||||
backlog. Then do what the maintainer asked: don't repeat the point or hold
|
||||
work back on your own judgement.
|
||||
- **Post outside the repo only when told.** Chat, tickets and any external
|
||||
service get a message only on the maintainer's instruction.
|
||||
- **Report, don't narrate.** Final replies say what changed, what was verified,
|
||||
- **Report, don't narrate.** Final replies say what changed, what you verified,
|
||||
and anything blocked, in a few lines. No preamble, no recap of the request, no
|
||||
closing offers of more help. Leave out what the maintainer can see or infer:
|
||||
a clean tree, unpushed commits, a passing gate (commits imply it), and steps
|
||||
@@ -113,11 +114,12 @@ When sources disagree, the higher one wins:
|
||||
- **No compensating tools.** Do not write a linter, checker or generator to
|
||||
enforce something a simpler design would make unnecessary. Fix the design.
|
||||
- **A setting must work end to end.** A config field that parses but has no
|
||||
consumer is a bug. Settings are edited through the control plane (API and
|
||||
dashboard), never by requiring a server login.
|
||||
consumer is a bug. Operators edit settings through the control plane (API and
|
||||
dashboard), never through a server login.
|
||||
- **Ask only for real decisions.** Product direction and trade-offs the
|
||||
maintainer owns are questions. Everything with a conventional answer is not:
|
||||
decide, do it, say what you chose.
|
||||
maintainer owns are questions. Anything with a conventional engineering
|
||||
answer or an existing pattern in the codebase is not: decide, do it, say
|
||||
what you chose.
|
||||
|
||||
## Code
|
||||
|
||||
@@ -127,7 +129,8 @@ When sources disagree, the higher one wins:
|
||||
- Dependencies point inward: `cmd → app → {domain, infrastructure}`,
|
||||
`infrastructure` implements `domain` interfaces, `domain` imports neither.
|
||||
`cmd/` parses flags and calls `app`, nothing else.
|
||||
- Fix invalid state where it is produced, not with checks where it is consumed.
|
||||
- Fix invalid state where the code produces it, not with checks where the
|
||||
code consumes it.
|
||||
- Log through the service's injected `*slog.Logger` with the `...Context`
|
||||
methods, so lines carry the OpenTelemetry trace id. Never the global `slog`.
|
||||
- If a fix fails twice, throw the block away and rewrite it simply.
|
||||
@@ -138,8 +141,12 @@ When sources disagree, the higher one wins:
|
||||
terminology and normal word order. Avoid invented metaphors, awkward
|
||||
possessives, inverted sentences and clever paraphrases. Prefer repeating
|
||||
an established term over inventing a synonym.
|
||||
- Generated files (protobuf, sqlc) are regenerated and committed
|
||||
with the change that caused them, never hand-edited.
|
||||
- Regenerate generated files (protobuf, sqlc) and commit them with the change
|
||||
that caused them; never hand-edit them.
|
||||
- Foreign keys and attribution always reference immutable primary IDs, never
|
||||
mutable or non-unique attributes (display names, slugs, emails). Store
|
||||
display labels alongside an ID only when you need point-in-time snapshot
|
||||
fidelity.
|
||||
|
||||
## Tests
|
||||
|
||||
@@ -155,14 +162,14 @@ The default for a change is no new test. Write one only when:
|
||||
A test that exists must catch a real regression, survive refactoring, run fast,
|
||||
and be cheap to keep. Never test wiring, constants, defaults, struct shapes,
|
||||
fakes, or call order. Prefer making an invalid state unrepresentable to testing
|
||||
that it is rejected.
|
||||
that the code rejects it.
|
||||
|
||||
How to write one:
|
||||
|
||||
- **Prove it.** Run the new test against the code before the fix and see it
|
||||
fail. A test that passes either way proves nothing: delete it. When a bug
|
||||
can't be reproduced deterministically (a race, say), fix it with an API that
|
||||
rules it out and don't add a test.
|
||||
fail. A test that passes either way proves nothing: delete it. When you
|
||||
can't reproduce a bug deterministically (a race, say), fix it with an API
|
||||
that rules it out and don't add a test.
|
||||
- **One table per behaviour.** Extend the table instead of adding a second test.
|
||||
Name the test after the behaviour, and say in its comment what regression it
|
||||
guards.
|
||||
@@ -174,7 +181,7 @@ How to write one:
|
||||
- **Isolated.** Use `t.TempDir()` and `t.Setenv`, never host state. A test that
|
||||
commits with git sets `GIT_CONFIG_GLOBAL` to `os.DevNull`. No test opens a
|
||||
real database or needs Docker: test SQL semantics at the interceptor or domain
|
||||
level with fakes. Files are written `0o600`, or `0o700` for a script.
|
||||
level with fakes. Tests write files `0o600`, or `0o700` for a script.
|
||||
- **Shared setup in helpers.** When several tests repeat the same setup, put it
|
||||
in a helper in a `_test.go` file, never in production code.
|
||||
|
||||
@@ -182,18 +189,19 @@ How to write one:
|
||||
|
||||
These protect users. Do not weaken them without the maintainer's say-so.
|
||||
|
||||
- A crash loses no accepted work, and a restart resumes every run. Work is
|
||||
acknowledged only once it is durable. A missing dependency is reported
|
||||
unhealthy and retried, never a reason to exit.
|
||||
- A crash loses no accepted work, and a restart resumes every run. The service
|
||||
that accepts the work acknowledges it only once it is durable. A service
|
||||
reports a missing dependency as unhealthy and retries it; that is never a
|
||||
reason to exit.
|
||||
- The model never runs git. Commits and pushes go through the daemon.
|
||||
- The daemon's own credentials never enter an agent container. Containers get
|
||||
task-scoped grants that are revoked when the task ends.
|
||||
- Webhook HMAC is verified before the payload is parsed.
|
||||
task-scoped grants that the daemon revokes when the task ends.
|
||||
- The events module verifies webhook HMAC before it parses the payload.
|
||||
- Task briefs go in `<worktree>/.git/task.json`, never the worktree root.
|
||||
- NATS: task and RPC replies use `msg.Respond`; flush after registering a
|
||||
responder; `ARCHIE_TASKS` is a work queue, so never bind overlapping
|
||||
consumers.
|
||||
- `ai-sdk` `FullStream` must be drained completely.
|
||||
- Drain `ai-sdk` `FullStream` completely.
|
||||
|
||||
## Build and gate
|
||||
|
||||
@@ -221,16 +229,16 @@ Requires Go 1.27, Task, golangci-lint, Node, pnpm and Docker. Adopt `task fmt` a
|
||||
run, say what you did verify.
|
||||
- Commit finished work without asking. Stage only your own paths and commit in
|
||||
the same command. Conventional Commits scoped by package, short messages. Push
|
||||
every commit as soon as it is made; a local-only commit is not acceptable.
|
||||
every commit as soon as you make it; a local-only commit is not acceptable.
|
||||
- Never commit binaries, build output, scratch files or `.references/`. Scratch
|
||||
goes in `/tmp`.
|
||||
- Runtime config lives at `${XDG_CONFIG_HOME:-~/.config}/archie/config.toml`.
|
||||
Nothing in the working tree is read at runtime. Systemd is optional.
|
||||
The runtime reads nothing in the working tree. Systemd is optional.
|
||||
- Releases: `RELEASING.md`.
|
||||
|
||||
## Issues (Gitea)
|
||||
|
||||
Work is tracked as issues on the primary remote, never in Markdown TODO files.
|
||||
Track work as issues on the primary remote, never in Markdown TODO files.
|
||||
GitHub is a read-only mirror; do not open, close or comment there.
|
||||
|
||||
```bash
|
||||
@@ -241,12 +249,12 @@ tea comment 497 "what changed, and what was run"
|
||||
tea issues close 497
|
||||
```
|
||||
|
||||
- An issue is the plan: what is wrong or wanted, and how you know it is done.
|
||||
Keep it to that.
|
||||
- An issue is the plan: what is wrong or wanted, and how you know the work is
|
||||
complete. Keep it to that.
|
||||
- Labels carry state: a type (`bug`, `feature`, `task`, `chore`, `epic`,
|
||||
`decision`, `discovery`), a priority (`critical`, `high`, `medium`, `low`), `in-progress`
|
||||
and `deferred`. Open/closed is the issue state, not a label.
|
||||
- An epic's children are its dependencies: link each one as it is filed (Gitea
|
||||
- An epic's children are its dependencies: link each one as you file it (Gitea
|
||||
MCP `issue_write` `add_dependency`, the epic `blocked_by` the child), plus any
|
||||
real blocker between children. No `epic/<slug>` label; the dependencies are
|
||||
the link, and the only place the web UI shows an epic's children.
|
||||
@@ -263,6 +271,6 @@ tea issues close 497
|
||||
|
||||
## Changing this file
|
||||
|
||||
A rule is added only after a real failure it would have prevented, and it must
|
||||
Add a rule only after a real failure it would have prevented, and it must
|
||||
say which decision it changes. Remove rules that no longer change decisions.
|
||||
Keep it short enough to read in full every session.
|
||||
@@ -0,0 +1,411 @@
|
||||
---
|
||||
name: Archie
|
||||
description: Event-driven Agentic Automation
|
||||
colors:
|
||||
signal-sage: "#51a580"
|
||||
signal-sage-deep: "#2e795a"
|
||||
signal-sage-ink: "#0c6f4d"
|
||||
graphite-canvas: "#0e0f10"
|
||||
graphite-workspace: "#16171a"
|
||||
graphite-card: "#1c1d21"
|
||||
graphite-popover: "#202226"
|
||||
graphite-hover: "#26282c"
|
||||
graphite-hairline: "#2a2c30"
|
||||
graphite-border: "#313338"
|
||||
graphite-border-strong: "#3c3f45"
|
||||
graphite-input: "#70727a"
|
||||
graphite-text: "#e8e6e1"
|
||||
graphite-text-muted: "#a6a39b"
|
||||
graphite-text-subtle: "#99968f"
|
||||
paper-canvas: "#e9eaec"
|
||||
paper-workspace: "#f3f4f5"
|
||||
paper-card: "#ffffff"
|
||||
paper-hover: "#e7e9ec"
|
||||
paper-hairline: "#d2d5da"
|
||||
paper-border: "#d5d8dc"
|
||||
paper-border-strong: "#bec3c9"
|
||||
paper-input: "#838890"
|
||||
paper-text: "#202327"
|
||||
paper-text-muted: "#585d64"
|
||||
paper-text-subtle: "#656a72"
|
||||
amber-warn: "#d9a45b"
|
||||
amber-warn-ink: "#8a5a12"
|
||||
clay-danger: "#d9776b"
|
||||
clay-danger-ink: "#b3413a"
|
||||
slate-info: "#8aa4c2"
|
||||
slate-info-ink: "#3d5f86"
|
||||
stone-idle: "#9a978f"
|
||||
stone-idle-ink: "#5b6068"
|
||||
typography:
|
||||
title:
|
||||
fontFamily: "IBM Plex Sans Variable, system-ui, sans-serif"
|
||||
fontSize: "0.9375rem"
|
||||
fontWeight: 500
|
||||
lineHeight: 1.375
|
||||
page-title:
|
||||
fontFamily: "IBM Plex Sans Variable, system-ui, sans-serif"
|
||||
fontSize: "0.9375rem"
|
||||
fontWeight: 600
|
||||
lineHeight: 1.25
|
||||
letterSpacing: "-0.025em"
|
||||
label:
|
||||
fontFamily: "IBM Plex Sans Variable, system-ui, sans-serif"
|
||||
fontSize: "0.8125rem"
|
||||
fontWeight: 400
|
||||
caption:
|
||||
fontFamily: "IBM Plex Sans Variable, system-ui, sans-serif"
|
||||
fontSize: "0.6875rem"
|
||||
fontWeight: 500
|
||||
section-label:
|
||||
fontFamily: "IBM Plex Sans Variable, system-ui, sans-serif"
|
||||
fontSize: "0.6875rem"
|
||||
fontWeight: 500
|
||||
letterSpacing: "0.06em"
|
||||
micro:
|
||||
fontFamily: "IBM Plex Sans Variable, system-ui, sans-serif"
|
||||
fontSize: "0.625rem"
|
||||
mono:
|
||||
fontFamily: "IBM Plex Mono, ui-monospace, monospace"
|
||||
fontSize: "0.6875rem"
|
||||
fontWeight: 400
|
||||
rounded:
|
||||
sm: "4px"
|
||||
md: "6px"
|
||||
lg: "8px"
|
||||
xl: "12px"
|
||||
full: "9999px"
|
||||
spacing:
|
||||
unit: "0.25rem"
|
||||
unit-compact: "0.225rem"
|
||||
control-gap: "0.375rem"
|
||||
card-x: "1rem"
|
||||
card-y: "1rem"
|
||||
page-x: "1.5rem"
|
||||
page-y: "1.25rem"
|
||||
components:
|
||||
button-primary:
|
||||
backgroundColor: "{colors.signal-sage-deep}"
|
||||
textColor: "#ffffff"
|
||||
typography: "{typography.label}"
|
||||
rounded: "{rounded.lg}"
|
||||
padding: "0 10px"
|
||||
height: "36px"
|
||||
button-ghost:
|
||||
backgroundColor: "transparent"
|
||||
textColor: "{colors.graphite-text}"
|
||||
typography: "{typography.label}"
|
||||
rounded: "{rounded.lg}"
|
||||
padding: "0 10px"
|
||||
height: "36px"
|
||||
button-ghost-hover:
|
||||
backgroundColor: "{colors.graphite-hover}"
|
||||
button-attention:
|
||||
backgroundColor: "rgba(217, 164, 91, 0.08)"
|
||||
textColor: "{colors.amber-warn}"
|
||||
typography: "{typography.label}"
|
||||
rounded: "{rounded.lg}"
|
||||
padding: "0 10px"
|
||||
height: "36px"
|
||||
button-destructive:
|
||||
backgroundColor: "rgba(217, 119, 107, 0.2)"
|
||||
textColor: "{colors.clay-danger}"
|
||||
typography: "{typography.label}"
|
||||
rounded: "{rounded.lg}"
|
||||
padding: "0 10px"
|
||||
height: "36px"
|
||||
input:
|
||||
backgroundColor: "{colors.graphite-card}"
|
||||
textColor: "{colors.graphite-text}"
|
||||
typography: "{typography.label}"
|
||||
rounded: "{rounded.lg}"
|
||||
padding: "4px 10px"
|
||||
height: "36px"
|
||||
card:
|
||||
backgroundColor: "{colors.graphite-card}"
|
||||
textColor: "{colors.graphite-text}"
|
||||
rounded: "{rounded.xl}"
|
||||
padding: "16px"
|
||||
badge-ok:
|
||||
backgroundColor: "rgba(81, 165, 128, 0.12)"
|
||||
textColor: "{colors.signal-sage}"
|
||||
typography: "{typography.caption}"
|
||||
rounded: "{rounded.sm}"
|
||||
padding: "2px 8px"
|
||||
height: "20px"
|
||||
badge-warn:
|
||||
backgroundColor: "rgba(217, 164, 91, 0.08)"
|
||||
textColor: "{colors.amber-warn}"
|
||||
typography: "{typography.caption}"
|
||||
rounded: "{rounded.sm}"
|
||||
padding: "2px 8px"
|
||||
height: "20px"
|
||||
badge-danger:
|
||||
backgroundColor: "rgba(217, 119, 107, 0.08)"
|
||||
textColor: "{colors.clay-danger}"
|
||||
typography: "{typography.caption}"
|
||||
rounded: "{rounded.sm}"
|
||||
padding: "2px 8px"
|
||||
height: "20px"
|
||||
status-dot:
|
||||
rounded: "{rounded.full}"
|
||||
size: "6px"
|
||||
top-bar:
|
||||
backgroundColor: "{colors.graphite-card}"
|
||||
height: "56px"
|
||||
padding: "0 16px"
|
||||
step-node:
|
||||
backgroundColor: "{colors.graphite-card}"
|
||||
rounded: "{rounded.lg}"
|
||||
padding: "10px 12px"
|
||||
width: "240px"
|
||||
step-node-expanded:
|
||||
width: "416px"
|
||||
---
|
||||
|
||||
# Design System: Archie
|
||||
|
||||
## Overview
|
||||
|
||||
**Creative North Star: "The Operations Console"**
|
||||
|
||||
Archie's dashboard is a calm instrument panel for someone responsible for a live
|
||||
estate. It is dense and legible, and it stays quiet until something needs the
|
||||
operator. The mood is calm, precise and trustworthy: restraint is how the
|
||||
interface shows it is in control, and nothing raises its voice unless state
|
||||
demands it.
|
||||
|
||||
Graphite dark and Neutral light share one accent, Signal Sage. Neutral surfaces,
|
||||
hairlines and type weight set the hierarchy. Solid sage marks the primary action;
|
||||
a sage line or outline marks selection and focus. Labelled badges carry status.
|
||||
Both themes use the same tokens, and the operator's OS chooses the theme unless
|
||||
they pick one.
|
||||
|
||||
Density is a first-class setting. The default is already compact, and compact mode
|
||||
tightens the whole spacing scale without shrinking text or hit targets. Controls
|
||||
are compact and contextual: they appear where the work is, on hover or focus,
|
||||
rather than as permanent chrome. The interface never looks like a toy and never
|
||||
borrows generic SaaS gloss.
|
||||
|
||||
**Key Characteristics:**
|
||||
- Neutral light and Graphite dark, with one sage accent.
|
||||
- IBM Plex Sans with Plex Mono for IDs, durations and payloads, on a compact type
|
||||
scale (11 to 15px).
|
||||
- Flat tonal layers; shadows only for things that float.
|
||||
- Compact density by default, with a tighter compact mode.
|
||||
- Both themes, reduced motion and keyboard focus are invariants, not options.
|
||||
|
||||
## Colours
|
||||
|
||||
Neutral greys carry the structure. Signal Sage marks actions and selection;
|
||||
status colours retain their meaning across both themes.
|
||||
|
||||
### Primary
|
||||
- **Signal Sage** (#51a580): the mark, accents, focus rings and links in dark mode,
|
||||
and the `ok` state there. On a dark card it is 5.7:1 as text.
|
||||
- **Signal Sage Deep** (#2e795a): the primary button fill in both themes (white on
|
||||
it is 5.3:1) and the focus ring on paper, where bright sage falls under 3:1.
|
||||
- **Signal Sage Ink** (#0c6f4d): links and `ok` text in the light theme, 5.0:1 on
|
||||
the paper canvas.
|
||||
|
||||
### Neutral
|
||||
- **Graphite Canvas** (#0e0f10) / **Paper Canvas** (#e9eaec): the page behind
|
||||
everything.
|
||||
- **Graphite Workspace** (#16171a) / **Paper Workspace** (#f3f4f5): the main
|
||||
content area inside the sidebar shell.
|
||||
- **Graphite Card** (#1c1d21) / **Paper Card** (#ffffff): cards, the top bar,
|
||||
inputs and canvas nodes. **Graphite Popover** (#202226) lifts menus one step
|
||||
above cards in dark mode.
|
||||
- **Graphite Hover** (#26282c) / **Paper Hover** (#e7e9ec): hover, secondary and
|
||||
muted surfaces (shadcn's `accent`, `muted` and `secondary` all share it).
|
||||
- **Hairline, Border, Border Strong** (#2a2c30, #313338, #3c3f45 dark; #d2d5da,
|
||||
#d5d8dc, #bec3c9 light): dividers, card edges and the top bar's bottom edge.
|
||||
- **Input stroke** (#70727a dark, #838890 light): field borders.
|
||||
- **Text, Text Muted, Text Subtle** (#e8e6e1, #a6a39b, #99968f dark; #202327,
|
||||
#585d64, #656a72 light): primary copy, secondary copy, and the dimmest text
|
||||
allowed, for hints and captions only.
|
||||
|
||||
### Status
|
||||
- **Amber Warn** (#d9a45b dark, #8a5a12 light): waiting, needs attention, the
|
||||
`attention` button.
|
||||
- **Clay Danger** (#d9776b dark, #b3413a light): failures and destructive
|
||||
actions.
|
||||
- **Slate Info** (#8aa4c2 dark, #3d5f86 light): an agent that is working.
|
||||
- **Stone Idle** (#9a978f dark, #5b6068 light): idle, inactive or unknown.
|
||||
|
||||
Each status hue has a soft background at 8 to 12% alpha of its own tone. Status
|
||||
badges put the solid tone on the soft background, never white text on a fill.
|
||||
|
||||
### Named Rules
|
||||
**The Semantic Names Rule.** Components reference `--primary`, `--ok`, `--warn`
|
||||
and the rest, never a raw hex or a hue name such as `--violet`. A palette change is
|
||||
one file.
|
||||
|
||||
**The One Meaning Rule.** A status colour means the same thing wherever it
|
||||
appears: a task state, a gate result, a log level and a trend all draw from the
|
||||
same five tones.
|
||||
|
||||
**The Measured Contrast Rule.** Every foreground is checked against every surface
|
||||
it lands on, hover states included, at 4.5:1. Nothing dimmer than Text Subtle is
|
||||
allowed as text.
|
||||
|
||||
## Typography
|
||||
|
||||
**Body Font:** IBM Plex Sans Variable (with system-ui, sans-serif)
|
||||
**Label/Mono Font:** IBM Plex Mono (with ui-monospace, monospace)
|
||||
|
||||
**Character:** A sober, engineered grotesque paired with its own monospace, so
|
||||
identifiers, durations and payloads read as data without changing voice.
|
||||
|
||||
### Hierarchy
|
||||
- **Page title** (600, 0.9375rem, 1.25, -0.025em): one per page, in PageHeader
|
||||
beside the page's actions.
|
||||
- **Title** (500, 0.9375rem, 1.375): card and panel titles.
|
||||
- **Label** (400 to 500, 0.8125rem): body copy, rows, navigation, buttons and
|
||||
fields. The default text size of the dashboard.
|
||||
- **Caption** (500, 0.6875rem): metadata, column labels, step-type labels and
|
||||
badges.
|
||||
- **Section label** (500, 0.6875rem, 0.06em, uppercase): group headings in
|
||||
sidebars and settings navigation only.
|
||||
- **Micro** (0.625rem): the smallest annotations, used sparingly.
|
||||
- **Mono** (400, caption size): IDs, short hashes, durations, log fields and code.
|
||||
|
||||
### Named Rules
|
||||
**The Type Scale Rule.** Use the named steps (`text-micro`, `text-caption`,
|
||||
`text-label`, `text-title`), never pixel sizes. Headings are separated by weight
|
||||
and placement, not by size jumps.
|
||||
|
||||
**The Data Is Mono Rule.** Anything the operator might copy or compare (an ID, a
|
||||
version, a duration, a payload) is set in Plex Mono.
|
||||
|
||||
## Layout
|
||||
|
||||
The app shell is a collapsible sidebar plus a sticky 56px top bar holding the
|
||||
breadcrumb and account controls. Page content sits in the workspace surface with
|
||||
1.5rem by 1.25rem padding, dropping to 1rem below the large breakpoint, and a
|
||||
bottom clearance for the docked chat composer. The chat can pin to either side,
|
||||
and the workspace shifts to make room for it.
|
||||
|
||||
Spacing is Tailwind's 0.25rem scale; compact density sets the unit to 0.225rem,
|
||||
so every gap and padding tightens together and components keep their relative
|
||||
rhythm. Pages use container queries (`@container`) so panels respond to the space
|
||||
they actually have, not the viewport.
|
||||
|
||||
Phone width is a real target. Desktop layouts collapse to dropdowns instead of
|
||||
side lists and to stacked panes, and nothing overlaps the canvas. Controls keep
|
||||
their desktop size on touch screens; a `touch-hit` utility widens the tap area to
|
||||
44px invisibly, and only rows in floating menus grow to 2.75rem.
|
||||
|
||||
The workflow canvas is the one full-bleed surface: on phones it takes the full
|
||||
viewport height, and steps expand in place rather than opening side panels.
|
||||
|
||||
## Elevation & Depth
|
||||
|
||||
The system is flat, with tonal layers. Depth comes from surface steps (canvas,
|
||||
workspace, card, popover) and from hairlines and 1px rings. Shadows are reserved
|
||||
for things that float above the page: menus, popovers, dialogs and an expanded
|
||||
canvas node.
|
||||
|
||||
### Shadow Vocabulary
|
||||
- **Rest** (`box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4)` dark, `0 1px 2px
|
||||
rgba(31, 31, 29, 0.06)` light): the top bar and canvas nodes at rest; barely
|
||||
there.
|
||||
- **Float** (`box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4)` dark, `0 8px 28px
|
||||
rgba(31, 31, 29, 0.1)` light): popovers, menus, dialogs and the expanded step
|
||||
node.
|
||||
|
||||
### Named Rules
|
||||
**The Flat By Default Rule.** Cards sit on the page with a 1px ring, not a
|
||||
shadow. A larger shadow means the element floats above the page.
|
||||
|
||||
## Shapes
|
||||
|
||||
Gently rounded and consistent. Controls, inputs and canvas nodes use 8px corners
|
||||
(`rounded.lg`); cards use 12px (`rounded.xl`); badges use 4px (`rounded.sm`), and
|
||||
small buttons step down to 6px. Status dots and avatars are the only full circles.
|
||||
Borders are 1px and quiet; a strong border marks structural edges such as the top
|
||||
bar. Focus is always a visible 2px ring offset by 2px, in sage.
|
||||
|
||||
## Components
|
||||
|
||||
Compact and contextual: small controls that appear where the work is.
|
||||
|
||||
### Buttons
|
||||
- **Shape:** gently rounded (8px), 36px tall by default, with 32px and 24px sizes
|
||||
and square icon variants.
|
||||
- **Primary:** Signal Sage Deep fill with white label text. At most one per view.
|
||||
- **Ghost / Outline / Secondary:** transparent or hover-surface fills that pick
|
||||
up the hover surface on hover; the default for everything that is not the main
|
||||
action.
|
||||
- **Attention:** amber stroke and soft amber fill, for an action that exists
|
||||
because something is waiting. Not destructive.
|
||||
- **Destructive:** soft clay fill with clay text, never a solid red block.
|
||||
- **Hover / Focus:** 140ms colour transitions, a 3px sage focus ring, and a 1px
|
||||
downward press on active.
|
||||
|
||||
### Chips (Badges)
|
||||
- **Style:** 20px tall, 4px corners, caption type. Status badges (`ok`, `warn`,
|
||||
`danger`, `info`, `idle`) set the solid tone on its soft background.
|
||||
- **State:** the badge and the StatusDot are the only places status colour is
|
||||
decided.
|
||||
|
||||
### Cards / Containers
|
||||
- **Corner Style:** 12px.
|
||||
- **Background:** the card surface on the workspace.
|
||||
- **Edges:** a 1px border ring, without a shadow.
|
||||
- **Internal Padding:** 16px, or 12px for the small size. Section wraps a card
|
||||
with a title; an edited section shows a sage ring.
|
||||
- **Data tables:** card surface, muted header and a border, without card padding
|
||||
or a shadow.
|
||||
- **Alerts:** use the semantic soft fill and a matching border so they don't
|
||||
look like regular cards.
|
||||
|
||||
### Inputs / Fields
|
||||
- **Style:** card background, 1px input stroke, 8px corners, 36px tall, label
|
||||
size (title size on touch screens so phones do not zoom).
|
||||
- **Focus:** the border turns sage with a 3px sage ring.
|
||||
- **Error / Disabled:** a clay border and ring; disabled fields drop to 50%
|
||||
opacity.
|
||||
|
||||
### Navigation
|
||||
- **Sidebar:** card surface, label-size rows, uppercase section labels in Text
|
||||
Subtle, the hover surface on hover and active. Collapses on phones.
|
||||
- **Top bar:** card surface, 56px, strong bottom border with the rest shadow,
|
||||
breadcrumb on the left and a connection pill and account menu on the right.
|
||||
- **Selection:** the active tab uses a sage underline. Pressed toggles use a
|
||||
sage outline and a soft fill.
|
||||
|
||||
### Status Dot
|
||||
A 6px circle in one of the five status tones. It pulses (motion-safe only) while
|
||||
the thing it marks is live.
|
||||
|
||||
### Step Node (Signature Component)
|
||||
The workflow canvas card. 240px wide at rest, with an 8px corner, the rest shadow
|
||||
and a caption row naming the step type with a sage icon. The run duration sits on
|
||||
the right in mono, beside a status icon. The title below is label size and medium
|
||||
weight. Selecting it expands it in place to 416px with the float shadow and a 2px
|
||||
sage ring, main field first. The same card shows the step's live run state:
|
||||
editor and observer are one surface. Added, removed and changed steps are marked
|
||||
in the sage, clay and amber tones.
|
||||
|
||||
## Do's and Don'ts
|
||||
|
||||
### Do:
|
||||
- **Do** use semantic tokens (`bg-card`, `text-fg-muted`, `bg-ok-soft`) and the
|
||||
named type steps, so both themes and compact density work without extra code.
|
||||
- **Do** keep one filled primary button per view; everything else is ghost,
|
||||
outline or secondary.
|
||||
- **Do** set IDs, versions, durations and payloads in Plex Mono.
|
||||
- **Do** show actions on hover or focus where the work is, and make every hover
|
||||
action reachable by keyboard.
|
||||
- **Do** honour reduced motion: nothing animates when the operator asks it not to.
|
||||
|
||||
### Don't:
|
||||
- **Don't** use generic SaaS gloss: no purple or multicolour gradients, no glow
|
||||
shadows, no glassmorphism cards, no gradient text.
|
||||
- **Don't** make it toy-like on phones: no blanket 44px minimum sizes on buttons,
|
||||
links and fields. Widen the tap area invisibly with `touch-hit` instead.
|
||||
- **Don't** tint backgrounds for hierarchy; use surface steps and borders.
|
||||
- **Don't** introduce a new hue or reuse a status colour for decoration.
|
||||
- **Don't** put white text on a status fill; use the soft background and the
|
||||
solid tone.
|
||||
- **Don't** add a shadow to a resting card.
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
# Product
|
||||
|
||||
<!-- impeccable:product-schema 1 -->
|
||||
|
||||
## Platform
|
||||
|
||||
web
|
||||
|
||||
## Users
|
||||
|
||||
Archie's audience comes in two stages.
|
||||
|
||||
1. **Now: the solo operator.** An infrastructure or IT operations engineer who
|
||||
runs their own estate of VMs, containers and on-prem hosts, self-hosts
|
||||
Archie, and wants day-2 operations handled without babysitting: disks filling
|
||||
up, alerts firing, routine maintenance. They use the dashboard on desktop and
|
||||
phone, and talk to Archie through chat channels.
|
||||
2. **Next: the IT operations team.** A team inside an organisation where an
|
||||
application owner (recorded in the CMDB) approves production changes on the
|
||||
servers that belong to their application. Governance, audit and risk
|
||||
controls decide whether the team adopts it.
|
||||
|
||||
## Product Purpose
|
||||
|
||||
Archie is event-driven agentic automation. It hears an event (an alert, a
|
||||
webhook, a schedule, a chat message, an issue), works out what it means, decides
|
||||
what to do, and does the work through an agent. It judges every action before
|
||||
the action runs, and delivers the result wherever it needs review or action.
|
||||
|
||||
Success: an operator connects a source and Archie notices events, acts without
|
||||
being asked when it is allowed to, and calls the operator in only when policy or
|
||||
risk requires it, with an explanation of what it found and did.
|
||||
|
||||
The loop is Hears, Understands, Decides, Defines, Does, Delivers. The platform
|
||||
around it Governs, Reports, Assesses, Manages Risk and Invokes Policy.
|
||||
|
||||
## Positioning
|
||||
|
||||
In order of importance:
|
||||
|
||||
1. **Earned, explained autonomy.** Guards (policy, risk and others, each an
|
||||
extension) score every action before it runs, and those scores set how much
|
||||
the agent may do alone. Autonomy is graded per action, earned from approval
|
||||
history, and always explained. Loosening a ceiling always needs approval from
|
||||
someone with authority; it never happens automatically.
|
||||
2. **Proposals from unhandled events.** The operator states intent rather than
|
||||
wiring steps. Events that nothing handles become proposals, and workflows
|
||||
learn from outcomes. Archie writes, runs and changes its own workflows; the
|
||||
operator can view or edit them but should not need to.
|
||||
3. **Self-hosted operations on VM and on-prem estates.** Archie runs in the
|
||||
operator's own environment and acts directly, or through the automation a
|
||||
team already has (AAP, Semaphore, ServiceNow).
|
||||
|
||||
Archie executes agentic work itself. It is not only a judgement layer, and not
|
||||
another visual workflow builder in the n8n, Zapier or Make mould.
|
||||
|
||||
## Operating Context
|
||||
|
||||
- Events arrive from monitoring (for example Alertmanager on Prometheus),
|
||||
webhooks, schedules, chat channels and forges. A forge is one source among
|
||||
many; a repository is an optional input to a workflow, never the point.
|
||||
- Results and approval requests go out as events to any channel (Telegram,
|
||||
Slack, Discord, email, webhooks, the dashboard chat composer) and come back in.
|
||||
- An approver can be an operator, a rule, a classifier or an automatic decision.
|
||||
Never assume a human approver.
|
||||
- Channels, forges, connectors, secret engines and guards ship as extensions,
|
||||
not in-tree.
|
||||
- The leading demonstration is proactive day-2 operations: a disk-filling alert
|
||||
from Prometheus, investigated and remediated, with the operator told on both a
|
||||
chat channel and the dashboard.
|
||||
|
||||
## Capabilities and Constraints
|
||||
|
||||
- One self-contained binary, `archie`, backed by PostgreSQL. Docker is never
|
||||
the only mechanism for isolation or enforcement.
|
||||
- The dashboard is a Vue single-page app embedded in the binary, used on
|
||||
desktop and phone.
|
||||
- The dashboard is the complete control plane: every configuration and mutable
|
||||
setting is editable there. A setting reachable only through a file, flag or
|
||||
API is a defect. Secrets are write-only.
|
||||
- Every request and response of every judge, guard, action, model call,
|
||||
delivery and evaluation is recorded for audit, never including credentials.
|
||||
- Terminology: source, event, workflow, run, step, guard, approval, proposal,
|
||||
connector, delivery. "Bindings" is a known-obscure name awaiting a
|
||||
replacement.
|
||||
- Undecided: the replacement for bindings and issue routing in the Decide step;
|
||||
how guard scores combine into an autonomy mode; how Deliver works without
|
||||
hard-coded outputs.
|
||||
|
||||
## Brand Commitments
|
||||
|
||||
- Name: Archie. Tagline: "Event-driven Agentic Automation".
|
||||
- Assets in `assets/brand/`: wordmark (light, dark, mono), mark, app icon,
|
||||
social card.
|
||||
- Interface copy states the problem and the action only. It never explains the
|
||||
interface, restates a title, or describes the mechanism behind it.
|
||||
- Never frame the product around coding or a repository.
|
||||
|
||||
## Evidence on Hand
|
||||
|
||||
- Live staging deployment of the single binary, with real Prometheus alerts,
|
||||
Telegram, Semaphore and host connectors.
|
||||
- No customers, testimonials, benchmarks, pricing or press exist. Do not
|
||||
fabricate any.
|
||||
|
||||
## Product Principles
|
||||
|
||||
1. **Governance is the product.** Judgement before every action, a full audit
|
||||
record, and autonomy that is earned and explained are what make Archie worth
|
||||
adopting. Keep them visible, not buried.
|
||||
2. **Intent, not wiring.** The operator says what they want; Archie defines the
|
||||
workflow. Editing is available, never required.
|
||||
3. **Editor and observer are one live surface.** Workflows are defined,
|
||||
connected and watched on the same interactive canvas, updating live as
|
||||
events and runs flow through it. Nodes show what they do.
|
||||
4. **Interrupt only when it matters.** Archie calls the operator in when policy
|
||||
or risk requires it, with what it found and what it did, not to report
|
||||
routine success.
|
||||
5. **Everything operable from the dashboard.** No setting needs a server login.
|
||||
@@ -17,8 +17,8 @@ network operations, service management, and software delivery. You define the
|
||||
process and the access it requires; agents work through its stages, using the
|
||||
context of each event to decide how to accomplish the task.
|
||||
|
||||
Archie is under active development and not every capability below is
|
||||
finished.
|
||||
Archie is under active development and some capabilities below remain
|
||||
unfinished.
|
||||
|
||||
## From an event to an outcome
|
||||
|
||||
|
||||
+4
-4
@@ -2,7 +2,7 @@
|
||||
|
||||
One `v*` tag names a release. One version covers every process in the host
|
||||
bundle (`archied`, `archie-gateway`, `archie-state-store`, `archie-ui`,
|
||||
`archie-messaging`) and the `archie-agent` image. Nothing is released from a
|
||||
`archie-messaging`) and the `archie-agent` image. No release comes from a
|
||||
laptop.
|
||||
|
||||
## Cutting a release
|
||||
@@ -19,12 +19,12 @@ the deploy.
|
||||
The tag push runs `deploy.yml`:
|
||||
|
||||
- **Gate.** `task check dist TEST_FLAGS=-count=1` and `govulncheck`. The
|
||||
binaries the zip ships are built in the same run, so nothing is compiled
|
||||
again after the gate.
|
||||
same run builds the binaries the zip ships, so it compiles nothing again
|
||||
after the gate.
|
||||
- **Images.** `archied:v<version>` and `archie-agent:v<version>`, plus
|
||||
`sha-<commit>` tags. `:latest` moves only on promotion.
|
||||
- **The signed release.** `archied release publish` signs a statement
|
||||
(version, issued_at, zip digest, agent image by digest) with
|
||||
(version, `issued_at`, zip digest, agent image by digest) with
|
||||
`RELEASE_SIGNING_KEY` and pushes it with the distribution zip to
|
||||
`git.catlow.cloud/sam/archie` as `v<version>` and `next`. It never moves
|
||||
`stable`.
|
||||
|
||||
+74
-27
@@ -136,7 +136,11 @@ tasks:
|
||||
- go run ./cmd/archied prbench {{.CLI_ARGS}}
|
||||
|
||||
dev:
|
||||
desc: Run development services and Vite at http://localhost:5173
|
||||
desc: Run archie (with live reload) and Vite at http://localhost:5173
|
||||
deps: [dev:archie, dev:ui]
|
||||
|
||||
dev:legacy:
|
||||
desc: Run the legacy multi-service stack and Vite at http://localhost:5173
|
||||
deps: [dev:daemon, dev:gateway, dev:messaging, dev:state-store, dev:dashboard, dev:ui]
|
||||
|
||||
dev:tls:
|
||||
@@ -175,13 +179,36 @@ tasks:
|
||||
exit 1
|
||||
- |
|
||||
# docker-compose.yml creates the dev database with a superuser named
|
||||
# archie; provision the least-privilege roles deployments/dev.toml
|
||||
# points at. Idempotent, so this also upgrades a volume created before
|
||||
# the role split.
|
||||
go run ./cmd/archie-state-store provision \
|
||||
-admin-url "postgres://archie:archie@127.0.0.1:5432/archie?sslmode=disable" \
|
||||
-runtime-url "postgres://archie_runtime:archie@127.0.0.1:5432/archie?sslmode=disable" \
|
||||
-migration-url "postgres://archie_migrator:archie@127.0.0.1:5432/archie?sslmode=disable"
|
||||
# archie; provision the least-privilege runtime and migrator roles
|
||||
# idempotently without depending on the legacy state-store binary.
|
||||
# Single-binary archie uses its own database (archie_dev) so its goose
|
||||
# migration history does not collide with the legacy archie database.
|
||||
docker compose exec -T postgres psql -v ON_ERROR_STOP=1 -U archie -d postgres <<'SQL'
|
||||
DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (SELECT FROM pg_roles WHERE rolname = 'archie_migrator') THEN
|
||||
CREATE ROLE archie_migrator LOGIN PASSWORD 'archie';
|
||||
ELSE
|
||||
ALTER ROLE archie_migrator WITH LOGIN PASSWORD 'archie';
|
||||
END IF;
|
||||
IF NOT EXISTS (SELECT FROM pg_roles WHERE rolname = 'archie_runtime') THEN
|
||||
CREATE ROLE archie_runtime LOGIN PASSWORD 'archie';
|
||||
ELSE
|
||||
ALTER ROLE archie_runtime WITH LOGIN PASSWORD 'archie';
|
||||
END IF;
|
||||
END
|
||||
$$;
|
||||
SELECT 'CREATE DATABASE archie_dev OWNER archie_migrator'
|
||||
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'archie_dev')\gexec
|
||||
GRANT CREATE, CONNECT ON DATABASE archie TO archie_migrator;
|
||||
GRANT CONNECT ON DATABASE archie TO archie_runtime;
|
||||
GRANT CREATE, CONNECT ON DATABASE archie_dev TO archie_migrator;
|
||||
GRANT CONNECT ON DATABASE archie_dev TO archie_runtime;
|
||||
SQL
|
||||
docker compose exec -T postgres psql -v ON_ERROR_STOP=1 -U archie -d archie \
|
||||
-c "GRANT CREATE, USAGE ON SCHEMA public TO archie_migrator; GRANT USAGE ON SCHEMA public TO archie_runtime;"
|
||||
docker compose exec -T postgres psql -v ON_ERROR_STOP=1 -U archie -d archie_dev \
|
||||
-c "GRANT CREATE, USAGE ON SCHEMA public TO archie_migrator; GRANT USAGE ON SCHEMA public TO archie_runtime;"
|
||||
|
||||
dev:wait-state:
|
||||
internal: true
|
||||
@@ -195,78 +222,93 @@ tasks:
|
||||
exit 1
|
||||
|
||||
dev:daemon:
|
||||
desc: Run archied with live reload
|
||||
desc: Run legacy archied
|
||||
cmds:
|
||||
- task: dev:wait-state
|
||||
- air -build.args_bin="-config-overlay,deployments/dev.toml"
|
||||
- go run ./cmd/archied -config-overlay deployments/dev.toml
|
||||
|
||||
dev:dashboard:
|
||||
desc: Run the dashboard backend
|
||||
desc: Run the legacy dashboard backend
|
||||
cmds:
|
||||
- go run ./cmd/archie-ui -config-overlay deployments/dev.toml
|
||||
|
||||
dev:state-store:
|
||||
desc: Run the State Store with development PostgreSQL
|
||||
desc: Run the legacy State Store with development PostgreSQL
|
||||
deps: [dev:postgres, dev:tls]
|
||||
cmds:
|
||||
- go run ./cmd/archie-state-store -config-overlay deployments/dev.toml
|
||||
|
||||
dev:gateway:
|
||||
desc: Run the development Gateway
|
||||
desc: Run the legacy development Gateway
|
||||
cmds:
|
||||
- task: dev:wait-state
|
||||
- go run ./cmd/archie-gateway -config-overlay deployments/dev.toml
|
||||
|
||||
dev:messaging:
|
||||
desc: Run the development Messaging Service
|
||||
desc: Run the legacy development Messaging Service
|
||||
cmds:
|
||||
- task: dev:wait-state
|
||||
- go run ./cmd/archie-messaging -config-overlay deployments/dev.toml
|
||||
|
||||
dev:archie:
|
||||
desc: Run the single archie binary against the development PostgreSQL (admin token "dev")
|
||||
desc: Run the single archie binary against the development PostgreSQL (admin token "dev", live reload via air if installed)
|
||||
deps: [dev:postgres]
|
||||
vars:
|
||||
DIR: tmp/dev-archie
|
||||
cmds:
|
||||
- |
|
||||
set -eu
|
||||
mkdir -p {{.DIR}}
|
||||
mkdir -p {{.DIR}}/state
|
||||
# Generated once: the age identity seals the dev credentials, so keep
|
||||
# it across runs. Roles come from dev:postgres.
|
||||
if [ ! -f {{.DIR}}/config.toml ]; then
|
||||
umask 077
|
||||
install -m 0600 /dev/null {{.DIR}}/config.toml
|
||||
{
|
||||
echo 'listen = "127.0.0.1:8080"'
|
||||
echo 'listen = "127.0.0.1:8484"'
|
||||
echo 'state_dir = "{{.ROOT_DIR}}/{{.DIR}}/state"'
|
||||
echo "admin_token_sha256 = \"$(printf dev | sha256sum | cut -d' ' -f1)\""
|
||||
echo "age_identity = \"$(go run ./cmd/archie -new-age-identity)\""
|
||||
echo "age_identity = \"$(go run -tags no_ui ./cmd/archie -new-age-identity)\""
|
||||
echo '[database]'
|
||||
echo 'url = "postgres://archie_runtime:archie@127.0.0.1:5432/archie?sslmode=disable"'
|
||||
echo 'owner_url = "postgres://archie_migrator:archie@127.0.0.1:5432/archie?sslmode=disable"'
|
||||
echo 'url = "postgres://archie_runtime:archie@127.0.0.1:5432/archie_dev?sslmode=disable"'
|
||||
echo 'owner_url = "postgres://archie_migrator:archie@127.0.0.1:5432/archie_dev?sslmode=disable"'
|
||||
} > {{.DIR}}/config.toml
|
||||
elif ! grep -q '^state_dir' {{.DIR}}/config.toml; then
|
||||
sed -i '1i state_dir = "{{.ROOT_DIR}}/{{.DIR}}/state"' {{.DIR}}/config.toml
|
||||
fi
|
||||
- go run ./cmd/archie -config {{.DIR}}/config.toml
|
||||
- |
|
||||
if command -v air >/dev/null 2>&1; then
|
||||
exec air -build.args_bin="-config,{{.DIR}}/config.toml"
|
||||
fi
|
||||
exec go run -tags no_ui ./cmd/archie -config {{.DIR}}/config.toml
|
||||
|
||||
dev:ui:
|
||||
desc: Run Vite (requires the dashboard backend)
|
||||
desc: Run Vite (proxies API requests to 127.0.0.1:8484 by default; override with ARCHIE_DEV_API)
|
||||
dir: ui
|
||||
deps: [ui:deps]
|
||||
cmds:
|
||||
- pnpm install
|
||||
- pnpm run dev
|
||||
|
||||
e2e:smoke:
|
||||
desc: Run the single-binary smoke check against a disposable archie instance (defaults to dev:archie on 127.0.0.1:8484)
|
||||
cmds:
|
||||
- |
|
||||
ARCHIE_SMOKE_URL="${ARCHIE_SMOKE_URL:-http://127.0.0.1:8484}" \
|
||||
ARCHIE_SMOKE_TOKEN="${ARCHIE_SMOKE_TOKEN:-dev}" \
|
||||
node e2e/archie-smoke.cjs
|
||||
|
||||
e2e:up:
|
||||
desc: Start the local stack without Docker (PostgreSQL 18, services, Vite) and seed it
|
||||
desc: Start the legacy local multi-service stack without Docker (PostgreSQL 18, services, Vite) and seed it
|
||||
cmds:
|
||||
- bash e2e/stack.sh start
|
||||
- bash e2e/seed.sh
|
||||
|
||||
e2e:down:
|
||||
desc: Stop the local e2e stack
|
||||
desc: Stop the legacy local e2e stack
|
||||
cmds:
|
||||
- bash e2e/stack.sh stop
|
||||
|
||||
e2e:check:
|
||||
desc: List browser checks; use -- all or -- CHECK to run, add --headed to watch
|
||||
desc: List legacy browser checks; use -- all or -- CHECK to run, add --headed to watch
|
||||
cmds:
|
||||
- node e2e/run.cjs {{.CLI_ARGS}}
|
||||
|
||||
@@ -288,14 +330,19 @@ tasks:
|
||||
- Taskfile.yml
|
||||
- "**/*.go"
|
||||
# Files the binaries embed.
|
||||
- config.example.toml
|
||||
- "internal/**/*.sql"
|
||||
- "internal/**/*.yaml"
|
||||
- "internal/**/*.json"
|
||||
- "internal/**/*.tpl"
|
||||
- "internal/**/*.tmpl"
|
||||
- "internal/**/*.md"
|
||||
- "modules/**/*.cedar"
|
||||
- "modules/**/*.yaml"
|
||||
- go.mod
|
||||
- go.sum
|
||||
- "ui/dist/**"
|
||||
- ui/pages/pages.json
|
||||
generates:
|
||||
- "{{.BIN_DIR}}/archied"
|
||||
- "{{.BIN_DIR}}/archie-gateway"
|
||||
|
||||
+35
-36
@@ -1,15 +1,15 @@
|
||||
# Workflow definitions
|
||||
|
||||
A workflow is a YAML document: an id, what it declares to whatever starts it,
|
||||
and an ordered list of steps. Definitions are stored in the control plane's
|
||||
`workflow-definitions` resource and edited on the dashboard's Workflows page
|
||||
(the Canvas and YAML tabs edit the same document). The shipped workflows are in
|
||||
`internal/domain/workflow/shipped/`.
|
||||
and an ordered list of steps. Definitions live in the control plane's
|
||||
`workflow-definitions` resource, and operators edit them on the dashboard's
|
||||
Workflows page (the Canvas and YAML tabs edit the same document). The shipped
|
||||
workflows are in `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
|
||||
(`x-step-types`), and validates every definition when it is saved. This file
|
||||
describes that vocabulary; when they disagree, the catalog wins.
|
||||
type's settings schema, in the `workflow-definitions` catalogue entry
|
||||
(`x-step-types`), and validates every definition on save. This file
|
||||
describes that vocabulary; when they disagree, the catalogue wins.
|
||||
|
||||
```yaml
|
||||
id: implement
|
||||
@@ -41,10 +41,10 @@ steps:
|
||||
|---|---|---|
|
||||
| `id` | text | The workflow's name. Required, unique. |
|
||||
| `steps` | list | The steps, run in order. At least one. |
|
||||
| `repository` | `required` \| `optional` \| `none` | `required` (the default) clones the task's repository into a worktree. `optional` clones one when the run names a repository and uses a scratch workspace otherwise. `none` never clones; only steps that run without a repository may be used. |
|
||||
| `repository` | `required` \| `optional` \| `none` | `required` (the default) clones the task's repository into a worktree. `optional` clones one when the run names a repository and uses a scratch workspace otherwise. `none` never clones; the workflow may use only steps that run without a repository. |
|
||||
| `inputs` | mapping | Named, typed values whatever starts the run must supply: `{type, required}`, where type is `string`, `number`, `bool`, `object`, `array` or `any`. Steps read them as `{{ inputs.<name> }}`. |
|
||||
| `outputs` | mapping | Named, typed results the run writes once each (same shape as inputs). A required output the run never writes parks it. A calling workflow reads them. |
|
||||
| `profile` | text | The container profile (`[containers.profiles]`) the run's agents use. Resolved when the task is dispatched. |
|
||||
| `profile` | text | The container profile (`[containers.profiles]`) the run's agents use. Resolution happens at dispatch. |
|
||||
| `identity` | text | The identity every run acts as, whatever started it. Empty runs as the starter. |
|
||||
|
||||
## A step
|
||||
@@ -72,13 +72,13 @@ Any string setting may contain `{{ path }}`, replaced when the step runs:
|
||||
| `task.issue`, `task.pr` | Issue and pull request numbers. |
|
||||
| `task.plan` | The plan a `workflow.approve` step handed over (an approved PRD). |
|
||||
| `task.review` | The review comments a remediation round addresses. |
|
||||
| `inputs.<name>` | A declared input; an undeclared one is refused at save. |
|
||||
| `inputs.<name>` | A declared input; the server refuses an undeclared one at save. |
|
||||
| `steps.<id>.summary` | What an earlier step reported, e.g. an agent's finish summary or a gate's output. |
|
||||
| `steps.<id>.result.<field>` | A field of an earlier agent's structured result, or an output of an earlier `workflow.call` that waits. A field the agent's `result` schema or the callee's `outputs` does not declare is refused at save. |
|
||||
| `steps.<id>.result.<field>` | A field of an earlier agent's structured result, or an output of an earlier `workflow.call` that waits. At save, the server refuses a field that the agent's `result` schema or the callee's `outputs` does not declare. |
|
||||
|
||||
Only earlier steps may be referenced; a reference to a later or unknown step is
|
||||
refused when the definition is saved. A value that does not exist at run time
|
||||
(for instance, a step that was skipped) renders empty.
|
||||
Reference only earlier steps; the server refuses a reference to a later or
|
||||
unknown step on save. A value that does not exist at run time (for instance, a
|
||||
step the run skipped) renders empty.
|
||||
|
||||
### Conditions
|
||||
|
||||
@@ -112,12 +112,11 @@ A run ends at the first step that sets an outcome: `workflow.finish`,
|
||||
completes, with the last step's summary as its detail. A step that fails parks
|
||||
the run unless it continues on failure.
|
||||
|
||||
A parked run can be retried from a top-level step instead of from the start.
|
||||
The steps before it are skipped and their results stay available to
|
||||
references. The resume point is named by the step's id (else its type), so
|
||||
give an id to any step whose type appears twice. A run with a repository
|
||||
resumes only on its pushed branch: work an earlier step did not push is not
|
||||
there.
|
||||
An operator can retry a parked run from a top-level step instead of from the
|
||||
start. The run skips the steps before it and keeps their results available to
|
||||
references. The step's id (else its type) names the resume point, so give an id
|
||||
to any step whose type appears twice. A run with a repository resumes only on
|
||||
its pushed branch: work an earlier step did not push is not there.
|
||||
|
||||
## Step types
|
||||
|
||||
@@ -129,7 +128,7 @@ _runs without a repository._
|
||||
|---|---|---|
|
||||
| `extra_rules` | text | Appended to the agent system prompt. |
|
||||
| `gate` | `repository` \| `test-failure` | Hold the agent to the repository gate before it may finish; test-failure requires the tests to fail. |
|
||||
| `mission` | text | What the agent is asked to do. May reference {{ task.* }}, {{ inputs.* }} and {{ steps.<id>.* }}. |
|
||||
| `mission` | text | What the step asks the agent to do. May reference {{ task.* }}, {{ inputs.* }} and {{ steps.<id>.* }}. |
|
||||
| `protect_tests` | bool | Write-block the repository test files. |
|
||||
| `read_only` | bool | Restrict the agent to read-only tools. |
|
||||
| `result` | mapping | A JSON Schema object the agent must return; later steps read it as steps.<id>.result. |
|
||||
@@ -155,12 +154,12 @@ _needs a repository._
|
||||
| `push` | bool | Push the branch after committing. |
|
||||
| `reference` | `Fixes` \| `Implements` \| `Refs` | How the commit links to the task issue. |
|
||||
|
||||
Hooks never run. The commit is created by go-git, which ignores `.git/hooks`
|
||||
and `core.hooksPath`, and the agent never runs git, so `pre-commit`,
|
||||
`commit-msg` and `prepare-commit-msg` in the checkout are inert files. A
|
||||
repository whose rules live only in a hook — a formatter, a secret scanner,
|
||||
commitlint, a DCO trailer — gets a commit that does not satisfy them: the run
|
||||
reports success and the pull request fails the check afterwards. Put the same
|
||||
Hooks never run. go-git creates the commit, and it ignores `.git/hooks` and
|
||||
`core.hooksPath`; the agent never runs git, so `pre-commit`, `commit-msg` and
|
||||
`prepare-commit-msg` in the checkout are inert files. A
|
||||
repository whose rules live only in a hook (a formatter, a secret scanner,
|
||||
commitlint, a DCO trailer) gets a commit that does not satisfy them. The run
|
||||
reports success, but the pull request fails the check afterwards. Put the same
|
||||
commands in `command.run` or the repository gate, which both run in the task
|
||||
container before this step.
|
||||
|
||||
@@ -189,7 +188,7 @@ No settings. It runs the repository policy's `tooling` commands, in order, in
|
||||
the task worktree — the installs a gate needs and the container does not ship
|
||||
(protoc plugins, linters, generators). A repository that declares none installs
|
||||
nothing and the step succeeds. Place it after `repo.prepare` and before any
|
||||
`gate.*` step: a failing install fails the step with the command and its output
|
||||
`gate.*` step. A failing install fails the step with the command and its output,
|
||||
and says the gate did not run, so a missing toolchain is not read as a red
|
||||
repository.
|
||||
|
||||
@@ -237,7 +236,7 @@ of sending it.
|
||||
|---|---|---|
|
||||
| `channel` | text | The messaging channel to send through. |
|
||||
| `chat_id` | text | The channel's identifier for the chat. |
|
||||
| `text` | text | The message. References are filled in. |
|
||||
| `text` | text | The message. The run fills in references. |
|
||||
|
||||
A scheduled message is a schedule bound to a workflow whose only step is
|
||||
`message.send`.
|
||||
@@ -301,16 +300,16 @@ _runs without a repository._
|
||||
|
||||
| Setting | Type | Meaning |
|
||||
|---|---|---|
|
||||
| `detail` | text | Why the task was handed off. |
|
||||
| `workflow` | text | The workflow the task is requeued under. |
|
||||
| `detail` | text | Why the workflow handed off the task. |
|
||||
| `workflow` | text | The workflow the handoff requeues the task under. |
|
||||
|
||||
`command.run` commands are `{name, argv, expect_failure}`: `argv` is the
|
||||
program and its arguments, and `expect_failure` requires a non-zero exit.
|
||||
|
||||
`gate.diff-rules` rules are `{id, level, pattern, path, exclude_path, message}`:
|
||||
`level` (`error` blocks, `warn` reports) and `pattern` (an RE2 expression matched
|
||||
against each added line) are required; `path` and `exclude_path` are RE2
|
||||
expressions that limit which files the rule applies to.
|
||||
the step requires `level` (`error` blocks, `warn` reports) and `pattern` (an RE2
|
||||
expression the gate matches against each added line); `path` and `exclude_path`
|
||||
are RE2 expressions that limit which files the rule applies to.
|
||||
|
||||
## What starts a workflow
|
||||
|
||||
@@ -320,8 +319,8 @@ expressions that limit which files the rule applies to.
|
||||
classifies it and hands off.
|
||||
- **Event bindings**: a webhook source mapped onto a workflow and its inputs
|
||||
(Events page).
|
||||
- **Schedules**: each firing is captured on the reserved `schedule` source as
|
||||
a `Schedule fired` event (`schedule_id`, `name`, `scheduled_for`,
|
||||
- **Schedules**: the scheduler captures each firing on the reserved `schedule`
|
||||
source as a `Schedule fired` event (`schedule_id`, `name`, `scheduled_for`,
|
||||
`fired_at`). A schedule trigger is a binding on that source using the
|
||||
`schedule-fired` mapping, filtered to one `schedule_id`. A firing starts at
|
||||
most one task per binding.
|
||||
|
||||
+4868
-439
File diff suppressed because it is too large.
Load diff
+16
-15
@@ -47,8 +47,8 @@ login -- see
|
||||
|
||||
3. Start the five processes. Order does not matter: a service whose peer is
|
||||
not up yet waits for it and reports it as degraded on its health surface
|
||||
meanwhile. The Gateway waits for the daemon's NATS endpoint when the broker
|
||||
is embedded.
|
||||
meanwhile. The Gateway waits for the daemon's NATS endpoint when the daemon
|
||||
runs the embedded broker.
|
||||
|
||||
```bash
|
||||
./archie-state-store -config ~/.config/archie/config.toml -listen 127.0.0.1:9090 &
|
||||
@@ -68,16 +68,16 @@ login -- see
|
||||
|
||||
## Version
|
||||
|
||||
This archive's binaries are built from the `archied` release tag in its
|
||||
filename; `archie-ui`, `archie-gateway`, `archie-state-store` and
|
||||
The release pipeline builds this archive's binaries from the `archied` release
|
||||
tag in its filename. `archie-ui`, `archie-gateway`, `archie-state-store` and
|
||||
`archie-messaging` ship at that same version rather than
|
||||
being independently tagged (see `RELEASING.md` in the source repository for why
|
||||
only `archied` and `archie-agent` are independently versioned).
|
||||
|
||||
`archie-state-store`, `archie-gateway`, `archie-messaging`, `archie-ui` and
|
||||
`archied` are services that must be running and addressable; `archie-messaging`
|
||||
`archied` are services that must be running and addressable. `archie-messaging`
|
||||
carries the Telegram, email and webhook channels since the v1.30.0 extraction, so
|
||||
an install (or an upgrade across v1.30.0) needs its unit as well -- see
|
||||
an install (or an upgrade across v1.30.0) needs its unit as well. See
|
||||
`deployments/systemd-user-service.md`.
|
||||
|
||||
### Native self-update
|
||||
@@ -86,8 +86,8 @@ Install on Settings → Status runs `archied update install -version X` against
|
||||
the release source in the update settings. It fetches release `vX`, refuses it
|
||||
unless the source's key signed its statement, and downloads the Linux/amd64 zip
|
||||
only if it hashes to the digest that statement names. Every host binary in the
|
||||
zip must report `X`. It then pulls the agent image the statement pins by digest, backs up the database to
|
||||
`db.pre-update.dump` in the state directory, stages the new binaries beside the
|
||||
zip must report `X`. It then pulls the agent image the statement pins by digest and backs up the database to
|
||||
`db.pre-update.dump` in the state directory. It stages the new binaries beside the
|
||||
live ones and hands the transaction to `archied update watchdog` in a process of
|
||||
its own (a transient systemd user unit). Nothing that runs changes until the
|
||||
watchdog takes over.
|
||||
@@ -108,9 +108,10 @@ staged executables by rename, switches the control-plane image policy (only the
|
||||
image field, with conflict detection), and restarts the units in order through
|
||||
`systemctl --user`. archied must report the new version and stay healthy for
|
||||
120 seconds. Otherwise the watchdog restores the previous binaries and image
|
||||
policy. Data is not rolled back unless the new release migrated the database:
|
||||
then the previous binaries cannot serve it, so the pre-update backup is restored
|
||||
and the outcome report says that every write since the update began is gone.
|
||||
policy. Data is not rolled back unless the new release migrated the database.
|
||||
Then the previous binaries cannot serve it, so the watchdog restores the
|
||||
pre-update backup, and the outcome report says that the restore discarded every
|
||||
write since the update began.
|
||||
Without a systemd user manager the watchdog switches binaries and image policy
|
||||
but restarts nothing, and the install reports that the services need a manual
|
||||
restart.
|
||||
@@ -118,10 +119,10 @@ restart.
|
||||
Transactions live in `${XDG_STATE_HOME:-~/.local/state}/archie/update`, outside
|
||||
the binary directory: `transaction/journal.json`, `transaction/previous/`, and
|
||||
`transaction/archied`, the frozen copy of the archied that wrote the journal. On
|
||||
daemon boot, an interrupted transaction is
|
||||
handed to that frozen watchdog with `-recover` before normal startup: a
|
||||
transaction that never started is discarded, one that was switching or observing
|
||||
is rolled back, and a decided one is finished. To recover manually, run
|
||||
daemon boot, archied hands an interrupted transaction to that frozen watchdog
|
||||
with `-recover` before normal startup. The watchdog discards a transaction that
|
||||
never started, rolls back one that was switching or observing, and finishes a
|
||||
decided one. To recover manually, run
|
||||
`transaction/archied update watchdog -recover -bin-dir ~/.local/bin` from that
|
||||
state directory. A failed recovery keeps the journal for another attempt.
|
||||
|
||||
|
||||
+13
-14
@@ -42,9 +42,9 @@ systemctl --user start archied
|
||||
|
||||
Start order does not matter: a service waits for its peers and reports them as
|
||||
degraded meanwhile. Every template needs PostgreSQL 18 at `database_url`;
|
||||
`docker compose up -d postgres` provides the default server. Its two login
|
||||
roles are created once per database by `archie-state-store provision` -- see
|
||||
[Database roles](#database-roles).
|
||||
`docker compose up -d postgres` provides the default server.
|
||||
`archie-state-store provision` creates its two login roles once per database --
|
||||
see [Database roles](#database-roles).
|
||||
|
||||
The State Store service (`archie-state-store`) owns the task data in the
|
||||
PostgreSQL database `database_url` names and serves the `StateStore` gRPC
|
||||
@@ -69,7 +69,7 @@ database and hands the schema to one of them:
|
||||
change the schema.
|
||||
|
||||
Run it once per database with a role allowed to create roles and take ownership
|
||||
of the schema (the database owner or a superuser), then point the templates at
|
||||
of the schema (the database owner or a superuser). Then point the templates at
|
||||
the two roles: `database_url` is the runtime URL and `migration_database_url`
|
||||
the migration one. The command is idempotent, so re-running it after an upgrade
|
||||
reconciles objects a migration added.
|
||||
@@ -87,7 +87,7 @@ schema and serves, which is what an install that has not split the roles does.
|
||||
|
||||
## Running the dashboard
|
||||
|
||||
The dashboard is served by the standalone UI Service (`archie-ui`), not by
|
||||
The standalone UI Service (`archie-ui`) serves the dashboard, not
|
||||
`archied`.
|
||||
It reads the same `config.toml`, dials the Gateway and State Store targets
|
||||
already configured there, and binds `[web].listen` (`127.0.0.1:8484` by
|
||||
@@ -99,17 +99,16 @@ archie-ui -config ~/.config/archie/config.toml
|
||||
|
||||
Open the dashboard to configure the organisation, workspace and first administrator account.
|
||||
Use HTTPS through a reverse proxy for remote access, and complete setup before exposing it publicly.
|
||||
`archied` runs no dashboard listener at all, so webhook capture
|
||||
(`POST /webhooks/capture/{source}`) is received by archie-ui and the
|
||||
binding-dispatch loop in `archied` consumes what arrives from the shared
|
||||
State Store.
|
||||
`archied` runs no dashboard listener at all, so archie-ui receives webhook
|
||||
capture (`POST /webhooks/capture/{source}`) and the binding-dispatch loop in
|
||||
`archied` consumes what arrives from the shared State Store.
|
||||
|
||||
The dashboard speaks plain HTTP. A non-loopback bind therefore carries the
|
||||
session cookie and the provider token in clear over the network, and
|
||||
archie-ui warns about exactly that at startup. Terminate TLS in front of it
|
||||
(a reverse proxy or the tunnel itself) and set
|
||||
`[web].trust_forwarded_headers = true` to declare the proxy and silence the
|
||||
warning; leaving it off while exposing the port directly is the case the
|
||||
warning. Leaving it off while exposing the port directly is the case the
|
||||
warning names.
|
||||
|
||||
Auth note: archie-ui authenticates to its dependencies with its `[tls]`
|
||||
@@ -150,10 +149,10 @@ curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:9091/healthz #
|
||||
curl -s http://127.0.0.1:9091/health/detailed # state_db component -> 200, or 503 when degraded
|
||||
```
|
||||
|
||||
A running State Store holds the `state-store` ownership lock on its database;
|
||||
A running State Store holds the `state-store` ownership lock on its database.
|
||||
`archied` and `archie-gateway` never open the task tables directly, so a second
|
||||
store process on the same `database_url` refuses to start, and a consumer that
|
||||
store process on the same `database_url` refuses to start. A consumer that
|
||||
opens the task tables indicates dual-store ownership.
|
||||
The readiness probe is the single-writer check the runbook has against a
|
||||
degraded store: a `503` from `/health/detailed` means `archied` should be
|
||||
started only after the store is healthy.
|
||||
degraded store: a `503` from `/health/detailed` means the operator should
|
||||
start `archied` only after the store is healthy.
|
||||
@@ -31,6 +31,8 @@ services:
|
||||
- ./bin/archie:/archie/archie:ro
|
||||
- ./config.toml:/archie/config.toml:ro
|
||||
- ./extensions:/archie/extensions:ro
|
||||
- ./state:/archie/state
|
||||
- ./catalogue:/archie/catalogue:ro
|
||||
ports:
|
||||
- "${ARCHIE_BIND:?}:8080"
|
||||
networks: [internal]
|
||||
|
||||
@@ -14,7 +14,7 @@ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -C "$repo" -trimpath \
|
||||
-ldflags "-X github.com/samcharles93/archie-core/internal/buildinfo.Version=$version" \
|
||||
-o "$here/.build/archie" ./cmd/archie
|
||||
|
||||
ssh "$target" "mkdir -p $dir/bin $dir/initdb $dir/extensions"
|
||||
ssh "$target" "mkdir -p $dir/bin $dir/initdb $dir/extensions $dir/catalogue $dir/state && chown 65532:65532 $dir/state"
|
||||
scp -q "$here/compose.yml" "$target:$dir/compose.yml"
|
||||
scp -q "$here/seccomp.json" "$target:$dir/seccomp.json"
|
||||
scp -q "$here/initdb/01-roles.sh" "$target:$dir/initdb/01-roles.sh"
|
||||
@@ -51,6 +51,11 @@ if ! grep -q '^admin_token_sha256' config.toml; then
|
||||
sed -i "1i admin_token_sha256 = \"$hash\"" config.toml
|
||||
chown 65532:65532 config.toml
|
||||
fi
|
||||
# Fetched extension binaries and other state outside the database live in
|
||||
# the mounted state directory, so they survive the container being recreated.
|
||||
if ! grep -q '^state_dir' config.toml; then
|
||||
sed -i '1i state_dir = "/archie/state"' config.toml
|
||||
fi
|
||||
# The age identity seals the credentials Archie keeps. It is made here and
|
||||
# never leaves the host; back it up, or credentials die with it.
|
||||
if ! grep -q '^age_identity' config.toml; then
|
||||
|
||||
@@ -11,7 +11,7 @@ This runbook describes how to manage `archied` as a background user service on L
|
||||
with the contents it
|
||||
ships. This page describes what runs and why; the installer owns the contents,
|
||||
so inspect a unit with `systemctl --user cat <unit>` rather than copying it from
|
||||
here, where it would drift from what is written.
|
||||
here, where it would drift from what `install.sh` writes.
|
||||
|
||||
The Gateway unit is `archie-gateway.service`, written by `install.sh` beside
|
||||
`archied.service`.
|
||||
@@ -30,14 +30,14 @@ Docker bridge gateway address, and a non-loopback bind needs `[tls]` (see
|
||||
|
||||
### Messaging Service Unit (`~/.config/systemd/user/archie-messaging.service`)
|
||||
|
||||
The Telegram, email and webhook channels are served by `archie-messaging`, not
|
||||
by `archied`, since the v1.30.0 extraction. `archied` starts no gateway for them
|
||||
and logs nothing when one is absent, so a host that updates across v1.30.0
|
||||
`archie-messaging` serves the Telegram, email and webhook channels, not
|
||||
`archied`, since the v1.30.0 extraction. `archied` starts no gateway for them
|
||||
and logs nothing when one is absent. A host that updates across v1.30.0
|
||||
without this unit runs on with dead channels and a daemon that looks perfectly
|
||||
healthy. `install.sh` writes this unit on a fresh install;
|
||||
`archied update install` refuses an
|
||||
update when a host is missing a unit and names what is missing, which now fires
|
||||
for a host that drifted or predates this release rather than the normal path.
|
||||
healthy. `install.sh` writes this unit on a fresh install.
|
||||
`archied update install` refuses an update when a host is missing a unit and
|
||||
names what is missing. That now fires for a host that drifted or predates this
|
||||
release rather than the normal path.
|
||||
|
||||
It dials the Gateway for the chat contract and the State Store for the stored
|
||||
channel settings, and reads the same `config.toml`, including `[tls]`.
|
||||
@@ -48,7 +48,7 @@ each service waits for the peers it needs.
|
||||
|
||||
## 2. UI Service Unit (`~/.config/systemd/user/archie-ui.service`)
|
||||
|
||||
The dashboard is served by the standalone UI Service, not by `archied`. It reads the same `config.toml`, dials
|
||||
The standalone UI Service serves the dashboard, not `archied`. It reads the same `config.toml`, dials
|
||||
the Gateway and State Store targets already in it, and binds `[web].listen`.
|
||||
Open the dashboard to configure the organisation, workspace and first administrator account.
|
||||
Complete setup before exposing it publicly; remote access requires an HTTPS reverse proxy.
|
||||
@@ -61,10 +61,10 @@ probe (token-free by design); the authenticated readiness surface lives at
|
||||
the dashboard's health endpoint behind account authentication. A watchdog can curl
|
||||
`/healthz` without credentials.
|
||||
|
||||
`install.sh` writes `archie-ui.service`. Browser accounts are configured through the dashboard.
|
||||
`install.sh` writes `archie-ui.service`. Operators configure browser accounts through the dashboard.
|
||||
|
||||
`After=` orders the start, it does not wait for the store to bind. The UI
|
||||
process closes that gap itself: its event pump retries priming with backoff
|
||||
process closes that gap itself. Its event pump retries priming with backoff
|
||||
until the State Store answers, so the activity feed goes live once the store
|
||||
is up rather than staying history-only until the next restart.
|
||||
|
||||
@@ -129,12 +129,13 @@ systemctl --user stop archied
|
||||
|
||||
Embedded NATS is the default. The systemd service runs `archied` natively, so
|
||||
interactive chat keeps the host access the operator configured, while every
|
||||
autonomous repository workflow runs in a task-scoped Docker container. No
|
||||
Compose service or host `archie-agent` binary is required.
|
||||
autonomous repository workflow runs in a task-scoped Docker container. The
|
||||
deployment needs no Compose service or host `archie-agent` binary.
|
||||
|
||||
Docker must be installed and reachable by the service user. `containers.image`
|
||||
has no default: with it unset the daemon refuses to start and names the key,
|
||||
so a fresh install learns about it at startup, not at the first failed pull.
|
||||
The operator must install Docker and make it reachable to the service user.
|
||||
`containers.image` has no default: with it unset the daemon refuses to start and
|
||||
names the key, so a fresh install learns about it at startup, not at the first
|
||||
failed pull.
|
||||
`single-forge-github.toml` and `docker-nats-stack.toml` set a pinned
|
||||
reference; `standalone.toml` and `dev.toml` leave it for the operator to set
|
||||
-- see
|
||||
@@ -156,9 +157,9 @@ and passes the resulting endpoint to each worker. There is no port to publish
|
||||
and no broker URL to maintain.
|
||||
|
||||
The State Store is a separate process and, with a container-mode agent, must
|
||||
be reachable from the container, so bind it to the same bridge gateway with a
|
||||
be reachable from the container. Bind it to the same bridge gateway with a
|
||||
token and point `[services.state].target` at it (start
|
||||
`archie-state-store` with `-listen <bridge>:9090 -token <token>`); without a
|
||||
`archie-state-store` with `-listen <bridge>:9090 -token <token>`). Without a
|
||||
token a non-loopback bind fails closed. For a host-only agent, `127.0.0.1:9090`
|
||||
with no token is correct.
|
||||
|
||||
@@ -173,8 +174,8 @@ fall back to a host model loop.
|
||||
The release pipeline publishes
|
||||
`git.catlow.cloud/sam/archie-agent` as `:v<version>` and `:sha-<commit>` when
|
||||
the commit carries a release tag; an ordinary push to `main` publishes nothing
|
||||
for the agent image, and `:latest` moves only when a release is promoted. A
|
||||
distribution zip pins the image its own release
|
||||
for the agent image, and `:latest` moves only when the release pipeline promotes
|
||||
a release. A distribution zip pins the image its own release
|
||||
published, by digest, in `release.json`, and `archied update install` pulls
|
||||
exactly that.
|
||||
|
||||
@@ -204,8 +205,9 @@ personal access token that can read the package as the password --
|
||||
`{"username":"<user>","password":"<token>"}`. Put it in
|
||||
`~/.config/archie/env` as `ARCHIE_REGISTRY_AUTH` so it stays out of
|
||||
`config.toml`. The field is file-owned and settled at boot, so a change takes
|
||||
effect on restart; a value that cannot be read logs a warning and pulls
|
||||
anonymously, which is the failure the task reports as a capability error.
|
||||
effect on restart. When the daemon cannot read a value, it logs a warning
|
||||
and pulls anonymously, which is the failure the task reports as a capability
|
||||
error.
|
||||
|
||||
The bundled update adapter snapshots the configured `[containers].image` before
|
||||
rebuilding it and restores that image if the restarted daemon fails its health
|
||||
@@ -235,7 +237,7 @@ network = "archie-core_default"
|
||||
|
||||
The broker defers every login to archied (NATS auth callout), so a worker logs
|
||||
in with its run credential and reaches only its own task's subjects. Generate
|
||||
an account nkey (`nk -gen account -pubout`), export its seed as
|
||||
an account nKey (`nk -gen account -pubout`), export its seed as
|
||||
`NATS_CALLOUT_SEED` for archied and its public key as `NATS_CALLOUT_ISSUER` for
|
||||
Compose, and set `NATS_TOKEN` to the same value in both.
|
||||
|
||||
|
||||
+3
-2
@@ -44,6 +44,7 @@ services:
|
||||
|
||||
# ── NATS JetStream ────────────────────────────────────────────────
|
||||
nats:
|
||||
profiles: ["nats"]
|
||||
image: nats:2.14-alpine3.22
|
||||
# The client port is published on every interface (agent containers reach
|
||||
# it over the bridge), so it defers every login to archied. Set NATS_TOKEN
|
||||
@@ -51,8 +52,8 @@ services:
|
||||
# the account nkey seed named in [nats] callout_issuer_seed_env.
|
||||
command: ["-c", "/etc/nats/nats.conf"]
|
||||
environment:
|
||||
NATS_TOKEN: ${NATS_TOKEN:?NATS_TOKEN is required}
|
||||
NATS_CALLOUT_ISSUER: ${NATS_CALLOUT_ISSUER:?NATS_CALLOUT_ISSUER is required}
|
||||
- NATS_TOKEN
|
||||
- NATS_CALLOUT_ISSUER
|
||||
ports:
|
||||
- "4222:4222" # client
|
||||
- "127.0.0.1:8222:8222" # monitoring (http://localhost:8222)
|
||||
|
||||
@@ -24,9 +24,9 @@ Archie Core uses the GitHub API to:
|
||||
|
||||
## Step-by-Step Instructions: Creating a Classic Token
|
||||
|
||||
1. Navigate to
|
||||
1. Go to
|
||||
[GitHub Settings → Developer Settings → Tokens (classic)](https://github.com/settings/tokens).
|
||||
2. Click **Generate new token** → **Generate new token (classic)**.
|
||||
2. Select **Generate new token** → **Generate new token (classic)**.
|
||||
3. Set the **Note**: `Archie Core` (or your bot's name).
|
||||
4. Choose an **Expiration** (e.g. 90 days, 1 year, or No expiration for
|
||||
dedicated bot accounts).
|
||||
@@ -35,9 +35,9 @@ Archie Core uses the GitHub API to:
|
||||
commenting, pushing branches, and opening PRs).
|
||||
- **`workflow`** (Optional — required if Archie needs to update GitHub
|
||||
Actions workflows).
|
||||
6. Scroll to the bottom and click **Generate token**.
|
||||
6. Scroll to the bottom and select **Generate token**.
|
||||
7. **Copy your token immediately** (starts with `ghp_...`). You won't be able to
|
||||
see it again!
|
||||
see it again.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# Building your first playbook binding
|
||||
|
||||
This walks through the whole no-code path the event-capture epic promises: point
|
||||
an external app's webhook at archie, see the real payload it sends, map the
|
||||
This walks through the whole no-code path the event-capture epic promises. Point
|
||||
an external app's webhook at archie and see the real payload it sends. Map the
|
||||
fields you care about, bind them to a workflow, and watch the next matching
|
||||
event turn into a task -- no code, no redeploy, no restart.
|
||||
event turn into a task. No code, no redeploy, no restart.
|
||||
|
||||
## 1. Create a source and send a test event
|
||||
|
||||
Open **Events → Inspector** and click **New source**. Archie shows the source's
|
||||
Open **Events → Inspector** and select **New source**. Archie shows the source's
|
||||
URL and signing secret once; copy both. Point the external app's webhook at that
|
||||
URL. Send one real event however is easiest for a first test, e.g.:
|
||||
|
||||
@@ -30,8 +30,8 @@ actual payload from the actual sender, not guessing at a schema in advance.
|
||||
## 3. Map the fields you care about
|
||||
|
||||
Open **Field mappings** (`/mappings`) → **New mapping**. Pick your captured
|
||||
event from the dropdown, then click through its payload tree on the right --
|
||||
every key and value is clickable. Clicking a value binds it as a field (name,
|
||||
event from the dropdown, then select items in its payload tree on the right.
|
||||
Every key and value is selectable, and selecting one binds it as a field (name,
|
||||
JSON path, and an inferred type you can change). Add whichever fields your
|
||||
workflow needs (e.g. the issue title), mark the ones that must be present as
|
||||
**Required**, hit **Preview** to confirm they resolve correctly against the real
|
||||
@@ -56,9 +56,9 @@ Save. The binding starts in **draft** -- nothing fires yet.
|
||||
## 5. Approve it
|
||||
|
||||
A **draft** or freshly-**edited** binding needs explicit approval before it can
|
||||
ever match a live event -- this is deliberate, not a missing step: an operator
|
||||
ever match a live event. This is deliberate, not a missing step: an operator
|
||||
authoring a binding is a considered act, an event arriving is not, and nothing
|
||||
should self-arm. Click **Approve**. Status becomes **armed**.
|
||||
should self-arm. Select **Approve**. Status becomes **armed**.
|
||||
|
||||
## 6. Fire it for real
|
||||
|
||||
@@ -76,14 +76,15 @@ curl -X POST http://localhost:8484/webhooks/capture/sentry \
|
||||
-d "$BODY"
|
||||
```
|
||||
|
||||
This event is captured as **authenticated**, matched against your armed binding,
|
||||
and dispatched into a new task through the exact same gate/worktree/sandbox
|
||||
pipeline every other task goes through. Check the **Tasks** page; a new task
|
||||
should appear, its body built from the fields your mapping resolved.
|
||||
Archie captures this event as **authenticated**, matches it against your armed
|
||||
binding, and dispatches it into a new task through the exact same
|
||||
gate/worktree/sandbox pipeline every other task goes through. Check the
|
||||
**Tasks** page; a new task should appear, its body built from the fields your
|
||||
mapping resolved.
|
||||
|
||||
## Editing a live binding
|
||||
|
||||
Any edit to an armed binding -- even a typo fix -- drops it back to
|
||||
**pending_approval** automatically. This can't be bypassed by editing; it has to
|
||||
be re-approved. When editing, leave the **Shared secret** field blank to keep
|
||||
Any edit to an armed binding, even a typo fix, drops it back to
|
||||
**`pending_approval`** automatically. You can't bypass this by editing; you have
|
||||
to re-approve it. When editing, leave **Shared secret** blank to keep
|
||||
the existing secret; only fill it in if you're deliberately rotating it.
|
||||
@@ -1,24 +1,26 @@
|
||||
# Self-development loop: archie develops its own codebase
|
||||
|
||||
**Status:** Decided, not yet built (2026-11-03, sam) **Scope:** how archie
|
||||
persistently takes on development of archie-core itself. This file records a
|
||||
desired state, not an implementation or a product: nothing below exists unless
|
||||
the "Built today" section says so. The plan is tracked as epic #1769 with child
|
||||
keeps developing archie-core itself. This file records a
|
||||
desired state, not an implementation or a product. Nothing below exists unless
|
||||
the "Built today" section says so. Epic #1769 tracks the plan, with child
|
||||
issues #1770–#1775. This file is a record, not a mechanism: agents only see what
|
||||
is in their context, so verify every claim here against the code before acting
|
||||
on it — where they disagree, the code wins. The boundary below is load-bearing
|
||||
only where it is enforced (the gate, access control, the daemon's git monopoly)
|
||||
and stated in `AGENTS.md`; everywhere else this file is a pointer.
|
||||
on it. Where they disagree, the code wins. The boundary below is load-bearing
|
||||
only where the code enforces it (the gate, access control, the daemon's git
|
||||
monopoly) and only where `AGENTS.md` states it. Everywhere else this file is a
|
||||
pointer.
|
||||
|
||||
## Built today
|
||||
|
||||
The machinery the loop will reuse exists: shipped triage/implement/pr-review
|
||||
workflows, the adversarial self-review stage before a PR opens (epic #1348,
|
||||
closed), the prbench judge for review quality with its acceptance bar, canary
|
||||
releases judged on the installed release (releaseupdate), and the curator
|
||||
engine. What does not exist is the loop itself: no self-intake curator, no
|
||||
approved-issue auto-run, no judge for diffs, no outcome distillation, no canary
|
||||
routing specific to self-directed changes.
|
||||
The machinery the loop will reuse exists. It includes the shipped
|
||||
triage/implement/pr-review workflows and the adversarial self-review stage before
|
||||
a PR opens (epic #1348, closed). It also includes the prbench judge for review
|
||||
quality with its acceptance bar, canary releases judged on the installed release
|
||||
(releaseupdate), and the curator engine. What does not exist is the loop itself:
|
||||
no self-intake curator, no automatic run for approved issues, no judge for
|
||||
diffs, no outcome distillation, no canary routing specific to self-directed
|
||||
changes.
|
||||
|
||||
## Decision
|
||||
|
||||
@@ -28,41 +30,42 @@ Archie improves its own codebase through a closed loop, built in stages:
|
||||
gate failures and alerts, dedupes against open issues, and files new issues.
|
||||
Archie files its own work; the maintainer approves priority.
|
||||
2. **Approved-issue loop** (#1771): an approved issue runs the shipped
|
||||
triage/implement workflows end to end — read-only plan, gated build,
|
||||
adversarial self-review, daemon commits and opens a green PR. The maintainer
|
||||
still merges at this stage.
|
||||
triage/implement workflows end to end. The workflow makes a read-only plan
|
||||
and a gated build, then runs the adversarial self-review; the daemon commits
|
||||
and opens a green PR. The maintainer still merges at this stage.
|
||||
3. **Implementation judge** (#1772): the prbench judge pattern scores diffs,
|
||||
calibrated against the maintainer's merge decisions; auto-merge applies only
|
||||
when the gate is green, the review stage is clean, and the judge is above the
|
||||
calibrated bar.
|
||||
calibrated against the maintainer's merge decisions. Automatic merge applies
|
||||
only when the gate is green, the review stage is clean, and the judge is above
|
||||
the calibrated bar.
|
||||
4. **Outcome distillation** (#1773): a curator turns merged-run postmortems into
|
||||
proposals for the repo's agent instructions, each added only because it
|
||||
changes a decision; rules that stop changing decisions are removed.
|
||||
proposals for the repo's agent instructions. The maintainer adds each
|
||||
proposal only because it changes a decision, and removes rules that stop
|
||||
changing decisions.
|
||||
5. **Canary** (#1774): self-directed changes ship through the canary release
|
||||
window and are judged on the installed release before promotion. Rollback is
|
||||
a plain revert, because every self-directed change is one gated commit.
|
||||
window, and the canary verdict on the installed release gates their
|
||||
promotion. Rollback is a plain revert, because every self-directed change is
|
||||
one gated commit.
|
||||
|
||||
## Boundary
|
||||
|
||||
Enforcement lives in the harness, never in the prompt (#1775). Changes to the
|
||||
commit gate, the invariants in `AGENTS.md`, access control and grant scoping,
|
||||
the daemon-only git path, and webhook HMAC verification may be proposed by
|
||||
archie but are never merged by archie — they require a maintainer merge.
|
||||
Everything else (workflows, curators, memory, docs, the dashboard) is fair game
|
||||
for the loop.
|
||||
Enforcement lives in the code, never in the prompt (#1775). Archie may propose
|
||||
changes to the commit gate, the invariants in `AGENTS.md`, access control and
|
||||
grant scoping, the daemon-only git path, and webhook HMAC verification. It never
|
||||
merges them; those changes require a maintainer merge. Everything else
|
||||
(workflows, curators, memory, docs, the dashboard) is fair game for the loop.
|
||||
|
||||
## Why
|
||||
|
||||
Self-improvement degrades when it relies on the model choosing to follow rules.
|
||||
Gates, scoped grants and the daemon's monopoly on git cannot be argued with; a
|
||||
prompt can. Keeping quality measurable — a judge bar and a canary verdict as
|
||||
numbers, tests guarding the protected seams — is what lets the loop widen
|
||||
without turning the codebase to garbage.
|
||||
The model can argue with a prompt, not with gates, scoped grants or the daemon's
|
||||
monopoly on git. Keeping quality measurable is what lets the loop widen without
|
||||
turning the codebase to garbage: a judge bar and a canary verdict as numbers,
|
||||
and tests guarding the protected seams.
|
||||
|
||||
## Consequences
|
||||
|
||||
- One issue → one small PR applies doubly to self-directed work: past about 100
|
||||
- One issue to 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,31 +1,31 @@
|
||||
# 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
|
||||
[OWASP Authentication Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html)
|
||||
and
|
||||
[Authorization Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Authorization_Cheat_Sheet.html),
|
||||
including its guidance on attributes and relationships. It describes concrete
|
||||
enforcement points and their regression tests; it is not a compliance
|
||||
certification.
|
||||
[Authorization Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Authorization_Cheat_Sheet.html).
|
||||
It includes the guidance on attributes and relationships from the Authorization
|
||||
Cheat Sheet. It describes concrete enforcement points and their regression
|
||||
tests. It is not a compliance certification.
|
||||
|
||||
## Transport and authority
|
||||
|
||||
The browser uses HTTP/JSON and SSE to the UI service. The UI service calls State
|
||||
Store, Gateway, Messaging and the daemon through their gRPC contracts. Only the
|
||||
State Store opens the task/control-plane/account database; Gateway owns
|
||||
State Store opens the task/control-plane/account database. Gateway owns
|
||||
conversation storage. Browser HTTP handlers never open either database.
|
||||
|
||||
Instance service credentials are administrative authority. They are not user
|
||||
sessions and must never reach a browser, model, or agent container. A service
|
||||
forwarding a principal preserves attribution and tenant scope; forwarding alone
|
||||
forwarding a principal preserves attribution and tenant scope. Forwarding alone
|
||||
does not mean every internal RPC evaluates Cedar. Most internal RPCs trust the
|
||||
authenticated service and enforce their own resource scope. The public HTTP
|
||||
boundary evaluates Cedar before invoking them. Task credentials have a separate,
|
||||
explicit RPC allowlist and cannot call account or identity administration.
|
||||
|
||||
Local service listeners are trusted process boundaries. Loopback is not a
|
||||
substitute for authentication on a remotely reachable listener. OIDC
|
||||
The services treat local service listeners as trusted process boundaries.
|
||||
Loopback does not replace authentication on a remotely reachable listener. OIDC
|
||||
credentials, local browser sessions, personal API tokens, service credentials,
|
||||
and task grants must remain distinct.
|
||||
|
||||
@@ -33,52 +33,52 @@ 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.
|
||||
|
||||
The default policies grant actions through scoped roles. Policies can also
|
||||
restrict a named identity, workspace environment, owner, state, source address,
|
||||
signature, run or step. HTTP task decisions now include the stored initiating
|
||||
identity and task state; binding decisions include the stored binding state. The
|
||||
identity and task state. Binding decisions include the stored binding state. The
|
||||
HTTP source address is the actual connection peer, not an unverified forwarded
|
||||
header. Membership and resource attributes must come from stored records or
|
||||
authenticated context, never a request's assertion about itself.
|
||||
authenticated context. They never come from 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.
|
||||
Account creation uses `manage_members` policy rather than a hard-coded admin
|
||||
role. Authenticating through OIDC does not automatically grant membership, link
|
||||
Cedar permission is not ownership of another person's private data. The services
|
||||
bind conversation history, passkeys, recovery codes and personal tokens to the
|
||||
person. An organisation or instance admin role does not override those
|
||||
relationships. Account creation uses `manage_members` policy rather than a fixed
|
||||
admin role. An OIDC login does not automatically grant membership, link
|
||||
accounts by unverified email, or create an administrator.
|
||||
|
||||
## Enforcement inventory
|
||||
|
||||
| Location | Enforcement | Regression evidence |
|
||||
| ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| 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 credential gate: `webui/auth.go`, `accounts.go` | Account session or verified provider identity; shared dashboard token is not a person once setup creates an account. 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 |
|
||||
| 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` |
|
||||
| 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; derive the target org from the 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 |
|
||||
| Personal account routes: `webui/accounts.go` | Active signed-in person; principal supplied by server. Password change verifies current password. Sensitive authenticator changes require recent sign-in. No caller-supplied target identity. | `TestAccountBoundary` |
|
||||
| Recovery: `postgres/account_security.go`, `webui/accounts.go` | Fresh authenticated owner generates a hashed, one-use recovery secret. Redemption replaces password and revokes all sessions atomically. No email-existence disclosure. | Disposable PostgreSQL recovery verification |
|
||||
| Passkeys: `postgres/passkeys.go`, `webui/passkeys.go` | Configured RP origin, browser-bound one-use expiring challenge, verified credential signature and user verification. Enrollment/management belong to caller. Credential counters persist under a row lock. | Disposable browser virtual-authenticator verification; task-grant denial tests |
|
||||
| OIDC: `infrastructure/oidc`, `archieui/account_oidc.go`, `webui/auth.go` | Discovery and signed ID token with issuer/client audience/expiry, PKCE, state and nonce. Verified subject resolves to active identity. Browser-local session cannot outlive provider token, and provider credential remains checked. | `TestBrowserFlowVerifiesIDToken`, `TestProviderOutageIsUnavailableThenRecovers`, subject-claim tests; no external provider acceptance implied |
|
||||
| OIDC settings: `webui/accounts.go`, `postgres/authentication.go` | Instance ownership plus policy; recent sign-in for changes. Public URL cannot change while enrolled passkeys would be orphaned. | `TestAccountBoundary`, `TestAuthenticationSettingsRejectUntrustedOrigins` |
|
||||
| OIDC settings: `webui/accounts.go`, `postgres/authentication.go` | Instance ownership plus policy; recent sign-in for changes. The instance refuses a public URL change that would orphan enrolled passkeys. | `TestAccountBoundary`, `TestAuthenticationSettingsRejectUntrustedOrigins` |
|
||||
| Org membership/workspaces/agent assignment: `webui/api_orgs.go`, `staterpc/orgs.go`, `postgres/orgs.go` | Own org or instance-owner relationship, allowed role vocabulary, membership escalation/last-owner guards, tenant-scoped SQL. | `TestOrgRPCsActInTheCallersOrg`, `TestSetMembershipRefusesUnknownRole`, org HTTP tests |
|
||||
| Personal API tokens: `webui/api_personal_tokens.go`, `staterpc/personal_tokens.go`, `postgres/personal_tokens.go` | Token owner comes from principal; store only token hash; revoke only caller's binding. | `TestPersonalTokensWithoutPerson`, `TestPersonalTokenOwner` |
|
||||
| gRPC caller attribution: `rpcidentity/identity.go` | Authenticated service may forward a principal; State Store resolves memberships/org itself. Task grant metadata is stripped. | `TestCallerAttribution` |
|
||||
| gRPC caller attribution: `rpcidentity/identity.go` | Authenticated service may forward a principal; State Store resolves memberships/org itself. State Store strips task grant metadata. | `TestCallerAttribution` |
|
||||
| Agent/task gRPC: `staterpc/task_grants.go` | Durable task-scoped grant, explicit allowed RPC and target task, no definition-pin replacement, no account RPCs. | `TestTaskCredentialsCannotManageAccounts`, `TestTaskCredentialCannotReplaceItsPin`, `TestRecordUsageAuthority`, `TestWorkerPresenceAuthority` |
|
||||
| Chat HTTP: `webui/api_chat.go` | Server stamps sender and person thread; lists/read/turns/cancel/persona verify session ownership. Browser cannot submit another sender identity. | `TestWebChatOwnership`, `TestWebChatSenderCannotBeSuppliedByBrowser`; HTTP deny matrix |
|
||||
| Chat history, slash commands and model session tools: `gateway/session_store_postgres.go` | Store filters `Get`, `List`, `GetByChannel`; shared read/write guards check person ownership as well as org. A saved session cannot change its conversation source to claim another person's history. Service curation runs without a person principal. | `TestSessionVisibility`; PostgreSQL smoke for history isolation |
|
||||
| Chat questions/approvals: `webui/api_chat_ask.go` | Waiting question is bound to the initiating person, in addition to its unguessable ID. | `TestChatQuestionBelongsToInitiatingPerson` |
|
||||
| Chat downloads: `webui/api_chat_files.go` | Offered file token expires and is bound to the initiating person; requests cannot supply a filesystem path. | `TestChatFileDownload` |
|
||||
| Chat questions/approvals: `webui/api_chat_ask.go` | The UI service binds the waiting question to the initiating person, in addition to its unguessable ID. | `TestChatQuestionBelongsToInitiatingPerson` |
|
||||
| Chat downloads: `webui/api_chat_files.go` | The UI service binds the offered file token to the initiating person, and the token expires; requests cannot supply a filesystem path. | `TestChatFileDownload` |
|
||||
| Per-person memory: `archiegateway/chat_identity.go`, gateway memory tools, `sessioncurator` | Verified web sender identity scopes reads/writes. Curator refuses unidentified or mixed participants instead of guessing a person. | Gateway memory and session-curator tests |
|
||||
| Workflow/task actions: `webui/api_tasks.go`, `domain/taskactions`, `staterpc` | Policy and stored workspace before action; domain transition, authority and durable dispatch guards remain in force. | HTTP deny matrix, task action/domain tests, task grant tests |
|
||||
| Incoming webhooks: `captureintake`, access delivery engine | Verify HMAC before parsing; derive source/org from stored source; evaluate source delivery policies and egress rules. No browser-user credential is inferred. | Capture tests, `TestAuthorizeDelivery` |
|
||||
| Incoming webhooks: `captureintake`, access delivery engine | Verify HMAC before parsing; derive source/org from stored source; evaluate source delivery policies and egress rules. The capture intake never infers a browser-user credential. | Capture tests, `TestAuthorizeDelivery` |
|
||||
| Control-plane configuration, secrets and extensions | Browser policy and instance-only restrictions where registered; service contracts carry principal/org; task grants cannot invoke administrative RPCs. | HTTP deny matrix, `TestAdministrationRoutes`, `TestChannelReloadRoute` |
|
||||
| Audit feed: `webui/api_audit.go`, `domain/audit` | `read_audit` on the `audit` resource; org scope and the instance-wide exception come from the authenticated principal, never the query string. Export carries the same grant, needs an explicit range of at most a year, and is rate-limited per identity, one at a time. Redaction runs in the State Store adapter before an entry crosses gRPC. | `TestReadAuditRoleBoundary`, `TestAuditRoutesFollowTheReadAuditRole`, `TestHTTPPolicyCannotBeBypassed`, `TestAuditErrorMapping`, `TestAuditCSVCellNeutralisesFormulas` |
|
||||
| Live HTTP/SSE and diagnostics | Authenticated policy gate applies before stream creation; org-scoped event reads; instance logs require administrative visibility. | HTTP deny matrix, instance-only tests, `TestServiceLogsRequireInstanceCredential` |
|
||||
@@ -86,29 +86,31 @@ accounts by unverified email, or create an administrator.
|
||||
|
||||
The policy HTTP matrix enumerates each registered protected route. It checks
|
||||
both anonymous refusal and refusal by an explicit Cedar forbid, using the real
|
||||
handler stack. Separate tests exercise allowed requests and personal ownership;
|
||||
a denied-request matrix alone is not proof that a workflow works end to end.
|
||||
handler stack. Separate tests exercise allowed requests and personal ownership.
|
||||
A denied-request matrix alone is not proof that a workflow works end to end.
|
||||
|
||||
## Public and personal routes
|
||||
|
||||
Public protocol entry points are `GET /api/auth/status`, `POST /api/auth/setup`,
|
||||
`POST /api/auth/login`, `POST /api/auth/logout`, `POST /api/auth/recover`,
|
||||
`POST /api/auth/passkey/begin`, `POST /api/auth/passkey/finish`,
|
||||
`GET /oauth2/login`, `GET /oauth2/callback`, health probes and signed webhook
|
||||
intake. Each has its own protocol checks. Static embedded app assets are public;
|
||||
they do not contain user data. `/health/detailed` remains protected.
|
||||
`POST /api/auth/passkey/begin` and `POST /api/auth/passkey/finish`. The
|
||||
remaining entry points are `GET /oauth2/login`, `GET /oauth2/callback`, health
|
||||
probes and signed webhook intake. Each has its own protocol checks. Static
|
||||
embedded app assets are public. 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
|
||||
role. `POST /api/accounts` and `/api/authentication` are administrative policy
|
||||
routes.
|
||||
server-derived ownership. They cover password change, recovery-secret
|
||||
generation, and passkey begin/finish/list/delete. They do not require an
|
||||
organisation administrator role. `POST /api/accounts` and `/api/authentication`
|
||||
are administrative policy routes.
|
||||
|
||||
## HTTP route inventory
|
||||
|
||||
The following routes are covered by `TestHTTPPolicyCannotBeBypassed` in
|
||||
`internal/webui/authorization_surfaces_test.go`. `authorize.go` maps each to its
|
||||
action/resource; the handler may impose a stricter record or instance boundary.
|
||||
The test `TestHTTPPolicyCannotBeBypassed` covers the following routes. It lives
|
||||
in `internal/webui/authorization_surfaces_test.go`. `authorize.go` maps each to
|
||||
its action/resource. The handler may impose a stricter record or instance
|
||||
boundary.
|
||||
|
||||
| Method | Route example |
|
||||
| ------ | ----------------------------------------------------- |
|
||||
@@ -226,21 +228,23 @@ action/resource; the handler may impose a stricter record or instance boundary.
|
||||
|
||||
## Verification limits
|
||||
|
||||
A synthetic browser authenticator verifies protocol behavior, 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.
|
||||
A synthetic browser authenticator checks protocol behaviour. It does not test 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. They keep database tests out of the fast unit suite.
|
||||
|
||||
Existing anonymous conversations are retained but are not silently assigned to a
|
||||
new person. Existing service credentials remain privileged; this inventory does
|
||||
not claim that all internal gRPC methods have independent Cedar gates.
|
||||
The Gateway retains existing anonymous conversations but does not silently
|
||||
assign them to a 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
|
||||
setup before exposing a new installation to untrusted users. Last-active-owner
|
||||
protection for identity suspension/retirement is tracked separately as
|
||||
`archie-core-d7avc`; membership-policy guards are not that lifecycle guard.
|
||||
Bootstrap runs without authentication until the operator creates the first
|
||||
administrator account. Complete setup before exposing a new installation to
|
||||
untrusted users. A separate issue, `archie-core-d7avc`, tracks
|
||||
last-active-owner protection for identity suspension/retirement.
|
||||
Membership-policy guards are not that lifecycle guard.
|
||||
+20
-20
@@ -45,7 +45,7 @@ and `ARCHIE_E2E_PASSWORD` for both seeding and browser checks. Seeding never
|
||||
resets an existing account or deletes test data.
|
||||
|
||||
The first run needs `pnpm install --dir e2e` and `pnpm --dir e2e exec playwright
|
||||
install chromium`. In the cloud environment, Chromium and Playwright are
|
||||
install chromium`. The cloud environment ships Chromium and Playwright
|
||||
preinstalled; run with `NODE_PATH=$(pnpm root -g)`.
|
||||
|
||||
## Single-binary smoke check
|
||||
@@ -62,8 +62,8 @@ node e2e/archie-smoke.cjs
|
||||
|
||||
The check saves a workflow and a one-minute schedule, then verifies that its
|
||||
run links back to the schedule event and appears in the composer. It disables
|
||||
the schedule after the check but leaves records for inspection. No model or
|
||||
forge is needed. The legacy `task e2e:up` stack is not the target of this check.
|
||||
the schedule after the check but leaves records for inspection. The check needs
|
||||
no model or forge. The legacy `task e2e:up` stack is not the target of this check.
|
||||
If Archie is running in WSL and its loopback URL is not reachable from
|
||||
Windows, run the check with Node in the same Linux environment as Archie.
|
||||
If the schedule starts but the run does not finish, check the `events` and
|
||||
@@ -85,53 +85,53 @@ A module in `checks/` exports `async ({ page, go, shot, fail, skip, settled, att
|
||||
- `go(path)` loads a dashboard route: `waitUntil: 'load'` plus 1200ms.
|
||||
Wait for elements, never for `networkidle`: the event stream never goes idle.
|
||||
- `shot(label)` saves `<check>-<kebab>[-<w>x<h>].png` after a short settle,
|
||||
and records `{file, w, h, check}` in the manifest. The label is slugified,
|
||||
and records `{file, w, h, check}` in the manifest. The label becomes a slug,
|
||||
so `shot('/')` becomes `routes-home.png`; a viewport other than the
|
||||
1440x900 default adds a suffix (`-390x844`). Repeated labels get `-2`,
|
||||
`-3`, so every capture is kept.
|
||||
`-3`, so the test runner keeps every capture.
|
||||
- `fail(msg)` records a problem without stopping.
|
||||
- `skip(reason)` stops the check and records a skip: a missing
|
||||
precondition, never a failure.
|
||||
- `tolerate(re)` ignores console errors matching `re`, for a response the page is designed to survive.
|
||||
- `tolerate(re)` ignores console errors matching `re`, for a response the page survives by design.
|
||||
- `attach(name, data)` saves a non-image artifact as `<check>-<name>`.
|
||||
- `settled(sel?)` waits for a selector or URL, then settles briefly.
|
||||
It is the harness-owned wait; checks need no capture wrapper or
|
||||
It is the test runner's wait; checks need no capture wrapper or
|
||||
ad-hoc sleeps around screenshots.
|
||||
|
||||
Each check gets a fresh page at 1440x900 with the login `storageState`;
|
||||
a check that needs a phone viewport resizes it itself to 390x844.
|
||||
Those are the only two viewports in use. A throw, a `fail`, or any
|
||||
console or page error fails the check. One module covers one behaviour;
|
||||
families share a prefix: `audit-*` for the audit page (redirect,
|
||||
filters, revert, runtime, views-export, retention-live, phone),
|
||||
`workflow-*` for the canvas (loading, validation, phone-layout, logic),
|
||||
`chat-composer` for chat input, `chat-dock-*` for the chat dock (pin, drag-cancel,
|
||||
layout, resize, drafts, picker, phone).
|
||||
console or page error fails the check. One module covers one behaviour.
|
||||
Families share a prefix: `audit-*` for the audit page (redirect,
|
||||
filters, revert, runtime, views-export, retention-live, phone), and
|
||||
`workflow-*` for the canvas (loading, validation, phone-layout, logic).
|
||||
`chat-composer` covers chat input, and `chat-dock-*` covers the chat dock (pin,
|
||||
drag-cancel, layout, resize, drafts, picker, phone).
|
||||
|
||||
`routes` loads every static route and flags text with stray leading,
|
||||
trailing or doubled spaces. `seeded` checks the seed is visible.
|
||||
`/logs` is visited but skipped by the whitespace lint: log lines are
|
||||
`routes` visits `/logs` but the whitespace lint skips it: log lines are
|
||||
data, not copy.
|
||||
|
||||
## Output
|
||||
|
||||
Every run writes `out/<stamp>/` with the screenshots,
|
||||
`results.json` (the manifest: `{check, ok, ms, problems, artifacts[]}`,
|
||||
plus `skipped`/`skipReason` for skips) and `report.html`: a self-contained
|
||||
test record with the commit, totals and one row per check (status, time,
|
||||
message and that check's artifacts, screenshots inline). `attach(name, data)`
|
||||
plus `skipped`/`skipReason` for skips) and `report.html`. The report is a
|
||||
self-contained test record with the commit, totals and one row per check (status,
|
||||
time, message and that check's artifacts, screenshots inline). `attach(name, data)`
|
||||
adds a non-image artifact to the current check; a failed check also gets a
|
||||
`failure` screenshot.
|
||||
|
||||
Exits: 0 when every check passes or skips, 1 when any check fails,
|
||||
2 when the harness itself errors. `ARCHIE_E2E_URL` points the run at
|
||||
2 when the test runner itself errors. `ARCHIE_E2E_URL` points the run at
|
||||
a dashboard other than `http://localhost:5173`.
|
||||
|
||||
## Pitfalls
|
||||
|
||||
| Symptom | Cause | Fix |
|
||||
| --- | --- | --- |
|
||||
| State Store exits: server is older than PostgreSQL 18 | another server answered | `stack.sh` uses port 55432; set `ARCHIE_DEV_PGPORT` if that is taken |
|
||||
| State Store exits: server is older than PostgreSQL 18 | another server answered | `stack.sh` uses port 55432; set `ARCHIE_DEV_PGPORT` if another process holds that port |
|
||||
| Startup says a port is in use | a stack or another process already owns it | Run `task e2e:down`, then `task e2e:up`; inspect any remaining listener with `ss -ltnp` |
|
||||
| Your own shell is killed (exit 144) | `pkill -f` matched its own command line | `stack.sh stop` or `restart`, which kill by PID |
|
||||
| `pkill -f` kills your own shell (exit 144) | `pkill -f` matched its own command line | `stack.sh stop` or `restart`, which kill by PID |
|
||||
| Postgres aborts in the cloud | `/tmp/claude-0` is reset to mode 700 | `stack.sh` keeps the root cluster in `/var/lib/archie-dev` |
|
||||
+10
-9
@@ -32,27 +32,28 @@ async function main() {
|
||||
await request("/api/workflows", { authenticated: false, status: 401 });
|
||||
|
||||
const name = `smoke-${randomUUID()}`;
|
||||
const saved = await request(`/api/workflows/${name}`, {
|
||||
method: "PUT",
|
||||
body: { body: `repository: none\nsteps:\n - id: notify\n type: run.notify\n settings: {title: ${name}}\n` },
|
||||
const saved = await request("/api/workflows", {
|
||||
method: "POST",
|
||||
status: 201,
|
||||
body: { name, body: `repository: none\nsteps:\n - id: notify\n type: run.notify\n settings: {title: ${name}}\n` },
|
||||
});
|
||||
const trigger = { workflow: name, every: "1m" };
|
||||
const trigger = { name, workflow_id: saved.id, every: "1m" };
|
||||
const created = await request("/api/triggers", { method: "POST", body: trigger, status: 201 });
|
||||
try {
|
||||
await request(`/api/triggers/${name}`, { method: "PUT", body: trigger });
|
||||
const deadline = Date.now() + 90_000;
|
||||
let last = "no scheduled run";
|
||||
while (Date.now() < deadline) {
|
||||
const recent = await request("/api/runs");
|
||||
const run = recent.find((row) => row.workflow === name);
|
||||
const run = recent.find((row) => row.workflow_id === saved.id);
|
||||
if (run) {
|
||||
last = `run ${run.id}: ${run.state}`;
|
||||
assert.ok(!["failed", "cancelled"].includes(run.state), `${last}: ${run.error || "no error returned"}`);
|
||||
if (run.state === "succeeded") {
|
||||
const trail = await request(`/api/runs/${run.id}`);
|
||||
assert.equal(trail.run.workflow_version, saved.version, "Run used the wrong workflow version");
|
||||
assert.equal(trail.origin?.trigger, name, "Run trail is missing the schedule trigger");
|
||||
assert.equal(trail.origin?.trigger_id, created.id, "Run trail is missing the schedule trigger");
|
||||
assert.ok(trail.origin?.event_id, "Run trail is missing the originating event");
|
||||
assert.equal(trail.origin.type, "schedule.tick");
|
||||
assert.equal(trail.origin.declared_event_type, "schedule.tick");
|
||||
const messages = await request("/api/composer/messages");
|
||||
assert.equal(messages.filter((m) => m.run_id === run.id && m.title === name).length, 1,
|
||||
"Expected one composer notification linked to the run");
|
||||
@@ -64,7 +65,7 @@ async function main() {
|
||||
}
|
||||
throw new Error(`Timed out waiting for ${name}: ${last}`);
|
||||
} finally {
|
||||
await request(`/api/triggers/${name}`, { method: "PUT", body: { ...trigger, disabled: true } });
|
||||
await request(`/api/triggers/${created.id}`, { method: "PUT", body: { ...trigger, disabled: true } });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ module.exports = async ({ page, go, shot, settled, tolerate }) => {
|
||||
await page.keyboard.press('Escape');
|
||||
return names;
|
||||
})();
|
||||
assert.deepEqual(offered.sort(), ['Beta', 'E2E'], 'selector must offer exactly the orgs the caller belongs to');
|
||||
assert.deepEqual(offered.sort(), ['Beta', 'System'], 'selector must offer exactly the orgs the caller belongs to');
|
||||
await go('/workflows');
|
||||
await page.getByText('Parked', { exact: true }).first().waitFor();
|
||||
await shot('home-org-workflows');
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ py() { python3 -c "import sys, json; d = json.load(sys.stdin); print($1)"; }
|
||||
# This account belongs only to the isolated local test stack.
|
||||
email=${ARCHIE_E2E_EMAIL:-operator@example.test}
|
||||
password=${ARCHIE_E2E_PASSWORD:-archie-local-e2e-password}
|
||||
account=$(python3 -c 'import json,sys; print(json.dumps(dict(email=sys.argv[1], password=sys.argv[2], display_name="E2E operator", organisation_name="E2E", workspace_name="Local test", public_url=sys.argv[3])))' "$email" "$password" "${ARCHIE_E2E_URL:-http://localhost:5173}")
|
||||
account=$(python3 -c 'import json,sys; print(json.dumps(dict(email=sys.argv[1], password=sys.argv[2], display_name="E2E operator", public_url=sys.argv[3])))' "$email" "$password" "${ARCHIE_E2E_URL:-http://localhost:5173}")
|
||||
if [ "$(get /api/auth/status | py 'd["setup_required"]')" = "True" ]; then
|
||||
post /api/auth/setup "$account" >/dev/null
|
||||
else
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
package archie
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"regexp"
|
||||
"slices"
|
||||
"testing"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/platform/httpapi"
|
||||
"github.com/samcharles93/archie-core/modules/governance"
|
||||
)
|
||||
|
||||
// operator authenticates every request as an instance administrator.
|
||||
type operator struct{}
|
||||
|
||||
func (operator) Authenticate(ctx context.Context, _ *http.Request) (context.Context, bool, error) {
|
||||
return ctx, true, nil
|
||||
}
|
||||
|
||||
// refuses answers every Allow with err and records what it was asked.
|
||||
type refuses struct {
|
||||
err error
|
||||
asked []string
|
||||
}
|
||||
|
||||
func (r *refuses) Allow(_ context.Context, action, kind string) error {
|
||||
r.asked = append(r.asked, action+" "+kind)
|
||||
return r.err
|
||||
}
|
||||
|
||||
// publicOperations are the only operations a caller reaches without a
|
||||
// credential: sign-in, setup and the auth status the sign-in page reads.
|
||||
var publicOperations = []string{
|
||||
"begin-oidc-sign-in", "begin-passkey-sign-in", "finish-oidc-sign-in", "finish-passkey-sign-in",
|
||||
"get-auth-status", "recover-account", "set-up-account", "sign-in", "sign-out",
|
||||
}
|
||||
|
||||
var pathParam = regexp.MustCompile(`\{[^}]+\}`)
|
||||
|
||||
// TestEveryOperationIsAuthorized guards deny-by-default across every module's
|
||||
// routes. Each registered operation is either one of the named public
|
||||
// operations or declares a valid action and resource kind, and a request that
|
||||
// fails the grant, or that cannot be decided, is refused before its handler
|
||||
// runs. The handlers here have nothing behind them, so one that ran would
|
||||
// panic.
|
||||
func TestEveryOperationIsAuthorized(t *testing.T) {
|
||||
probe := &refuses{err: httpapi.ErrDenied}
|
||||
mux, api := emptyAPI(operator{}, probe)
|
||||
routes := httpapi.Routes(api)
|
||||
if len(routes) < 100 {
|
||||
t.Fatalf("only %d operations registered", len(routes))
|
||||
}
|
||||
|
||||
var public []string
|
||||
for _, route := range routes {
|
||||
if route.Access.IsPublic() {
|
||||
public = append(public, route.ID)
|
||||
continue
|
||||
}
|
||||
action, kind, ok := route.Access.Declared()
|
||||
if !ok {
|
||||
t.Errorf("%s declares no access", route.ID)
|
||||
continue
|
||||
}
|
||||
if err := governance.Action(action).Validate(); err != nil || kind == "" {
|
||||
t.Errorf("%s declares %q on %q", route.ID, action, kind)
|
||||
}
|
||||
}
|
||||
slices.Sort(public)
|
||||
if !slices.Equal(public, publicOperations) {
|
||||
t.Errorf("public operations = %v, want %v", public, publicOperations)
|
||||
}
|
||||
|
||||
for _, tt := range []struct {
|
||||
name string
|
||||
err error
|
||||
want int
|
||||
}{
|
||||
{"a failing grant", httpapi.ErrDenied, http.StatusForbidden},
|
||||
{"an unavailable policy chain", httpapi.ErrUnavailable, http.StatusServiceUnavailable},
|
||||
} {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
for _, route := range routes {
|
||||
action, kind, ok := route.Access.Declared()
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
probe.err, probe.asked = tt.err, nil
|
||||
req := httptest.NewRequestWithContext(t.Context(), route.Method, pathParam.ReplaceAllString(route.Path, "x"), nil)
|
||||
rec := httptest.NewRecorder()
|
||||
mux.ServeHTTP(rec, req)
|
||||
if rec.Code != tt.want {
|
||||
t.Errorf("%s: status = %d, want %d", route.ID, rec.Code, tt.want)
|
||||
}
|
||||
if want := []string{action + " " + kind}; !slices.Equal(probe.asked, want) {
|
||||
t.Errorf("%s: decided on %v, want %v", route.ID, probe.asked, want)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// TestUnwiredAuthorizerRefuses guards the boot order: until the policy chain
|
||||
// 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) {
|
||||
t.Fatalf("Allow with no chain = %v, want %v", err, httpapi.ErrUnavailable)
|
||||
}
|
||||
}
|
||||
+34
-25
@@ -13,47 +13,48 @@ import (
|
||||
"github.com/samcharles93/archie-core/modules/connectors"
|
||||
"github.com/samcharles93/archie-core/modules/dashboard"
|
||||
"github.com/samcharles93/archie-core/modules/deliveries"
|
||||
"github.com/samcharles93/archie-core/modules/drafts"
|
||||
"github.com/samcharles93/archie-core/modules/events"
|
||||
"github.com/samcharles93/archie-core/modules/governance"
|
||||
"github.com/samcharles93/archie-core/modules/judgement"
|
||||
"github.com/samcharles93/archie-core/modules/memory"
|
||||
"github.com/samcharles93/archie-core/modules/proposals"
|
||||
"github.com/samcharles93/archie-core/modules/runs"
|
||||
"github.com/samcharles93/archie-core/modules/system"
|
||||
)
|
||||
|
||||
// apiModules are the modules that serve the HTTP API.
|
||||
type apiModules struct {
|
||||
settings *governance.Module
|
||||
conns *connectors.Module
|
||||
system *system.Module
|
||||
tell *deliveries.Module
|
||||
allow *approvals.Module
|
||||
classes *judgement.Classes
|
||||
policies *judgement.Policies
|
||||
hear *events.Module
|
||||
judge *judgement.Module
|
||||
engine *runs.Engine
|
||||
chat *chat.Module
|
||||
drafts *drafts.Module
|
||||
notes *memory.Module
|
||||
live *hub.Hub
|
||||
settings *governance.Module
|
||||
conns *connectors.Module
|
||||
system *system.Module
|
||||
tell *deliveries.Module
|
||||
allow *approvals.Module
|
||||
actionTypes *judgement.ActionTypes
|
||||
policies *judgement.Policies
|
||||
hear *events.Module
|
||||
judge *judgement.Module
|
||||
engine *runs.Engine
|
||||
chat *chat.Module
|
||||
proposals *proposals.Module
|
||||
notes *memory.Module
|
||||
live *hub.Hub
|
||||
}
|
||||
|
||||
func (m apiModules) register(api huma.API) {
|
||||
m.settings.Register(api)
|
||||
m.settings.RegisterAccounts(api)
|
||||
m.settings.RegisterOrganisations(api)
|
||||
m.settings.RegisterAccess(api)
|
||||
m.conns.Register(api)
|
||||
m.system.Register(api)
|
||||
m.tell.Register(api)
|
||||
m.allow.Register(api)
|
||||
m.classes.Register(api, m.allow)
|
||||
m.actionTypes.Register(api, m.allow)
|
||||
m.policies.Register(api)
|
||||
m.hear.Register(api)
|
||||
m.judge.Register(api)
|
||||
m.engine.Register(api, orgID, m.hear, m.judge, m.allow)
|
||||
m.drafts.Register(api)
|
||||
m.proposals.Register(api)
|
||||
m.chat.Register(api)
|
||||
// The memory routes are served once the root wires the module, which it
|
||||
// does after the modules that read it are built.
|
||||
@@ -68,13 +69,21 @@ func (m apiModules) register(api huma.API) {
|
||||
// needs no database.
|
||||
func Document() ([]byte, error) {
|
||||
settings := &governance.Module{}
|
||||
api := httpapi.New(http.NewServeMux(), buildinfo.Version, settings.Authenticator(""))
|
||||
apiModules{
|
||||
settings: settings, conns: &connectors.Module{}, system: &system.Module{},
|
||||
tell: &deliveries.Module{}, allow: &approvals.Module{}, classes: &judgement.Classes{},
|
||||
policies: &judgement.Policies{}, hear: &events.Module{}, judge: &judgement.Module{},
|
||||
engine: &runs.Engine{}, chat: &chat.Module{}, drafts: &drafts.Module{},
|
||||
notes: &memory.Module{}, live: hub.New(),
|
||||
}.register(api)
|
||||
_, api := emptyAPI(settings.Authenticator(""), settings)
|
||||
return api.OpenAPI().YAML()
|
||||
}
|
||||
|
||||
// emptyAPI registers every route on modules with nothing behind them.
|
||||
func emptyAPI(auth httpapi.Authenticator, authz httpapi.Authorizer) (*http.ServeMux, huma.API) {
|
||||
mux := http.NewServeMux()
|
||||
settings := &governance.Module{}
|
||||
api := httpapi.New(mux, buildinfo.Version, auth, authz)
|
||||
apiModules{
|
||||
settings: settings, conns: &connectors.Module{}, system: &system.Module{},
|
||||
tell: &deliveries.Module{}, allow: &approvals.Module{}, actionTypes: &judgement.ActionTypes{},
|
||||
policies: &judgement.Policies{}, hear: &events.Module{}, judge: &judgement.Module{},
|
||||
engine: &runs.Engine{}, chat: &chat.Module{}, proposals: &proposals.Module{},
|
||||
notes: &memory.Module{}, live: hub.New(),
|
||||
}.register(api)
|
||||
return mux, api
|
||||
}
|
||||
@@ -26,6 +26,7 @@ const (
|
||||
const (
|
||||
stageSetupRead = "cannot read whether owner setup is required"
|
||||
stageStartup = "starting operations failed"
|
||||
stageMigrate = "migrating the database failed"
|
||||
)
|
||||
|
||||
// How long a failed boot step waits before it runs again. The delay doubles up
|
||||
@@ -172,7 +173,7 @@ func activate(ctx context.Context, log *slog.Logger, lookup setupLookup, done <-
|
||||
return ctx.Err()
|
||||
}
|
||||
}
|
||||
if err := retryStartup(ctx, log, g, stageStartup, ops.Start); err != nil {
|
||||
if err := retryStartup(ctx, log, g.stall, stageStartup, ops.Start); err != nil {
|
||||
return err
|
||||
}
|
||||
g.publish()
|
||||
@@ -207,20 +208,20 @@ func waitForSetup(ctx context.Context, log *slog.Logger, lookup setupLookup, don
|
||||
}
|
||||
}
|
||||
|
||||
// retryStartup runs a boot step until it succeeds, recording the stage that
|
||||
// failed for readiness. A boot step that reads the database must not turn a brief
|
||||
// outage into a terminated process.
|
||||
func retryStartup(ctx context.Context, log *slog.Logger, g *gate, stage string, attempt func(context.Context) error) error {
|
||||
// retryStartup runs a boot step until it succeeds, passing the stage that
|
||||
// failed to mark so readiness can report it. A boot step that reads the database
|
||||
// must not turn a brief outage into a terminated process.
|
||||
func retryStartup(ctx context.Context, log *slog.Logger, mark func(stage string), stage string, attempt func(context.Context) error) error {
|
||||
for delay := startupRetryMin; ; delay = min(delay*2, startupRetryMax) {
|
||||
err := attempt(ctx)
|
||||
if err == nil {
|
||||
g.stall("")
|
||||
mark("")
|
||||
return nil
|
||||
}
|
||||
if ctx.Err() != nil {
|
||||
return ctx.Err()
|
||||
}
|
||||
g.stall(stage)
|
||||
mark(stage)
|
||||
log.WarnContext(ctx, "startup step failed; retrying", "stage", stage, "err", err, "in", delay)
|
||||
select {
|
||||
case <-time.After(delay):
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package archie
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"slices"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/platform/health"
|
||||
"github.com/samcharles93/archie-core/modules/approvals"
|
||||
"github.com/samcharles93/archie-core/modules/connectors"
|
||||
"github.com/samcharles93/archie-core/modules/events"
|
||||
"github.com/samcharles93/archie-core/modules/governance"
|
||||
"github.com/samcharles93/archie-core/modules/runs"
|
||||
"github.com/samcharles93/archie-core/modules/system"
|
||||
)
|
||||
|
||||
// healthSources joins what each module knows about itself into the sources the
|
||||
// system health report reads. The report asks them on demand, so nothing here
|
||||
// polls or keeps state.
|
||||
func healthSources(checks *health.Registry, conns *connectors.Module, engine *runs.Engine, allow *approvals.Module, settings *governance.Module, hear *events.Module) system.Sources {
|
||||
return system.Sources{
|
||||
Checks: func(ctx context.Context) []health.Result {
|
||||
return slices.DeleteFunc(checks.Results(ctx), func(r health.Result) bool {
|
||||
// The report lists each connector with its own cause.
|
||||
return r.Name == "connectors"
|
||||
})
|
||||
},
|
||||
Connectors: conns.Health,
|
||||
Runner: engine.Runner,
|
||||
Waiting: func(ctx context.Context) (system.Waiting, error) {
|
||||
pending, err := allow.Pending(ctx)
|
||||
if err != nil {
|
||||
return system.Waiting{}, fmt.Errorf("list pending approvals: %w", err)
|
||||
}
|
||||
counts, err := engine.Counts(ctx, orgID)
|
||||
if err != nil {
|
||||
return system.Waiting{}, err
|
||||
}
|
||||
return system.Waiting{Approvals: len(pending), Runs: counts}, nil
|
||||
},
|
||||
LastFailedRun: func(ctx context.Context) (*runs.RunView, error) {
|
||||
return engine.LastFailed(ctx, orgID)
|
||||
},
|
||||
Setup: func(ctx context.Context) []system.SetupStep {
|
||||
_, modelErr := settings.AgentModel(ctx)
|
||||
sources, srcErr := hear.SourceCount(ctx)
|
||||
return []system.SetupStep{
|
||||
{
|
||||
Title: "Set an agent model",
|
||||
Detail: "Configure a model provider and assign the agent role so workflows and chat can run.",
|
||||
Done: modelErr == nil,
|
||||
Path: "/settings/models",
|
||||
},
|
||||
{
|
||||
Title: "Add an event source",
|
||||
Detail: "Connect a webhook or polling source to start receiving events.",
|
||||
Done: srcErr == nil && sources > 0,
|
||||
Path: "/events?tab=sources",
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -16,9 +16,14 @@ import (
|
||||
"github.com/samcharles93/archie-core/modules/governance"
|
||||
"github.com/samcharles93/archie-core/modules/judgement"
|
||||
"github.com/samcharles93/archie-core/modules/memory"
|
||||
"github.com/samcharles93/archie-core/modules/proposals"
|
||||
"github.com/samcharles93/archie-core/modules/runs"
|
||||
)
|
||||
|
||||
// catalogueUpdateInterval is how often an extension that follows the catalogue
|
||||
// checks it for a new version.
|
||||
const catalogueUpdateInterval = time.Hour
|
||||
|
||||
// operations is everything the gate holds back: the connectors, the access
|
||||
// chain administrative writes are checked against, the workflow that ships with
|
||||
// the binary, and the loops that do work. Run wires it at boot and Start brings
|
||||
@@ -35,6 +40,7 @@ type operations struct {
|
||||
judge *judgement.Module
|
||||
allow *approvals.Module
|
||||
remember *memory.Module
|
||||
proposed *proposals.Module
|
||||
// completeRecord finishes the record of a committed deletion whose entry could
|
||||
// not be written.
|
||||
completeRecord func(context.Context) (int, error)
|
||||
@@ -55,29 +61,48 @@ func (o *operations) Start(ctx context.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Every entry point uses the same chain, and every decision, allowed or
|
||||
// refused, is stored.
|
||||
checked := governance.Recording(access, o.settings, o.log.With("module", "governance"))
|
||||
// A workflow takes its context from the run handle, as a handler takes it
|
||||
// from the request.
|
||||
o.engine.Use(runs.Deps{
|
||||
Settings: o.settings, Toolbox: o.conns, Judge: o.judge, Approver: o.allow,
|
||||
Notifier: o.tell, Memory: o.remember,
|
||||
Proposals: o.proposed, Notifier: o.tell, Messenger: o.tell, Memory: o.remember, Capabilities: o.conns,
|
||||
Access: checked,
|
||||
})
|
||||
if err := installStarter(ctx, o.engine); err != nil {
|
||||
return err
|
||||
}
|
||||
// A connector's new declarations are re-checked against the saved
|
||||
// workflows that reference it, so an update that would break them is
|
||||
// refused instead of failing a run later.
|
||||
o.conns.Use(func(ctx context.Context, connector string, caps connectors.Capabilities) error {
|
||||
return o.engine.RecheckConnector(ctx, orgID, connector, caps)
|
||||
})
|
||||
if err := o.conns.Start(ctx); err != nil {
|
||||
return fmt.Errorf("read accepted connectors: %w", err)
|
||||
}
|
||||
|
||||
// Nothing below can fail, so a retry cannot launch a connector or a loop twice.
|
||||
o.checks.Register("connectors", o.conns.Ready)
|
||||
// Administrative writes are checked against the same live policy chain as
|
||||
// every other request.
|
||||
o.settings.UseAuthorizer(access)
|
||||
// An extension that follows the catalogue checks it for a new version. With
|
||||
// no catalogue source set it does nothing.
|
||||
o.workers.Go(func() { o.conns.WatchUpdates(ctx, catalogueUpdateInterval) })
|
||||
// Administrative writes, and every API request, are checked against the same
|
||||
// live policy chain as chat and background work. The webhook intake applies
|
||||
// each source's delivery policy from it.
|
||||
o.settings.UseAuthorizer(checked)
|
||||
o.allow.UseAuthorizer(checked)
|
||||
o.proposed.UseAuthorizer(checked)
|
||||
o.tell.UseAccess(checked)
|
||||
o.hear.UseDeliveryPolicy(governance.RecordingDelivery(access, o.settings, o.log.With("module", "governance")))
|
||||
o.hear.UseTrustedProxies(o.settings.TrustedProxies)
|
||||
o.talk.Use(chat.Deps{
|
||||
People: o.settings, Access: access, Settings: o.settings, Toolbox: o.conns, Judge: o.judge,
|
||||
People: o.settings, Access: checked, Settings: o.settings, Toolbox: o.conns, Judge: o.judge,
|
||||
Approver: o.allow, Memory: o.remember, Runs: o.engine, Notifier: o.tell,
|
||||
})
|
||||
for _, loop := range []func(context.Context){o.engine.Work, o.hear.Work, o.tell.Work, o.talk.Work, o.retryDeletionRecord} {
|
||||
for _, loop := range []func(context.Context){o.engine.Work, o.hear.Work, o.tell.Work, o.proposed.Work, o.talk.Work, o.retryDeletionRecord} {
|
||||
o.workers.Go(func() { loop(ctx) })
|
||||
}
|
||||
return nil
|
||||
@@ -119,9 +144,12 @@ func (o *operations) Wait() {
|
||||
// installStarter puts the workflow that ships with the binary in place. It
|
||||
// belongs to the organisation, so it waits until setup has created one.
|
||||
func installStarter(ctx context.Context, engine *runs.Engine) error {
|
||||
if _, err := engine.Install(ctx, orgID, "investigate", runs.InvestigateDocument(), "starter"); err != nil {
|
||||
if _, err := engine.InstallShipped(ctx, orgID, "investigate", runs.InvestigateDocument(), string(governance.SystemID)); err != nil {
|
||||
return fmt.Errorf("install the investigate workflow: %w", err)
|
||||
}
|
||||
if _, err := engine.InstallShipped(ctx, orgID, runs.ProposalWorkflow, runs.ProposalDocument(), string(governance.SystemID)); err != nil {
|
||||
return fmt.Errorf("install the proposal workflow: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
+59
-20
@@ -12,6 +12,7 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
@@ -31,11 +32,11 @@ import (
|
||||
"github.com/samcharles93/archie-core/modules/connectors"
|
||||
"github.com/samcharles93/archie-core/modules/dashboard"
|
||||
"github.com/samcharles93/archie-core/modules/deliveries"
|
||||
"github.com/samcharles93/archie-core/modules/drafts"
|
||||
"github.com/samcharles93/archie-core/modules/events"
|
||||
"github.com/samcharles93/archie-core/modules/governance"
|
||||
"github.com/samcharles93/archie-core/modules/judgement"
|
||||
"github.com/samcharles93/archie-core/modules/memory"
|
||||
"github.com/samcharles93/archie-core/modules/proposals"
|
||||
"github.com/samcharles93/archie-core/modules/runs"
|
||||
"github.com/samcharles93/archie-core/modules/system"
|
||||
"github.com/samcharles93/archie-core/ui"
|
||||
@@ -76,7 +77,11 @@ func Run(ctx context.Context, configPath string) error {
|
||||
return fmt.Errorf("claim the database: %w", err)
|
||||
}
|
||||
defer holdServe()
|
||||
if err := pg.Migrate(ctx, log, cfg.Database.OwnerURL, cfg.Database.URL, schemas); err != nil {
|
||||
// Nothing is served yet, so there is no readiness to report while this retries.
|
||||
migrate := func(ctx context.Context) error {
|
||||
return pg.Migrate(ctx, log, cfg.Database.OwnerURL, cfg.Database.URL, schemas)
|
||||
}
|
||||
if err := retryStartup(ctx, log, func(string) {}, stageMigrate, migrate); err != nil {
|
||||
_ = db.Close()
|
||||
return err
|
||||
}
|
||||
@@ -147,16 +152,22 @@ func wire(log *slog.Logger, configPath string, cfg Config, db *sqlx.DB) (*binary
|
||||
runtime.RegisterBuiltinClasses()
|
||||
settings := governance.NewModule(db, log.With("module", "governance"), orgID)
|
||||
mux := http.NewServeMux()
|
||||
api := httpapi.New(mux, buildinfo.Version, settings.Authenticator(cfg.AdminTokenSHA256))
|
||||
api := httpapi.New(mux, buildinfo.Version, settings.Authenticator(cfg.AdminTokenSHA256), settings)
|
||||
|
||||
conns, err := connectors.NewModule(db, log.With("module", "connectors"), orgID, connectors.Sealing{
|
||||
conns, err := connectors.NewModule(db, log.With("module", "connectors"), connectors.Sealing{
|
||||
Identity: cfg.AgeIdentity, Backups: cfg.AgeBackupRecipients,
|
||||
})
|
||||
}, filepath.Join(cfg.StateDir, "extensions"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// A model's key is a credential name resolved through the sealed store.
|
||||
settings.UseCredentials(conns)
|
||||
// A model's key is a credential id resolved through the sealed store in
|
||||
// organisation scope with no person attached.
|
||||
settings.UseCredentials(orgCredentials{conns: conns, orgID: string(governance.DefaultOrgID)})
|
||||
// An account links a channel account on the connectors that can link.
|
||||
settings.UseChannels(conns)
|
||||
// A model's window comes from the published catalogue, cached under the
|
||||
// state directory so a restart reads it from disk.
|
||||
settings.UseModelCatalogue(filepath.Join(cfg.StateDir, "model-catalogue.json"))
|
||||
|
||||
sys := system.New(system.Bootstrap{
|
||||
Listen: cfg.Listen, Database: DatabaseHost(cfg.Database.URL), Schemas: len(schemas),
|
||||
@@ -173,19 +184,22 @@ func wire(log *slog.Logger, configPath string, cfg Config, db *sqlx.DB) (*binary
|
||||
talk := chat.NewModule(db, log.With("module", "chat"), orgID, live)
|
||||
// A workflow takes its context from the run handle, as a handler takes it
|
||||
// from the request.
|
||||
classes := judgement.NewClasses(db, log.With("module", "judgement"), orgID)
|
||||
actionTypes := judgement.NewActionTypes(db, log.With("module", "judgement"), orgID)
|
||||
// An approval request is carried by deliveries, and its answer wakes the run
|
||||
// that is waiting on it.
|
||||
allow := approvals.NewModule(db, log.With("module", "approvals"), orgID, tell, answers{chat: talk, runs: engine}, classes, settings, settings)
|
||||
allow := approvals.NewModule(db, log.With("module", "approvals"), orgID, tell, answers{chat: talk, runs: engine}, actionTypes, settings, settings)
|
||||
// Approving an action that can't be undone needs a fresh passkey assertion.
|
||||
allow.UseConfirmer(settings)
|
||||
policies := judgement.NewPolicies(db, log.With("module", "judgement"), orgID)
|
||||
// An answer a channel delivers is an event, and settles its request.
|
||||
sealer, err := seal.New(cfg.AgeIdentity, cfg.AgeBackupRecipients)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
hear := events.NewModule(db, log.With("module", "events"), orgID, sealer, conns, engine, allow, tell)
|
||||
hear := events.NewModule(db, log.With("module", "events"), orgID, sealer, conns, engine, allow, settings, tell)
|
||||
hear.Routes(mux)
|
||||
judge := newJudgement(db, log, conns, classes, policies, settings, hear)
|
||||
engine.UseReferrers(hear)
|
||||
judge := newJudgement(db, log, conns, actionTypes, policies, settings, hear)
|
||||
// The record of deletions outlives this process and its database, so the
|
||||
// log exists before anything can be deleted: an instance that has run this
|
||||
// release and lost its log is a different case from one that never deleted.
|
||||
@@ -200,9 +214,15 @@ func wire(log *slog.Logger, configPath string, cfg Config, db *sqlx.DB) (*binary
|
||||
}
|
||||
return nil
|
||||
})
|
||||
proposed := proposals.NewModule(db, log.With("module", "proposals"), orgID, hear, engine, policies, judge)
|
||||
// A cause that keeps recurring becomes a root-cause proposal.
|
||||
remember.UseProposals(proposed)
|
||||
// Approving an action that can't be undone needs a fresh passkey assertion.
|
||||
proposed.UseConfirmer(settings)
|
||||
sys.UseHealth(healthSources(checks, conns, engine, allow, settings, hear))
|
||||
apiModules{
|
||||
settings: settings, conns: conns, system: sys, tell: tell, allow: allow, classes: classes, policies: policies,
|
||||
hear: hear, judge: judge, engine: engine, chat: talk, drafts: drafts.NewModule(db, log.With("module", "drafts"), orgID, hear, engine, policies),
|
||||
settings: settings, conns: conns, system: sys, tell: tell, allow: allow, actionTypes: actionTypes, policies: policies,
|
||||
hear: hear, judge: judge, engine: engine, chat: talk, proposals: proposed,
|
||||
notes: remember, live: live,
|
||||
}.register(api)
|
||||
dashboard.Routes(mux, ui.DistDirFS)
|
||||
@@ -212,7 +232,7 @@ func wire(log *slog.Logger, configPath string, cfg Config, db *sqlx.DB) (*binary
|
||||
db: db, conns: conns, gate: g, served: serveSurface(checks, g), settings: settings,
|
||||
ops: &operations{
|
||||
log: log, checks: checks, settings: settings, conns: conns, engine: engine, hear: hear,
|
||||
tell: tell, talk: talk, judge: judge, allow: allow, remember: remember,
|
||||
tell: tell, talk: talk, judge: judge, allow: allow, remember: remember, proposed: proposed,
|
||||
completeRecord: func(ctx context.Context) (int, error) {
|
||||
return memory.Reconcile(ctx, db, cfg.StateDir)
|
||||
},
|
||||
@@ -226,6 +246,25 @@ func (b *binary) close() {
|
||||
_ = b.db.Close()
|
||||
}
|
||||
|
||||
// orgCredentials confines every model-provider credential lookup to orgID with
|
||||
// no person attached, so a caller's personal credentials are never reachable.
|
||||
type orgCredentials struct {
|
||||
conns *connectors.Module
|
||||
orgID string
|
||||
}
|
||||
|
||||
func (c orgCredentials) BearerTokenByID(ctx context.Context, id uuid.UUID) (string, error) {
|
||||
return c.conns.BearerTokenByID(connectors.WithScope(ctx, connectors.Scope{OrgID: c.orgID}), id)
|
||||
}
|
||||
|
||||
func (c orgCredentials) BearerCredentialName(ctx context.Context, id uuid.UUID) (string, bool, error) {
|
||||
return c.conns.BearerCredentialName(connectors.WithScope(ctx, connectors.Scope{OrgID: c.orgID}), id)
|
||||
}
|
||||
|
||||
func (c orgCredentials) BearerCredentialNames(ctx context.Context) (map[uuid.UUID]string, error) {
|
||||
return c.conns.BearerCredentialNames(connectors.WithScope(ctx, connectors.Scope{OrgID: c.orgID}))
|
||||
}
|
||||
|
||||
// answers wakes whatever asked for an approval: a chat turn, or else the run
|
||||
// waiting on it.
|
||||
type answers struct {
|
||||
@@ -241,18 +280,18 @@ func (a answers) Signal(ctx context.Context, id uuid.UUID, key string, payload j
|
||||
}
|
||||
|
||||
// newJudgement returns the judgement module with its hard rules, data guards
|
||||
// and change-request rules. A failed action tightens its class.
|
||||
func newJudgement(db *sqlx.DB, log *slog.Logger, conns *connectors.Module, classes *judgement.Classes, policies *judgement.Policies, settings *governance.Module, heard judgement.Events) *judgement.Module {
|
||||
// and change-request rules. A failed action tightens its action type.
|
||||
func newJudgement(db *sqlx.DB, log *slog.Logger, conns *connectors.Module, actionTypes *judgement.ActionTypes, policies *judgement.Policies, settings *governance.Module, heard judgement.Events) *judgement.Module {
|
||||
guards := []judgement.Guard{
|
||||
judgement.Impact{Lookup: judgement.RecordedFacts{Source: conns, People: settings}, Defaults: settings},
|
||||
judgement.Impact{Lookup: judgement.RecordedFacts{Source: conns, Accounts: settings}, Defaults: settings},
|
||||
judgement.Reversibility{},
|
||||
judgement.Precedent{Classes: classes},
|
||||
judgement.Precedent{ActionTypes: actionTypes},
|
||||
judgement.Provenance{Events: heard},
|
||||
judgement.Timing{Calendar: settings},
|
||||
judgement.Cost{Budgets: settings, Counts: judgement.NewSpend(db, orgID)},
|
||||
judgement.Freeze{Freezes: settings},
|
||||
}
|
||||
judge := judgement.NewModule(db, log.With("module", "judgement"), orgID, conns, []judgement.HardRule{policies}, guards, classes)
|
||||
judge := judgement.NewModule(db, log.With("module", "judgement"), orgID, conns, []judgement.HardRule{policies}, guards, actionTypes)
|
||||
judge.UseExtensions(conns)
|
||||
judge.UseChangeRules(policies)
|
||||
return judge
|
||||
@@ -262,7 +301,7 @@ func newJudgement(db *sqlx.DB, log *slog.Logger, conns *connectors.Module, class
|
||||
const orgID = "default"
|
||||
|
||||
// schemas are the module schemas the runtime role is granted DML on.
|
||||
var schemas = []string{"runs", "connectors", "events", "governance", "deliveries", "judgement", "approvals", "memory", "drafts", "chat"}
|
||||
var schemas = []string{"runs", "connectors", "events", "governance", "deliveries", "judgement", "approvals", "memory", "alerts", "proposals", "chat"}
|
||||
|
||||
// owner names this process in run leases.
|
||||
func owner() string {
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -65,7 +65,7 @@ func TestOpenShellModelEgressHoldsKeysOnTheGateway(t *testing.T) {
|
||||
wantKeys map[string]string // key env -> real key held on the gateway
|
||||
wantHosts []string
|
||||
wantPorts []int // defaults to 443 for each host
|
||||
wantHeader string // header the profile places the key in; empty means a bearer token
|
||||
wantHeader string // header that carries the key; empty means a bearer token
|
||||
}{
|
||||
{
|
||||
name: "secret reference",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -63,7 +63,7 @@ const controlPlaneWatchHealthyMultiple = 2
|
||||
// deliberately: that version is unusable to this build, and resuming before it
|
||||
// would re-offer it on every reconnect for the life of the process. Only a
|
||||
// cancellation stops the loop, and the loop watches for it itself, so shutdown
|
||||
// is prompt however long the current backoff is and whether or not the stream
|
||||
// is prompt however long the current backoff is and whether the stream
|
||||
// is still open.
|
||||
//
|
||||
// The reconnect delay is decided by the attempt that just ended, and only by
|
||||
|
||||
@@ -35,7 +35,8 @@ type Sender interface {
|
||||
|
||||
// Reloader is a channel that can re-read its configuration in place. The
|
||||
// capability a status report declares and the reload action both derive from
|
||||
// this interface, so a channel cannot advertise one and answer nothing.
|
||||
// the Reloader interface, so a channel cannot advertise one and answer
|
||||
// nothing.
|
||||
type Reloader interface {
|
||||
Reload() error
|
||||
}
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -281,7 +281,10 @@ type DescribeResponse struct {
|
||||
// which the dashboard renders as a form.
|
||||
Settings []*Setting `protobuf:"bytes,8,rep,name=settings,proto3" json:"settings,omitempty"`
|
||||
// version is the connector's own release.
|
||||
Version string `protobuf:"bytes,9,opt,name=version,proto3" json:"version,omitempty"`
|
||||
Version string `protobuf:"bytes,9,opt,name=version,proto3" json:"version,omitempty"`
|
||||
// links_accounts says the connector serves LinkURL and emits account.link
|
||||
// events, so a person can link their channel identity to an account.
|
||||
LinksAccounts bool `protobuf:"varint,10,opt,name=links_accounts,json=linksAccounts,proto3" json:"links_accounts,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -379,6 +382,13 @@ func (x *DescribeResponse) GetVersion() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DescribeResponse) GetLinksAccounts() bool {
|
||||
if x != nil {
|
||||
return x.LinksAccounts
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Setting is one value an operator enters for an extension to run.
|
||||
type Setting struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
@@ -679,10 +689,13 @@ func (x *DeliveryType) GetInputSchema() []byte {
|
||||
}
|
||||
|
||||
type LookupType struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
|
||||
InputSchema []byte `protobuf:"bytes,3,opt,name=input_schema,json=inputSchema,proto3" json:"input_schema,omitempty"`
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
|
||||
InputSchema []byte `protobuf:"bytes,3,opt,name=input_schema,json=inputSchema,proto3" json:"input_schema,omitempty"`
|
||||
// effect declares the lookup's effects. Only the effects_declared,
|
||||
// privilege_change and secret_access fields apply to a lookup.
|
||||
Effect *Effect `protobuf:"bytes,4,opt,name=effect,proto3" json:"effect,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -738,13 +751,30 @@ func (x *LookupType) GetInputSchema() []byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *LookupType) GetEffect() *Effect {
|
||||
if x != nil {
|
||||
return x.Effect
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Effect struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ReadOnly bool `protobuf:"varint,1,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"`
|
||||
Reversibility Reversibility `protobuf:"varint,2,opt,name=reversibility,proto3,enum=connector.v1.Reversibility" json:"reversibility,omitempty"`
|
||||
// summary says in plain words what the action does, for example "delete
|
||||
// files older than 24h under /tmp/runner".
|
||||
Summary string `protobuf:"bytes,3,opt,name=summary,proto3" json:"summary,omitempty"`
|
||||
Summary string `protobuf:"bytes,3,opt,name=summary,proto3" json:"summary,omitempty"`
|
||||
// effects_declared says the connector stated this action's privilege_change
|
||||
// and secret_access explicitly. With it false the two flags mean nothing: an
|
||||
// action that never stated its effects is prohibited in chat, which is not
|
||||
// the same as an action that stated it has none.
|
||||
EffectsDeclared bool `protobuf:"varint,4,opt,name=effects_declared,json=effectsDeclared,proto3" json:"effects_declared,omitempty"`
|
||||
// privilege_change says the action changes who may do what: it grants
|
||||
// roles, changes identities or policies, or changes control-plane settings.
|
||||
PrivilegeChange bool `protobuf:"varint,5,opt,name=privilege_change,json=privilegeChange,proto3" json:"privilege_change,omitempty"`
|
||||
// secret_access says the action reads, exports or reveals a secret.
|
||||
SecretAccess bool `protobuf:"varint,6,opt,name=secret_access,json=secretAccess,proto3" json:"secret_access,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -800,8 +830,29 @@ func (x *Effect) GetSummary() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Effect) GetEffectsDeclared() bool {
|
||||
if x != nil {
|
||||
return x.EffectsDeclared
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *Effect) GetPrivilegeChange() bool {
|
||||
if x != nil {
|
||||
return x.PrivilegeChange
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *Effect) GetSecretAccess() bool {
|
||||
if x != nil {
|
||||
return x.SecretAccess
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Target is what an action acts on. Connector, action, kind and environment
|
||||
// together are the action class.
|
||||
// together are the action type.
|
||||
type Target struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
|
||||
@@ -1223,7 +1274,7 @@ type InvokeResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Output []byte `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"`
|
||||
// executed_digest is the connector's digest of what it ran. A mismatch is a
|
||||
// finding and tightens the action class.
|
||||
// finding and tightens the action type.
|
||||
ExecutedDigest string `protobuf:"bytes,2,opt,name=executed_digest,json=executedDigest,proto3" json:"executed_digest,omitempty"`
|
||||
// outcome_unknown says the connector can't confirm what its effect did.
|
||||
OutcomeUnknown bool `protobuf:"varint,3,opt,name=outcome_unknown,json=outcomeUnknown,proto3" json:"outcome_unknown,omitempty"`
|
||||
@@ -1705,6 +1756,96 @@ func (x *ListenResponse) GetCursor() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
type LinkURLRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// code is the single-use link code the person sends to the connector.
|
||||
Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *LinkURLRequest) Reset() {
|
||||
*x = LinkURLRequest{}
|
||||
mi := &file_connector_v1_connector_proto_msgTypes[26]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *LinkURLRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*LinkURLRequest) ProtoMessage() {}
|
||||
|
||||
func (x *LinkURLRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_connector_v1_connector_proto_msgTypes[26]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use LinkURLRequest.ProtoReflect.Descriptor instead.
|
||||
func (*LinkURLRequest) Descriptor() ([]byte, []int) {
|
||||
return file_connector_v1_connector_proto_rawDescGZIP(), []int{26}
|
||||
}
|
||||
|
||||
func (x *LinkURLRequest) GetCode() string {
|
||||
if x != nil {
|
||||
return x.Code
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type LinkURLResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// url opens the connector's channel with the code attached.
|
||||
Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *LinkURLResponse) Reset() {
|
||||
*x = LinkURLResponse{}
|
||||
mi := &file_connector_v1_connector_proto_msgTypes[27]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *LinkURLResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*LinkURLResponse) ProtoMessage() {}
|
||||
|
||||
func (x *LinkURLResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_connector_v1_connector_proto_msgTypes[27]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use LinkURLResponse.ProtoReflect.Descriptor instead.
|
||||
func (*LinkURLResponse) Descriptor() ([]byte, []int) {
|
||||
return file_connector_v1_connector_proto_rawDescGZIP(), []int{27}
|
||||
}
|
||||
|
||||
func (x *LinkURLResponse) GetUrl() string {
|
||||
if x != nil {
|
||||
return x.Url
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_connector_v1_connector_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_connector_v1_connector_proto_rawDesc = "" +
|
||||
@@ -1720,7 +1861,7 @@ const file_connector_v1_connector_proto_rawDesc = "" +
|
||||
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
|
||||
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x13\n" +
|
||||
"\x11ConfigureResponse\"\x11\n" +
|
||||
"\x0fDescribeRequest\"\x8d\x03\n" +
|
||||
"\x0fDescribeRequest\"\xb4\x03\n" +
|
||||
"\x10DescribeResponse\x12\x1a\n" +
|
||||
"\bcontract\x18\x01 \x01(\tR\bcontract\x12/\n" +
|
||||
"\x06events\x18\x02 \x03(\v2\x17.connector.v1.EventTypeR\x06events\x122\n" +
|
||||
@@ -1732,7 +1873,9 @@ const file_connector_v1_connector_proto_rawDesc = "" +
|
||||
"\alistens\x18\x06 \x01(\bR\alistens\x12!\n" +
|
||||
"\ftarget_facts\x18\a \x01(\bR\vtargetFacts\x121\n" +
|
||||
"\bsettings\x18\b \x03(\v2\x15.connector.v1.SettingR\bsettings\x12\x18\n" +
|
||||
"\aversion\x18\t \x01(\tR\aversion\"\xd0\x01\n" +
|
||||
"\aversion\x18\t \x01(\tR\aversion\x12%\n" +
|
||||
"\x0elinks_accounts\x18\n" +
|
||||
" \x01(\bR\rlinksAccounts\"\xd0\x01\n" +
|
||||
"\aSetting\x12\x10\n" +
|
||||
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
|
||||
"\x05label\x18\x02 \x01(\tR\x05label\x12 \n" +
|
||||
@@ -1757,16 +1900,20 @@ const file_connector_v1_connector_proto_rawDesc = "" +
|
||||
"\fDeliveryType\x12\x12\n" +
|
||||
"\x04name\x18\x01 \x01(\tR\x04name\x12 \n" +
|
||||
"\vdescription\x18\x02 \x01(\tR\vdescription\x12!\n" +
|
||||
"\finput_schema\x18\x03 \x01(\fR\vinputSchema\"e\n" +
|
||||
"\finput_schema\x18\x03 \x01(\fR\vinputSchema\"\x93\x01\n" +
|
||||
"\n" +
|
||||
"LookupType\x12\x12\n" +
|
||||
"\x04name\x18\x01 \x01(\tR\x04name\x12 \n" +
|
||||
"\vdescription\x18\x02 \x01(\tR\vdescription\x12!\n" +
|
||||
"\finput_schema\x18\x03 \x01(\fR\vinputSchema\"\x82\x01\n" +
|
||||
"\finput_schema\x18\x03 \x01(\fR\vinputSchema\x12,\n" +
|
||||
"\x06effect\x18\x04 \x01(\v2\x14.connector.v1.EffectR\x06effect\"\xfd\x01\n" +
|
||||
"\x06Effect\x12\x1b\n" +
|
||||
"\tread_only\x18\x01 \x01(\bR\breadOnly\x12A\n" +
|
||||
"\rreversibility\x18\x02 \x01(\x0e2\x1b.connector.v1.ReversibilityR\rreversibility\x12\x18\n" +
|
||||
"\asummary\x18\x03 \x01(\tR\asummary\"n\n" +
|
||||
"\asummary\x18\x03 \x01(\tR\asummary\x12)\n" +
|
||||
"\x10effects_declared\x18\x04 \x01(\bR\x0feffectsDeclared\x12)\n" +
|
||||
"\x10privilege_change\x18\x05 \x01(\bR\x0fprivilegeChange\x12#\n" +
|
||||
"\rsecret_access\x18\x06 \x01(\bR\fsecretAccess\"n\n" +
|
||||
"\x06Target\x12\x12\n" +
|
||||
"\x04kind\x18\x01 \x01(\tR\x04kind\x12\x0e\n" +
|
||||
"\x02id\x18\x02 \x01(\tR\x02id\x12 \n" +
|
||||
@@ -1829,7 +1976,11 @@ const file_connector_v1_connector_proto_rawDesc = "" +
|
||||
"\x06cursor\x18\x01 \x01(\tR\x06cursor\"U\n" +
|
||||
"\x0eListenResponse\x12+\n" +
|
||||
"\x06events\x18\x01 \x03(\v2\x13.connector.v1.EventR\x06events\x12\x16\n" +
|
||||
"\x06cursor\x18\x02 \x01(\tR\x06cursor*\xd9\x01\n" +
|
||||
"\x06cursor\x18\x02 \x01(\tR\x06cursor\"$\n" +
|
||||
"\x0eLinkURLRequest\x12\x12\n" +
|
||||
"\x04code\x18\x01 \x01(\tR\x04code\"#\n" +
|
||||
"\x0fLinkURLResponse\x12\x10\n" +
|
||||
"\x03url\x18\x01 \x01(\tR\x03url*\xd9\x01\n" +
|
||||
"\vSettingType\x12\x1c\n" +
|
||||
"\x18SETTING_TYPE_UNSPECIFIED\x10\x00\x12\x17\n" +
|
||||
"\x13SETTING_TYPE_STRING\x10\x01\x12\x17\n" +
|
||||
@@ -1843,7 +1994,7 @@ const file_connector_v1_connector_proto_rawDesc = "" +
|
||||
"\x19REVERSIBILITY_UNSPECIFIED\x10\x00\x12&\n" +
|
||||
"\"REVERSIBILITY_UNDONE_AUTOMATICALLY\x10\x01\x12\x1d\n" +
|
||||
"\x19REVERSIBILITY_RECOVERABLE\x10\x02\x12\x1e\n" +
|
||||
"\x1aREVERSIBILITY_IRREVERSIBLE\x10\x032\xa2\x05\n" +
|
||||
"\x1aREVERSIBILITY_IRREVERSIBLE\x10\x032\xea\x05\n" +
|
||||
"\x10ConnectorService\x12L\n" +
|
||||
"\tConfigure\x12\x1e.connector.v1.ConfigureRequest\x1a\x1f.connector.v1.ConfigureResponse\x12I\n" +
|
||||
"\bDescribe\x12\x1d.connector.v1.DescribeRequest\x1a\x1e.connector.v1.DescribeResponse\x12@\n" +
|
||||
@@ -1853,7 +2004,8 @@ const file_connector_v1_connector_proto_rawDesc = "" +
|
||||
"\x06Lookup\x12\x1b.connector.v1.LookupRequest\x1a\x1c.connector.v1.LookupResponse\x12F\n" +
|
||||
"\aDeliver\x12\x1c.connector.v1.DeliverRequest\x1a\x1d.connector.v1.DeliverResponse\x12E\n" +
|
||||
"\x06Listen\x12\x1b.connector.v1.ListenRequest\x1a\x1c.connector.v1.ListenResponse0\x01\x12R\n" +
|
||||
"\vTargetFacts\x12 .connector.v1.TargetFactsRequest\x1a!.connector.v1.TargetFactsResponseB\xc4\x01\n" +
|
||||
"\vTargetFacts\x12 .connector.v1.TargetFactsRequest\x1a!.connector.v1.TargetFactsResponse\x12F\n" +
|
||||
"\aLinkURL\x12\x1c.connector.v1.LinkURLRequest\x1a\x1d.connector.v1.LinkURLResponseB\xc4\x01\n" +
|
||||
"\x10com.connector.v1B\x0eConnectorProtoP\x01ZOgithub.com/samcharles93/archie-core/internal/contracts/connector/v1;connectorv1\xa2\x02\x03CXX\xaa\x02\fConnector.V1\xca\x02\fConnector\\V1\xe2\x02\x18Connector\\V1\\GPBMetadata\xea\x02\rConnector::V1b\x06proto3"
|
||||
|
||||
var (
|
||||
@@ -1869,7 +2021,7 @@ func file_connector_v1_connector_proto_rawDescGZIP() []byte {
|
||||
}
|
||||
|
||||
var file_connector_v1_connector_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||
var file_connector_v1_connector_proto_msgTypes = make([]protoimpl.MessageInfo, 29)
|
||||
var file_connector_v1_connector_proto_msgTypes = make([]protoimpl.MessageInfo, 31)
|
||||
var file_connector_v1_connector_proto_goTypes = []any{
|
||||
(SettingType)(0), // 0: connector.v1.SettingType
|
||||
(Reversibility)(0), // 1: connector.v1.Reversibility
|
||||
@@ -1899,14 +2051,16 @@ var file_connector_v1_connector_proto_goTypes = []any{
|
||||
(*TargetFactsResponse)(nil), // 25: connector.v1.TargetFactsResponse
|
||||
(*ListenRequest)(nil), // 26: connector.v1.ListenRequest
|
||||
(*ListenResponse)(nil), // 27: connector.v1.ListenResponse
|
||||
nil, // 28: connector.v1.ConfigureRequest.SettingsEntry
|
||||
nil, // 29: connector.v1.ConfigureRequest.SecretsEntry
|
||||
nil, // 30: connector.v1.ParseRequest.HeadersEntry
|
||||
(*timestamppb.Timestamp)(nil), // 31: google.protobuf.Timestamp
|
||||
(*LinkURLRequest)(nil), // 28: connector.v1.LinkURLRequest
|
||||
(*LinkURLResponse)(nil), // 29: connector.v1.LinkURLResponse
|
||||
nil, // 30: connector.v1.ConfigureRequest.SettingsEntry
|
||||
nil, // 31: connector.v1.ConfigureRequest.SecretsEntry
|
||||
nil, // 32: connector.v1.ParseRequest.HeadersEntry
|
||||
(*timestamppb.Timestamp)(nil), // 33: google.protobuf.Timestamp
|
||||
}
|
||||
var file_connector_v1_connector_proto_depIdxs = []int32{
|
||||
28, // 0: connector.v1.ConfigureRequest.settings:type_name -> connector.v1.ConfigureRequest.SettingsEntry
|
||||
29, // 1: connector.v1.ConfigureRequest.secrets:type_name -> connector.v1.ConfigureRequest.SecretsEntry
|
||||
30, // 0: connector.v1.ConfigureRequest.settings:type_name -> connector.v1.ConfigureRequest.SettingsEntry
|
||||
31, // 1: connector.v1.ConfigureRequest.secrets:type_name -> connector.v1.ConfigureRequest.SecretsEntry
|
||||
7, // 2: connector.v1.DescribeResponse.events:type_name -> connector.v1.EventType
|
||||
8, // 3: connector.v1.DescribeResponse.actions:type_name -> connector.v1.ActionType
|
||||
10, // 4: connector.v1.DescribeResponse.lookups:type_name -> connector.v1.LookupType
|
||||
@@ -1914,37 +2068,40 @@ var file_connector_v1_connector_proto_depIdxs = []int32{
|
||||
6, // 6: connector.v1.DescribeResponse.settings:type_name -> connector.v1.Setting
|
||||
0, // 7: connector.v1.Setting.type:type_name -> connector.v1.SettingType
|
||||
11, // 8: connector.v1.ActionType.effect:type_name -> connector.v1.Effect
|
||||
1, // 9: connector.v1.Effect.reversibility:type_name -> connector.v1.Reversibility
|
||||
30, // 10: connector.v1.ParseRequest.headers:type_name -> connector.v1.ParseRequest.HeadersEntry
|
||||
15, // 11: connector.v1.ParseResponse.events:type_name -> connector.v1.Event
|
||||
31, // 12: connector.v1.Event.occurred_at:type_name -> google.protobuf.Timestamp
|
||||
12, // 13: connector.v1.ResolveResponse.target:type_name -> connector.v1.Target
|
||||
11, // 14: connector.v1.ResolveResponse.effect:type_name -> connector.v1.Effect
|
||||
12, // 15: connector.v1.TargetFactsRequest.target:type_name -> connector.v1.Target
|
||||
15, // 16: connector.v1.ListenResponse.events:type_name -> connector.v1.Event
|
||||
2, // 17: connector.v1.ConnectorService.Configure:input_type -> connector.v1.ConfigureRequest
|
||||
4, // 18: connector.v1.ConnectorService.Describe:input_type -> connector.v1.DescribeRequest
|
||||
13, // 19: connector.v1.ConnectorService.Parse:input_type -> connector.v1.ParseRequest
|
||||
16, // 20: connector.v1.ConnectorService.Resolve:input_type -> connector.v1.ResolveRequest
|
||||
18, // 21: connector.v1.ConnectorService.Invoke:input_type -> connector.v1.InvokeRequest
|
||||
20, // 22: connector.v1.ConnectorService.Lookup:input_type -> connector.v1.LookupRequest
|
||||
22, // 23: connector.v1.ConnectorService.Deliver:input_type -> connector.v1.DeliverRequest
|
||||
26, // 24: connector.v1.ConnectorService.Listen:input_type -> connector.v1.ListenRequest
|
||||
24, // 25: connector.v1.ConnectorService.TargetFacts:input_type -> connector.v1.TargetFactsRequest
|
||||
3, // 26: connector.v1.ConnectorService.Configure:output_type -> connector.v1.ConfigureResponse
|
||||
5, // 27: connector.v1.ConnectorService.Describe:output_type -> connector.v1.DescribeResponse
|
||||
14, // 28: connector.v1.ConnectorService.Parse:output_type -> connector.v1.ParseResponse
|
||||
17, // 29: connector.v1.ConnectorService.Resolve:output_type -> connector.v1.ResolveResponse
|
||||
19, // 30: connector.v1.ConnectorService.Invoke:output_type -> connector.v1.InvokeResponse
|
||||
21, // 31: connector.v1.ConnectorService.Lookup:output_type -> connector.v1.LookupResponse
|
||||
23, // 32: connector.v1.ConnectorService.Deliver:output_type -> connector.v1.DeliverResponse
|
||||
27, // 33: connector.v1.ConnectorService.Listen:output_type -> connector.v1.ListenResponse
|
||||
25, // 34: connector.v1.ConnectorService.TargetFacts:output_type -> connector.v1.TargetFactsResponse
|
||||
26, // [26:35] is the sub-list for method output_type
|
||||
17, // [17:26] is the sub-list for method input_type
|
||||
17, // [17:17] is the sub-list for extension type_name
|
||||
17, // [17:17] is the sub-list for extension extendee
|
||||
0, // [0:17] is the sub-list for field type_name
|
||||
11, // 9: connector.v1.LookupType.effect:type_name -> connector.v1.Effect
|
||||
1, // 10: connector.v1.Effect.reversibility:type_name -> connector.v1.Reversibility
|
||||
32, // 11: connector.v1.ParseRequest.headers:type_name -> connector.v1.ParseRequest.HeadersEntry
|
||||
15, // 12: connector.v1.ParseResponse.events:type_name -> connector.v1.Event
|
||||
33, // 13: connector.v1.Event.occurred_at:type_name -> google.protobuf.Timestamp
|
||||
12, // 14: connector.v1.ResolveResponse.target:type_name -> connector.v1.Target
|
||||
11, // 15: connector.v1.ResolveResponse.effect:type_name -> connector.v1.Effect
|
||||
12, // 16: connector.v1.TargetFactsRequest.target:type_name -> connector.v1.Target
|
||||
15, // 17: connector.v1.ListenResponse.events:type_name -> connector.v1.Event
|
||||
2, // 18: connector.v1.ConnectorService.Configure:input_type -> connector.v1.ConfigureRequest
|
||||
4, // 19: connector.v1.ConnectorService.Describe:input_type -> connector.v1.DescribeRequest
|
||||
13, // 20: connector.v1.ConnectorService.Parse:input_type -> connector.v1.ParseRequest
|
||||
16, // 21: connector.v1.ConnectorService.Resolve:input_type -> connector.v1.ResolveRequest
|
||||
18, // 22: connector.v1.ConnectorService.Invoke:input_type -> connector.v1.InvokeRequest
|
||||
20, // 23: connector.v1.ConnectorService.Lookup:input_type -> connector.v1.LookupRequest
|
||||
22, // 24: connector.v1.ConnectorService.Deliver:input_type -> connector.v1.DeliverRequest
|
||||
26, // 25: connector.v1.ConnectorService.Listen:input_type -> connector.v1.ListenRequest
|
||||
24, // 26: connector.v1.ConnectorService.TargetFacts:input_type -> connector.v1.TargetFactsRequest
|
||||
28, // 27: connector.v1.ConnectorService.LinkURL:input_type -> connector.v1.LinkURLRequest
|
||||
3, // 28: connector.v1.ConnectorService.Configure:output_type -> connector.v1.ConfigureResponse
|
||||
5, // 29: connector.v1.ConnectorService.Describe:output_type -> connector.v1.DescribeResponse
|
||||
14, // 30: connector.v1.ConnectorService.Parse:output_type -> connector.v1.ParseResponse
|
||||
17, // 31: connector.v1.ConnectorService.Resolve:output_type -> connector.v1.ResolveResponse
|
||||
19, // 32: connector.v1.ConnectorService.Invoke:output_type -> connector.v1.InvokeResponse
|
||||
21, // 33: connector.v1.ConnectorService.Lookup:output_type -> connector.v1.LookupResponse
|
||||
23, // 34: connector.v1.ConnectorService.Deliver:output_type -> connector.v1.DeliverResponse
|
||||
27, // 35: connector.v1.ConnectorService.Listen:output_type -> connector.v1.ListenResponse
|
||||
25, // 36: connector.v1.ConnectorService.TargetFacts:output_type -> connector.v1.TargetFactsResponse
|
||||
29, // 37: connector.v1.ConnectorService.LinkURL:output_type -> connector.v1.LinkURLResponse
|
||||
28, // [28:38] is the sub-list for method output_type
|
||||
18, // [18:28] is the sub-list for method input_type
|
||||
18, // [18:18] is the sub-list for extension type_name
|
||||
18, // [18:18] is the sub-list for extension extendee
|
||||
0, // [0:18] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_connector_v1_connector_proto_init() }
|
||||
@@ -1958,7 +2115,7 @@ func file_connector_v1_connector_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_connector_v1_connector_proto_rawDesc), len(file_connector_v1_connector_proto_rawDesc)),
|
||||
NumEnums: 2,
|
||||
NumMessages: 29,
|
||||
NumMessages: 31,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
||||
@@ -28,6 +28,7 @@ const (
|
||||
ConnectorService_Deliver_FullMethodName = "/connector.v1.ConnectorService/Deliver"
|
||||
ConnectorService_Listen_FullMethodName = "/connector.v1.ConnectorService/Listen"
|
||||
ConnectorService_TargetFacts_FullMethodName = "/connector.v1.ConnectorService/TargetFacts"
|
||||
ConnectorService_LinkURL_FullMethodName = "/connector.v1.ConnectorService/LinkURL"
|
||||
)
|
||||
|
||||
// ConnectorServiceClient is the client API for ConnectorService service.
|
||||
@@ -74,6 +75,12 @@ type ConnectorServiceClient interface {
|
||||
// host asks only connectors that declare target_facts, and never stores the
|
||||
// answer.
|
||||
TargetFacts(ctx context.Context, in *TargetFactsRequest, opts ...grpc.CallOption) (*TargetFactsResponse, error)
|
||||
// LinkURL returns the URL a person opens to send a link code to the
|
||||
// connector, such as a deep link into its bot. The host asks only
|
||||
// connectors that declare links_accounts. The connector then emits an
|
||||
// account.link event carrying the code and the sender's channel identity;
|
||||
// the host binds that identity to the account that issued the code.
|
||||
LinkURL(ctx context.Context, in *LinkURLRequest, opts ...grpc.CallOption) (*LinkURLResponse, error)
|
||||
}
|
||||
|
||||
type connectorServiceClient struct {
|
||||
@@ -183,6 +190,16 @@ func (c *connectorServiceClient) TargetFacts(ctx context.Context, in *TargetFact
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *connectorServiceClient) LinkURL(ctx context.Context, in *LinkURLRequest, opts ...grpc.CallOption) (*LinkURLResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(LinkURLResponse)
|
||||
err := c.cc.Invoke(ctx, ConnectorService_LinkURL_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ConnectorServiceServer is the server API for ConnectorService service.
|
||||
// All implementations must embed UnimplementedConnectorServiceServer
|
||||
// for forward compatibility.
|
||||
@@ -227,6 +244,12 @@ type ConnectorServiceServer interface {
|
||||
// host asks only connectors that declare target_facts, and never stores the
|
||||
// answer.
|
||||
TargetFacts(context.Context, *TargetFactsRequest) (*TargetFactsResponse, error)
|
||||
// LinkURL returns the URL a person opens to send a link code to the
|
||||
// connector, such as a deep link into its bot. The host asks only
|
||||
// connectors that declare links_accounts. The connector then emits an
|
||||
// account.link event carrying the code and the sender's channel identity;
|
||||
// the host binds that identity to the account that issued the code.
|
||||
LinkURL(context.Context, *LinkURLRequest) (*LinkURLResponse, error)
|
||||
mustEmbedUnimplementedConnectorServiceServer()
|
||||
}
|
||||
|
||||
@@ -264,6 +287,9 @@ func (UnimplementedConnectorServiceServer) Listen(*ListenRequest, grpc.ServerStr
|
||||
func (UnimplementedConnectorServiceServer) TargetFacts(context.Context, *TargetFactsRequest) (*TargetFactsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method TargetFacts not implemented")
|
||||
}
|
||||
func (UnimplementedConnectorServiceServer) LinkURL(context.Context, *LinkURLRequest) (*LinkURLResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method LinkURL not implemented")
|
||||
}
|
||||
func (UnimplementedConnectorServiceServer) mustEmbedUnimplementedConnectorServiceServer() {}
|
||||
func (UnimplementedConnectorServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
@@ -440,6 +466,24 @@ func _ConnectorService_TargetFacts_Handler(srv interface{}, ctx context.Context,
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ConnectorService_LinkURL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LinkURLRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ConnectorServiceServer).LinkURL(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ConnectorService_LinkURL_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ConnectorServiceServer).LinkURL(ctx, req.(*LinkURLRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ConnectorService_ServiceDesc is the grpc.ServiceDesc for ConnectorService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@@ -479,6 +523,10 @@ var ConnectorService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "TargetFacts",
|
||||
Handler: _ConnectorService_TargetFacts_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LinkURL",
|
||||
Handler: _ConnectorService_LinkURL_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -51,7 +51,7 @@ func (t *activityTracker) record(name string, at time.Time, actions []Action) {
|
||||
// A curator engine may not stamp its own actions (no clock
|
||||
// dependency wired in); the pass's own "at" is the authoritative
|
||||
// time for every action it produced, so backfill rather than let
|
||||
// a zero time.Time reach the wire as "105694 wks ago".
|
||||
// a zero timestamp reach the wire as "105694 wks ago".
|
||||
if action.At.IsZero() {
|
||||
action.At = at
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
@@ -46,7 +46,7 @@ const (
|
||||
// TimingCron fires at each cron match in the instance time zone.
|
||||
// Day-of-month and day-of-week are ANDed.
|
||||
TimingCron = "cron"
|
||||
// TimingOnce fires once at At.
|
||||
// TimingOnce fires once when the At time arrives.
|
||||
TimingOnce = "once"
|
||||
)
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ const cursorSeparator = "|"
|
||||
// and string comparison of two cursors is the total order (key, id).
|
||||
const cursorIDWidth = 20
|
||||
|
||||
// EventCursor returns the opaque resume cursor for an event that happened at
|
||||
// at with row id id. The cursor is a string so EventSource can carry it
|
||||
// EventCursor returns the opaque resume cursor for an event whose time is at
|
||||
// and whose row id is id. The cursor is a string so EventSource can carry it
|
||||
// verbatim in its id: field and echo it back as the Last-Event-ID header; it
|
||||
// is opaque to every consumer except EventsSince.
|
||||
func EventCursor(at time.Time, id int64) string {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -57,9 +57,9 @@ func NormalizeDays(days int) int {
|
||||
return days
|
||||
}
|
||||
|
||||
// ReportWindow is the UTC window a report of days days covers, ending at now:
|
||||
// whole days, today included. Rows are bucketed by UTC day, so the window
|
||||
// starts at a UTC midnight.
|
||||
// ReportWindow is the UTC window a report of the given number of days covers,
|
||||
// ending at now: whole days, today included. Rows are bucketed by UTC day, so
|
||||
// the window starts at a UTC midnight.
|
||||
func ReportWindow(days int, now time.Time) (from, to time.Time) {
|
||||
now = now.UTC()
|
||||
start := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.UTC)
|
||||
@@ -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
|
||||
|
||||
@@ -44,10 +44,10 @@ type StepStart struct {
|
||||
CalledExecutionID int64
|
||||
}
|
||||
|
||||
// StepFinish moves one step from From to its outcome. ExecutionID names the
|
||||
// run the step belongs to: the task-scoped grant check verifies it, and the
|
||||
// store verifies the step really is that execution's, so a caller cannot move
|
||||
// another run's step by naming it.
|
||||
// StepFinish moves one step out of the From status into its outcome.
|
||||
// ExecutionID names the run the step belongs to: the task-scoped grant check
|
||||
// verifies it, and the store verifies the step really is that execution's, so
|
||||
// a caller cannot move another run's step by naming it.
|
||||
type StepFinish struct {
|
||||
StepID int64
|
||||
ExecutionID int64
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -24,10 +24,11 @@ import (
|
||||
"github.com/samcharles93/archie-core/internal/tools"
|
||||
)
|
||||
|
||||
// Forger is the subset of forge.Forge that workflow stages call mid-run.
|
||||
// Production reaches it through forgerpc.Client, which proxies each call to the
|
||||
// daemon over NATS -- the worker holds no forge credentials, so the daemon stays
|
||||
// the only caller of forge.Forge. Test fakes implement it directly.
|
||||
// Forger is the subset of the Forge interface in the forge package that
|
||||
// workflow stages call mid-run. Production reaches it through forgerpc.Client,
|
||||
// which proxies each call to the daemon over NATS -- the worker holds no forge
|
||||
// credentials, so the daemon stays the only caller of that interface. Test
|
||||
// fakes implement it directly.
|
||||
type Forger interface {
|
||||
CloseIssue(ctx context.Context, owner, repo string, number int, comment string) error
|
||||
CreatePR(ctx context.Context, owner, repo, title, head, base, body string) (int, error)
|
||||
|
||||
@@ -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 {
|
||||
@@ -162,7 +162,8 @@ type Authorities interface {
|
||||
AcceptedAuthority(ctx context.Context, name string) (storepkg.Authority, error)
|
||||
}
|
||||
|
||||
// Server proxies forgerpc requests to a real forge.Forge implementation.
|
||||
// Server proxies forgerpc requests to a real implementation of the Forge
|
||||
// interface.
|
||||
type Server struct {
|
||||
Resolve func(context.Context, *workflow.Task) (forge.Forge, error)
|
||||
Runs Runs
|
||||
@@ -390,7 +391,7 @@ func (s *Server) respond(msg *nats.Msg, v any) {
|
||||
}
|
||||
|
||||
// Client calls the forgerpc Server from archie-agent's process. It
|
||||
// implements the four proxied forge.Forge methods with matching
|
||||
// implements the four proxied methods of the Forge interface with matching
|
||||
// signatures so it can be used as a drop-in for workflow stages.
|
||||
type Client struct {
|
||||
Conn *nats.Conn
|
||||
|
||||
@@ -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.
|
||||
@@ -115,10 +115,10 @@ type TurnRunnerConfig struct {
|
||||
// in prepareTurn. Nil disables the <memory> block entirely (renderMemory
|
||||
// treats a nil store the same as a failed read).
|
||||
MemoryEngine MemoryStore
|
||||
// MemoryWriter is the write surface the per-turn memory tool (slice 4)
|
||||
// uses to build memory_create/memory_update/memory_delete/memory_list.
|
||||
// Nil omits those tools entirely (MemoryTools treats a nil store the
|
||||
// same as a subject with no writable scope: no tools registered).
|
||||
// MemoryWriter is the write surface the per-turn memory tools use to
|
||||
// build memory_create/memory_update/memory_delete/memory_list. Nil omits
|
||||
// those tools entirely (MemoryTools treats a nil store the same as a
|
||||
// subject with no writable scope: no tools registered).
|
||||
MemoryWriter MemoryWriteStore
|
||||
// UserIdentity resolves the sending user's identity for an inbound message.
|
||||
// False or nil means no per-user memory scope.
|
||||
|
||||
@@ -22,9 +22,9 @@ const memoryRecordsPerScope = 20
|
||||
const memoryBlockByteCap = 8192
|
||||
|
||||
// MemoryStore is the read surface prepareTurn needs from a memory engine: a
|
||||
// scope-only Query, nothing else. Narrowed from domainmemory.Store (which
|
||||
// also carries the write operations slice 4 uses) so this package's read
|
||||
// path cannot accidentally reach for Create/Update/Forget.
|
||||
// scope-only Query, nothing else. It is narrowed from domainmemory.Store, which
|
||||
// also carries the write operations, so this package's read path cannot
|
||||
// accidentally reach for Create/Update/Forget.
|
||||
type MemoryStore interface {
|
||||
Query(ctx context.Context, q domainmemory.Query) ([]domainmemory.Record, error)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -91,7 +91,7 @@ func foldOverrides(cfg reflect.Value, doc map[string]any) (map[string]any, error
|
||||
}
|
||||
|
||||
// foldMapEntries returns one map field's override with each entry the overlay
|
||||
// names carried forward from the entry of the same key in cfg.
|
||||
// names carried forward from the cfg entry with the same key.
|
||||
func foldMapEntries(field reflect.Value, doc map[string]any) (map[string]any, error) {
|
||||
if field.IsNil() || field.Type().Key().Kind() != reflect.String {
|
||||
return doc, nil
|
||||
|
||||
@@ -255,7 +255,7 @@ func unregisteredServiceKeys(services config.Services) []string {
|
||||
|
||||
// sortedUnique returns keys sorted and de-duplicated, so Document.UnknownKeys
|
||||
// is deterministic across a base+overlay load that happens to name the same
|
||||
// stray key in both files.
|
||||
// stray key across both files.
|
||||
func sortedUnique(keys []string) []string {
|
||||
if len(keys) == 0 {
|
||||
return nil
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Edit sets one key in a TOML table. Table is a dotted path ("" for the
|
||||
// Edit sets one key within a TOML table. Table is a dotted path ("" for the
|
||||
// root). Value is a literal TOML value; see String and Ref.
|
||||
type Edit struct {
|
||||
Table string
|
||||
@@ -214,7 +214,7 @@ func (a *applier) uncommentKeys(table string, remaining map[string]bool) int {
|
||||
return headerLine
|
||||
}
|
||||
|
||||
// appendMissingKeys adds every key in remaining that no line in table
|
||||
// appendMissingKeys adds every key from remaining that no line in table
|
||||
// satisfied: after the table's last active line, after its header if it
|
||||
// only exists commented-out, or as a brand-new table block.
|
||||
func (a *applier) appendMissingKeys(table string, keys []string, remaining map[string]bool, headerLine int) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -47,9 +47,8 @@ func seedForgeConnections(cfg config.Config) any {
|
||||
return out
|
||||
}
|
||||
|
||||
// connectionDisplayName is the label an operator sees, so it names the thing
|
||||
// that tells one connection from another -- the host it points at -- rather
|
||||
// than the archie concept it was migrated from. The file never named the
|
||||
// connectionDisplayName is the label an operator sees: the host it points at,
|
||||
// because the host tells one connection from another. The file never named the
|
||||
// forge, so there is nothing better to carry over.
|
||||
func connectionDisplayName(cfg config.Forge) string {
|
||||
host := strings.TrimSpace(cfg.Host)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Package forgeext adapts a forge extension, served over the forge.v1 gRPC
|
||||
// surface, to the host's forge.Forge. One extension process serves one
|
||||
// surface, to the host's Forge interface. One extension process serves one
|
||||
// configured forge instance.
|
||||
package forgeext
|
||||
|
||||
|
||||
@@ -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"))
|
||||
|
||||
Loaded 100 of 674 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user