Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ACRE

Application Configuration for Research Enablement (ACRE) is ACORN’s versioned configuration format. It keeps application settings—such as data sources, model downloads, synchronization targets, runners, and deployment policy—separate from Research Activity Data (RAD). ACRE files can be reused by other research-enablement applications.

Use an ACRE file

Create .acorn.json, .acorn.jsonc, .acorn.yaml, .acorn.yml, or .acorn.ron in the project directory. ACORN checks those names in that order. New files should declare schema version 2.0.0:

schemaVersion: 2.0.0
models:
  - Qwen/Qwen2.5-0.5B-Instruct-GGUF
whitelist:
  models:
    - Qwen/Qwen2.5-0.5B-Instruct-GGUF

Use --config <FILE> when a command should load another filename. Validate and format ACRE independently of RAD:

acorn check .acorn.yaml
acorn format .acorn.yaml --standard acre --dry-run
acorn export --schema --standard acre

Canonical filenames are detected automatically by acorn check. For a custom filename or piped input, add --standard acre.

RON uses string-keyed maps and the same ACRE names and string enum values. For example, .acorn.ron may contain {"schemaVersion": "2.0.0", "models": ["acme/example"]}. Use --format ron --standard acre for piped input. RON formatting produces stable map order and removes comments; preview the exact rewrite with --dry-run.

Attributes

Every top-level attribute is optional. Unknown attributes and unsupported explicit schema versions are rejected.

AttributeDescription
schemaVersionSchema version. Use 2.0.0; omission resolves to 2.0.0.
authOrdered, non-secret Entra profiles and explicit SharePoint document source mappings. This schema is available before the auth CLI route is enabled.
bucketsResearch-activity collections to import or download, as source strings or detailed repository objects.
configllama-swap, OpenCode, VS Code, and Goose targets updated by acorn sync.
endpointsNamed HTTP API endpoints with authentication settings and templated resources.
modelsModel IDs, paths, URLs, or detailed download entries.
foldersShared destination registry. Each entry has id and accepts aliases, bucket, members, path, and variables.
membersGlobal submitter allowlist applying to every configured folder.
variablesDocument-scoped environment-variable references, including members and custom.
registriesNamed OCI or Harbor profiles used by model sources; credentials remain in environment variables.
runnersCI/CD runner definitions, including repository scope, executor, tags, and local or remote container host.
whitelistOptional bucket and model allowlists. An empty whitelist allows all items.
workflowDeployment allowlist for repository workflow paths, formats, actions, outputs, and external effects.
scriptManifestDeployment manifest filename or inline authorization policy for executable hooks.
scriptsOrdered Rhai script paths and their check, format, link, enrich, or validate hooks.
optionsCommand defaults, resolved from the CLI. options.scripts (enabled) governs both root scripts and root scriptManifest; options.folders.root sets the folder destination base.

The complete ACRE specification describes every object field and accepted shorthand. See CLI configuration for working examples, Model workflows for downloads, and Rhai exec for constrained script hooks.

Authorization profiles

The optional auth.profiles map keeps declaration order: its first entry is the default when a future auth command does not select a name. Each profile names a public Entra tenant and client UUID, a cloud, a default resource, and permitted HTTPS audiences with delegated scopes. flow defaults to browser; cache defaults to preferred. auth.sources binds an exact SharePoint document URL to one named profile and a resource, optionally narrowing its scopes. Unknown keys, missing references, scope widening, unsafe paths, and Graph audiences for the wrong cloud fail validation. The configuration contains no tokens, client secrets, or passwords.

See the SharePoint intake configuration contract for a complete synthetic example. The host auth and source resolver are feature gated; the auth login and SharePoint capture commands are separate implementation phases.

GitLab logbook inbox

Set options.powerAutomate.intake to enable JSONL polling when running acorn serve bot --config .acorn.yaml. Existing Power Automate callback, package, member, and protected-variable settings still apply:

options:
  powerAutomate:
    callback_destination: logbook-flow
    gitlab_project: "42"
    package: automated-artifacts
    intake:
      branch: main
      path: .acorn/intake/logbook.jsonl
      poll_interval: 30
      max_file: 10MB
      max_record: 64KB

Each LF-terminated line uses the existing form envelope. Its projectId selects a registered folder ID or alias. The bot authorizes and durably queues each entry before removing its exact line. Preserve the UUID and serialized bytes across retries; changes under an accepted UUID are conflicts. Admission fixes the canonical destination so configuration changes cannot redirect retries.

Rejected records remain in the inbox with inspectable outcomes in the durable operation store. Cleanup preserves unrelated bytes and concurrent appends, keeps an empty file after draining, and retries conflicts from a fresh snapshot. GitLab intake proposes changes through the existing review workflow.

Run one intake cycle from the native executable

Build the local MVP with cargo build --package acorn-cli --bin acorn; the executable is target/debug/acorn. Keep a persistent operation database for this operator and use an isolated GitLab pilot project or branch. The configured options.powerAutomate.gitlab_project must be numeric, options.powerAutomate.intake must identify the JSONL source, and each folder must resolve to a path in that GitLab project. tests/fixtures/automation/powerautomate/multi-config.json shows the two-folder mapping used by mocked integration checks; substitute the pilot project ID and actual GitLab routes for a live run.

export CI_SERVER_HOST=code.ornl.gov
export GITLAB_TOKEN='REPLACE_WITH_PROTECTED_TOKEN'
umask 077
mkdir -p .acorn
export ACORN_DATABASE_PATH="$PWD/.acorn/operator-operations.sqlite"
export POWER_AUTOMATE_INBOUND_SECRET='REPLACE_WITH_PROTECTED_SECRET'
export SUBMISSION_ID='REPLACE_WITH_SUBMISSION_UUID'
target/debug/acorn intake run --config .acorn.json
target/debug/acorn intake export --config .acorn.json --submission-id "$SUBMISSION_ID" --output change.diff

intake run polls one inbox snapshot and all available review-note event pages, then attempts up to 256 durable review operations. Its JSON output includes intake, note, and queue counts. Repeating it after an authorized /acorn graduate merge request note advances the same review workflow as the bot. Replays use the durable database and do not create a second operation. A rejected JSONL line remains in the inbox with its recorded reason. A worker or intake failure exits nonzero; inspect the operation database before retrying. The command starts no HTTP listener and sends no callbacks.

The GitLab review-note poller reads every project-events page in ascending order before queuing events. It stores the last fully queued event in the same operation database, so a restart resumes without dropping older pages or duplicating completed commands. GitLab accepts a date for its after filter; ACORN overlaps that date and rechecks events at the cursor timestamp so late events with the same timestamp are still found. Set --after to a UTC date or timestamp before the first bot boot to bound the initial scan when the project already has a long event history. /ready reports the local operation runtime; verify GitLab reads and callback delivery separately.

intake export reads the admitted route from that database and uses the open merge request’s computed base/head revisions. It verifies that GitLab’s current review branch head still matches the MR head and that the file contains the admitted entry, then writes a UTF-8 unified diff. A newly created MR may need another invocation after GitLab computes its diff. The adjacent change.diff.receipt.json records the submission ID, source digest, GitLab service and project, repository path, branch, MR IID, target branch, base/head revisions, and SHA-256 digest of the diff. The diff reflects the full selected project file change on that review branch. If that branch carries multiple submissions, the artifact includes all of them. Confirm the branch and receipt before using the artifact. The command does not edit a project file or publish a package.

After the callback flow has a protected POWER_AUTOMATE_CALLBACK_URL, deliver ready durable intents explicitly:

export POWER_AUTOMATE_CALLBACK_URL='https://REPLACE_WITH_PROTECTED_CALLBACK_URL'
target/debug/acorn intake deliver --config .acorn.json

The callback command attempts up to 256 ready intents. Its JSON summary contains counts only, including pending retries and terminal failures; retryable intents remain durable for later attempts. Keep the URL and shared secret in protected environment variables.

Every durable callback carries a webhook-id header containing its persisted callback key. Retrying an intent after a timeout or restarting ACORN with the same operation database preserves that ID and its payload. Different intents retain different IDs even when their JSON bodies match. The worker supplies the authoritative ID, replacing any resolver-provided webhook-id on unsigned delivery. Signed destinations continue to use that ID with Standard Webhooks signatures over the exact stored body. The ID identifies a delivery; it does not authenticate it.

The receiving flow must authenticate the request and atomically retain its ID and payload evidence before notification work. A repeated ID with the same payload resumes known pending work or returns the completed disposition; a reused ID with changed content is a conflict. Track Teams and email outcomes separately so a retry does not repeat a completed notification. If a send may have succeeded before a timeout or crash, reconcile that channel before sending again. Return 2xx after durable acceptance only when the receiver owns recovery of any remaining work. Sender retries and a delivery ledger alone cannot guarantee exactly one effect from a notification connector.

For a local PDF and manifest from a reviewed checkout, use an exact merged commit and an explicit cutoff; dry-run performs no package publication or callback:

export MERGED_SHA='REPLACE_WITH_MERGED_COMMIT_SHA'
target/debug/acorn report --dry-run --config .acorn.json --root . --commit "$MERGED_SHA" --through '2026-11-01T00:00:00Z' --project acorn --output .acorn/reports

Set CHROME_PATH or pass --chrome-path when ACORN cannot locate a Chromium-compatible browser for PDF rendering.

For an offline local proposal/apply smoke, copy tests/fixtures/automation/powerautomate/logbook.jsonl into a scratch directory and configure folder acorn with member scientist@example.org and a file: URI to a writable RAD index.json. Run intake stage, inspect .acorn/intake/proposals/<UUID>.json, then run intake apply as shown below. The repository’s focused local tests create this fixture from ResearchActivity::default() and cover replay and conflict behavior. Keep the local operator stopped when a Vergil bot consumes the same inbox and review branch with a different operation database.

Standalone local logbook review

For a registered folder with a file: destination and no bucket association, use a JSONL source:

The source can be a filesystem path, an absolute file: URI, or a GitLab /-/raw/<ref>/<path> or /-/blob/<ref>/<path> URL. GitLab files are captured at an immutable commit with a provenance receipt for subsequent offline review. See source syntax and credentials. Source selection does not change the folder destination or authorize remote writes.

acorn intake stage --config .acorn.json --source logbook.jsonl
# Review .acorn/intake/proposals/<submission-UUID>.json, then:
acorn intake apply --config .acorn.json --submission-id <submission-UUID>

Staging checks the same form and member rules and writes a proposal containing the exact source line, normalized entry, destination, base index digest, and proposed index content. It does not edit the inbox or index. Rejected lines are reported separately, so valid lines can still be staged. Applying one reviewed UUID rechecks the route and index digest; if the index changed, stage again. Repeated application is safe. Use one writer per index. The local adapter does not create GitLab merge requests or import bucket data; bucket association alone never registers a folder or starts a copy. GitLab and remote URI destinations use their own workflows.

For one reviewable batch spanning several existing local projects, run:

acorn intake stage --batch --config .acorn.json --source logbook.jsonl
acorn intake inspect --config .acorn.json --batch-id <batch-ID>
acorn intake apply --config .acorn.json --batch-id <batch-ID>
acorn intake inspect --config .acorn.json --batch-id <batch-ID>

The stage response contains the stable batch ID. inspect shows every line outcome, canonical route, proposed diff, and current project state. A rejected or conflicting line prevents the entire batch from being applied. Apply checks the original snapshot, configuration, routes, authorization, and all index bases before writing. Each project is replaced and receipted separately, so repeating apply resumes a partial result without duplicating entries. Keep the source bytes and receipt. If the source came from a GitLab inbox, stop its worker before local intake, reconcile the reviewed changes into the approved repository, and handle only the exact completed inbox lines before the worker resumes.