đșïž Overview
đ± ACORN1 is a Rust CLI and library for validating research activity data (RAD), adding linked-data context, and exporting records as PDF, PowerPoint, CFF, Markdown, JSON, YAML, or ZON. Its source records are portable files that can be version controlled and processed locally.
ACORN is context-aware at the data and workflow level. It keeps project descriptions with their identifiers, provenance, and relationships so people and software can interpret records in context. That awareness can unlock a fuller understanding of the work by making documented connections and gaps visible.
ACORNâs validation, formatting, linking, and export workflows are deterministic. Optional AI tooling can discover and download local GGUF models, configure them for OpenCode, VS Code, Goose, and llama-swap, and provide compatible agents with ACORN-specific operating instructions through acorn skill.
Note
AI assistance disclosure, Level 4. ACORN uses AI in accordance with
VisidataMachineAssistanceLevel::Significant: humans author most project code, while AI tools may directly create or edit auxiliary files such as documentation and tests. Humans retain review and decision authority. AI-assisted contributions at this level must identify the model and version used and the responsible human operator in the contribution metadata.

Choose your trail
Start with the outcome closest to your work:
| I am a⊠| Start here | You will learn to⊠|
|---|---|---|
| Researcher | Validate your first RAD | check, improve, link, and export a project record |
| Developer | Build with ACORN | use schemas, prompt and model APIs, agent skills, external Python bindings, and WebAssembly |
| Platform engineer | Operate ACORN | operate local models, agent tools, runners, and automation services |
Not sure yet? The role guide shows every trail at a glance.
Explore ACORN
Choose a route to explore its concepts and commands.
Research activity data
Explore: research activity data · check and format · linked data · shareable artifacts
Persistent identifier lifecycle
Explore the persistent identifier lifecycle â
Local AI and agent tooling
Explore: local models · application sync · agent skill · âŠbut is it agentic?
-
ACORN stands for âAccessible Content Optimization for Research Needsâ â©
Why ACORN?
ACORN helps researchers and communicators describe projects as analysis-ready research activity data. Its schemas record what the research does, how it works, and how it relates to people, organizations, publications, funding, and other projects.
The schemas use statically typed and dynamically validated data structures implemented in memory-safe Rust. Persistent identifiers1 connect records to established research systems and support open science practices.
The problem
Scientific work is often represented through publications, people, approvals, timelines, and budgets. Each source records part of a project:
- Publications2 omit projects that have not produced a paper and may not show how projects relate.
- People3 move between groups, change roles, and leave organizations.
- Approval and timeline systems may not integrate with other persistent identifiers or research systems.
- Budgets rarely contain enough scientific detail to explain the work.
Publication pressure can favor output quantity and discourage researchers from sharing negative results or data that does not support a hypothesis.4 When underlying data and code are unavailable, other researchers may be unable to reproduce otherwise useful results.5
Project-level records
ACORN uses the project as the primary research object. A project record links the people, publications, organizations, funding, approvals, data, code, methods, and results that other systems hold separately. ACORN supplements those systems by giving their records shared project context.
This context helps readers understand a projectâs purpose, evidence, participants, and outputs as parts of the same activity. It also makes relationships between projects easier to follow and gives people and software more evidence for finding gaps or conflicting information.
The resulting structure supports project-level search, reporting, gap analysis, and machine processing. The source record remains available as a portable file instead of depending on one hosted application.
Connecting the research ecosystem
ACORN provides paths between research records, people, organizations, and the infrastructure that processes their work. Portable records and shared identifiers carry project context across tools, services, and automated workflows.
Risks and durability
ACORN can store sensitive research data, so deployments must control access and follow the guidance in SECURITY.md. Continued development also depends on adoption, funding, and available maintainers.
The file-based design limits the effect of a discontinued service. Records remain readable files that can be versioned with their assets and validated against an open JSON Schema. Citation, PDF, and PowerPoint outputs can then be regenerated without an ACORN-hosted service.
Using ACORN
Researchers can submit project metadata through a form and generate fact sheets in PDF, web, or PowerPoint form. The resulting JSON file becomes the maintained source for each project.
When the schema changes, run acorn format to apply formatting and controlled-vocabulary migrations, then review the diff. acorn check reports incompatible data. Existing JSON remains readable as a flat file, and CI templates can pin an ACORN version so each bucket adopts updates explicitly. See ACORN schemas and CHANGELOG.md.
-
ACORN supports CURIEs and research activity identifiers (RAiDs). â©
-
D. R. Grimes, C. T. Bauch, and J. P. A. Ioannidis, âModelling science trustworthiness under publish or perish pressure,â Royal Society Open Science, vol. 5, no. 1, p. 171511, Jan. 2018, doi: 10.1098/rsos.171511. â©
-
M. Baker, â1,500 scientists lift the lid on reproducibility,â Nature, vol. 533, no. 7604, Art. no. 7604, May 2016, doi: 10.1038/533452a. â©
đ Getting started
Important
Local install is optional. If you only need automated validation or publishing, configure ACORN in CI with the example
.gitlab-ci.yml. The sections below are for running ACORN directly on your workstation or in a container.
Installation
If you are running ACORN locally, choose one method from the table below. For background on the concepts behind these workflows, see Concepts.
Choose an installation method
| User or environment | Recommended option | Best when⊠|
|---|---|---|
| CI pipeline | CI template | You only need automated validation or publishing; no local installation is required. |
| Windows workstation | Scoop | You want straightforward installation and upgrades. |
| macOS workstation | Homebrew | You want a managed installation; standalone macOS binaries are not available. |
| Linux workstation | AppImage, Debian package, Homebrew, or a pre-compiled binary | Use an AppImage without installation, a Debian package for system integration, Homebrew for managed upgrades, or the binary for minimal dependencies. |
| Rust developer | Cargo | Rust is already installed or you want a source-built executable. |
| Containerized environment | Docker or Podman | You want isolation, reproducibility, or a pinned ACORN version. |
| ACORN contributor | Install from source | You plan to modify, test, or debug ACORN itself. |
Install with Scoop (Windows only)
Use this if you are on Windows and want straightforward
scoop updateupgrades.
-
Ensure you have Scoop installed.
-
Open your terminal and add the extras bucket to Scoop
scoop bucket add extras -
Run the following command to install ACORN
scoop install acorn -
After installation, you can verify the installation by running:
acorn help -
You can keep ACORN up to date with Scoop by running:
scoop update acorn
Install with Homebrew (Linux and macOS)
Use this if you are on macOS or Linux and want a managed install via
brew.
-
Add the custom tap:
brew tap research-enablement/acorn https://code.ornl.gov/research-enablement/homebrew-acorn.git/ -
Trust the custom tap:
brew trust research-enablement/acorn -
Install ACORN:
brew install acorn-cli -
Verify installation:
acorn help -
Upgrade to the latest version:
brew update brew upgrade acorn-cli
Install with Cargo
Use this if you already have Rust and Cargo or want a source-built binary.
-
Ensure you have Rust and Cargo installed. If not, you can install them using rustup.rs.
-
Open your terminal and run the following command to install ACORN
cargo install --locked acorn-cli -
After installation, you can verify the installation by running:
acorn help
Run inside a container
Use this if you want isolation or a pinned version without a local install.
-
Ensure you have Docker1 installed.
-
Pull the latest ACORN image with Docker1
docker pull savannah.ornl.gov/research-enablement/acorn/runner -
Run ACORN using Docker1
docker run --rm savannah.ornl.gov/research-enablement/acorn/runner help
Tip
You will probably need to mount a volume to use ACORN with your local files. For example:
docker run --rm -v $(pwd):/data savannah.ornl.gov/research-enablement/acorn/runner:latest check /data/project
Run the AppImage (Linux)
Use this if you want one portable file with both the command-line and terminal interfaces.
-
Download the AppImage for your architecture from the ACORN GitLab Releases page:
- x86_64:
acorn-v<version>-x86_64.AppImage - ARM64:
acorn-v<version>-aarch64.AppImage
- x86_64:
-
Download its adjacent
.sha256file and verify it before running:sha256sum -c acorn-v<version>-<architecture>.AppImage.sha256 chmod +x acorn-v<version>-<architecture>.AppImage -
Launch without arguments to open the terminal interface, or pass any ordinary ACORN arguments:
./acorn-v<version>-<architecture>.AppImage ./acorn-v<version>-<architecture>.AppImage check /path/to/project
Install the Debian package (Linux)
Use this on Debian, Ubuntu, or a compatible distribution when you want
/usr/bin/acornmanaged by the system package database.
- Download the package and its
.sha256file from the ACORN GitLab Releases page:- amd64:
acorn_<version>-1_amd64.deb - ARM64:
acorn_<version>-1_arm64.deb
- amd64:
- Verify and install the local package:
sha256sum -c acorn_<version>-1_<architecture>.deb.sha256 sudo apt install ./acorn_<version>-1_<architecture>.deb acorn --version
The downloaded filename begins with acorn_; the package database records it as acorn-cli, and the installed command is acorn. These direct downloads do not configure an APT repository or automatic updates.
Debianâs unrelated node-acorn package installs a command with the same name. The ACORN package declares that conflict, so APT may remove node-acorn when installing acorn-cli.
Download pre-compiled binary
Use this if you want a single binary with minimal dependencies.
- Download the latest release from the ACORN GitLab Releases page
-
đȘ Windows
-
Open a PowerShell terminal, visit the releases page to find the latest version, and run:
irm -OutFile acorn.exe -Uri https://code.ornl.gov/api/v4/projects/16689/packages/generic/x86_64-pc-windows-gnu/v<version>/acorn.exe -
Test the downloaded executable:
.\acorn.exe help
-
-
đ§ Linux
-
Open a terminal, visit the releases page to find the latest version, and run:
curl -LO https://code.ornl.gov/api/v4/projects/16689/packages/generic/x86_64-unknown-linux-musl/v<version>/acorn -
Make the downloaded file executable:
chmod +x acorn -
Test the downloaded executable:
acorn help
-
-
đ macOS
-
Install from source
Use this if you are contributing to ACORN itself.
-
Clone the ACORN repository
git clone https://code.ornl.gov/research-enablement/acorn.git cd acorn -
Install
acorncommandcargo install --locked --path ./crates/acorn-cli -
After installation, you can verify the installation by running:
acorn help
-
These instructions will work with any OCI-compliant container runtime, such as Docker or Podman. â© â©2 â©3
Choose your path
ACORN spans research writing, data tooling, and platform operations. Pick a trail now; switch trails whenever your work changes.
| Trail | First win | Suggested route |
|---|---|---|
| Researcher | Turn one project record into checked, reusable artifacts | 5 stops |
| Developer | Use ACORNâs schemas and libraries in an application | 5 stops |
| Platform engineer | Run repeatable ACORN workflows across a team | 5 stops |
If you want to see ACORN work before choosing, take the 10-minute Quick Quest.
Next stop:Â Plant your first project in the Quick Quest.
Researcher trail
Goal: describe a project once, improve it safely, and create outputs for people and machines.
- Read why ACORN treats projects as first-class research objects.
- Complete the Quick Quest with a small research activity record.
- Learn what
checkevaluates and how to run it offline. - Follow the persistent identifier lifecycle to find and enrich project connections.
- Choose an
exporttarget such as CFF, PDF, Markdown, or PowerPoint.
Your finish line is a version-controlled RAD file that passes the checks you selected and produces at least one shareable artifact.
Next stop:Â Begin with the hands-on Quick Quest.
Developer trail
Goal: integrate ACORNâs data model, validation, and optional agent tooling into your own tool.
- Install ACORN and inspect
acorn help. - Learn the ACORN research activity model.
- Use the
acorn-libRust crate for native and agent-enabled applications, and extract ACORNâs operating instructions withacorn skill. - For Python workflows, follow the standalone
acorn-pyproject. - Review the WebAssembly-supported surface before targeting a browser or edge runtime.
When adding a CLI integration, prefer the generated CommandLineHelp.md in the repository as the exact option reference and the curated command pages for workflow guidance.
Next stop:Â Start building with the acorn-lib crate.
Platform engineer trail
Goal: make ACORN repeatable across repositories, services, and local inference tools.
- Define sources and defaults with ACORN configuration.
- Aggregate versioned buckets with
download. - Follow the model workflow from metadata import through weight selection.
- Route downloaded models to applications with
sync. - Use
servefor supported GitLab bot automation, the local Model Context Protocol (MCP)1 server, or authenticated JSON-RPC and gRPC endpoints. Distributeacorn skillfor compatible agents, and keepdoctornearby as the rescue guide.
For CI commands that support it, use global --offline mode when the job must be deterministic and ensure every required network-backed asset is cached or configured explicitly. Commands reject offline mode when they cannot honor that guarantee.
Next stop:Â Define the workflow in ACORN configuration.
-
Model Context Protocol, âArchitectureâ and âServer featuresâ. â©
Quick Quest: Validate your first RAD file
In about 10 minutes, you will take one research activity data (RAD) file through ACORNâs core loop:
đ„ Download the project
Download the quest fixture, or fetch it from the documentation repository with ACORN:
acorn download https://code.ornl.gov/research-enablement/acorn \
--filter '^docs/src/_assets/quick-quest/' \
--flatten \
--output acorn-quick-quest
cd acorn-quick-quest
Your tiny project contains one RAD record and its fact-sheet graphic:
quick-quest/
âââ index.json
âââ lazer-kitten.png

Key fields in the record look like this:
{
"meta": {
"id": "quick-quest",
"media": [{ "contentUrl": "lazer-kitten.png" }]
},
"title": "Lazer Kitten Research Lab",
"subtitle": "A tiny experiment in reusable research storytelling"
}
đ Check it
acorn --offline check index.json --skip prose
You should get a successful exit and no schema findings. ACORN may still offer a readability coaching note. --offline makes the lab deterministic; --skip prose avoids synchronizing the optional prose analyzer.
âš Preview, then format
acorn format index.json --dry-run
acorn format index.json
The first command shows a diff without writing. The second applies normalized formatting and controlled-vocabulary values. A second dry run should show no remaining changes.
đ€ Export shareable files
acorn --offline export index.json --format cff --skip prose
acorn --offline export index.json --format pdf --skip prose
Expected artifacts: CITATION.cff, beside index.json, and export/quick-quest.pdf. The PDF uses the downloaded lazer kitten graphic and the full project narrative. Both files come from the same source record, so you can update one file and reproduce every output.
đ Quest complete
You now have one human-maintainable source plus citation and PDF outputs.
Next stop:Â Explore the full Check, Format, and Export guides.
Concepts
These pages describe the data model and design ideas behind ACORN. Start with Why ACORN? for the problem the project addresses, then use this section as a reference for its schemas, standards and formats, identifiers, and technology classifications.
Research enablement
ACORN is managed by the Research Enablement Initiative (REI) at Oak Ridge National Laboratory (ORNL). REI aims to improve the way scientific research is conducted, shared, and evaluated. It is a team of developers, communication experts, and information scientists passionate about open science, transparency, and improving the researcher experience.
REI provides:
- A cross-domain model of research activity data (RAD)
- A Rust command-line application,
acorn-cli - Rust libraries for schemas and RAD workflows,
acorn-schemaandacorn-lib - An independently maintained Python package,
acorn-py - The ORNL research activity catalog, research.ornl.gov (currently in preview; contact REI for access)
Buckets
RAD lives in versioned folder collections called âbucketsâ. Each bucket contains a set of files and media assets that describe research activities. For multiple examples, see ORNLâs buckets.
The ACORN CLI combines buckets through a flat-file1 configuration file. This lets users aggregate multiple sources and generate reports from the combined data.
Buckets can be stored in a version-controlled GitLab or GitHub repository or on a local file system. They do not require a cloud provider.
Organizations can combine buckets across teams while retaining control over each repositoryâs access and permissions.
Tip
See the research enablement wiki for more information on buckets.
-
A flat-file is a simple text file that contains data in a structured format, such as JSON or YAML. Flat-files are easy to read and write, and can be used to store configuration data for applications. â©
ACORN Schemas and Ontologies
The research activity schema organizes identity, metadata, technology context, narrative sections, contact information, and extension notes into one portable record. Field names below follow the serialized JSON, YAML, and ZON form.
Context awareness
ACORNâs context awareness comes from explicit data. A research activity record places its narrative alongside project identity, persistent identifiers, people, organizations, technology, media, and relationships. Linked-data mappings and provenance show how that information connects and where it came from.
Commands use this context for different purposes. acorn check evaluates values against the appropriate schema and rules, acorn format normalizes controlled values, acorn link maps fields to defined ontologies, and acorn export carries the same project information into other formats. Optional model and agent workflows can receive the record, relevant evidence, and validation results as task context.
Draft authoring
RAD can begin as a draft and become stricter as it matures. Input may omit meta.archive and meta.draft; ACORN defaults them to false and true, respectively. Narrative sections may be omitted while draft is true, but a non-draft record must provide them.
List-shaped metadata is also permissive at the authoring boundary. keywords, technology, and every optional metadata vector accept either one item or an array. ACORN normalizes a single item to a one-item array. For optional vectors, an omitted or null value means absent, while [] remains explicitly empty. Canonical JSON, YAML, ZON, and Markdown output uses arrays; empty keywords and technology fields are omitted.
Context-aware operation does not mean that ACORN knows facts absent from its inputs or that it has consciousness. Missing or unsupported information remains missing until a person or a defined provider supplies it. This boundary lets context reveal documented connections and gaps without turning an inference into project data.
Note
See Standards, formats, and interoperability for the metadata models, ISO and RFC representations, field profiles, crosswalks, artifact formats, and protocol boundaries that ACORN implements. Persistent identifier lifecycle documents each local identifier check and resolver boundary.
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.
| Attribute | Description |
|---|---|
schemaVersion | Schema version. Use 2.0.0; omission resolves to 2.0.0. |
auth | Ordered, non-secret Entra profiles and explicit SharePoint document source mappings. This schema is available before the auth CLI route is enabled. |
buckets | Research-activity collections to import or download, as source strings or detailed repository objects. |
config | llama-swap, OpenCode, VS Code, and Goose targets updated by acorn sync. |
endpoints | Named HTTP API endpoints with authentication settings and templated resources. |
models | Model IDs, paths, URLs, or detailed download entries. |
folders | Shared destination registry. Each entry has id and accepts aliases, bucket, members, path, and variables. |
members | Global submitter allowlist applying to every configured folder. |
variables | Document-scoped environment-variable references, including members and custom. |
registries | Named OCI or Harbor profiles used by model sources; credentials remain in environment variables. |
runners | CI/CD runner definitions, including repository scope, executor, tags, and local or remote container host. |
whitelist | Optional bucket and model allowlists. An empty whitelist allows all items. |
workflow | Deployment allowlist for repository workflow paths, formats, actions, outputs, and external effects. |
scriptManifest | Deployment manifest filename or inline authorization policy for executable hooks. |
scripts | Ordered Rhai script paths and their check, format, link, enrich, or validate hooks. |
options | Command 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.
ASPECT
A Scientific Paradigm for the Efficient Classification of Technology
portability | autonomy | maturity | motivity
The ASPECT framework classifies technology across portability, maturity, autonomy, and motivity. It gives projects a shared vocabulary for describing capabilities and requirements.
The same classifications apply to automation, AI and machine learning, and classical software.
Tip
Components
Primary attributes
Expand an attribute to see its levels.
đŠ Portability
- Limited (level 0)
- Source (level 1)
- Containerized (level 2)
- Installer (level 3)
- Package manager (level 4)
- WebAssembly (level 5)
đȘŽ Maturity
- Unvalidated (level 0)
- Discovery (level 1)
- Concept (level 2)
- Development (level 3)
- Prototype (level 4)
- Proven (level 5)
đ€ Autonomy
- Manual (level 0)
- Machine-assisted (level 1)
- Human-as-primary (level 2)
- Machine-as-primary (level 3)
- Human-supervised (level 4)
- Machine-only (level 5)
đŠŸ Motivity
- Inert (level 0)
- Computational (level 1)
- Perceptive (level 2)
- Projective (level 3)
- Reactive (level 4)
- Adaptive (level 5)
Data
Data is recorded separately from the four primary attributes.
Its dimensions include:
- Real or synthetic
- Availability
- Modality
- Quality
Computation
Computations describe classical and quantum stages, their data interfaces, and the cost of running them on a specific environment.
Example
The following fictional project shows how four levels form one ASPECT classification.
| Attribute | Level | Details |
|---|---|---|
| đŠ Portability | Level 1 | Source |
| đȘŽ Maturity | Level 3 | Development |
| đ€ Autonomy | Level 1 | Machine-assisted |
| đŠŸ Motivity | Level 2 | Perceptive |
Badge visualization
An ASPECT badge gives project portfolios a compact view of the four attribute levels.
ASPECT badge for a project
The annotated version identifies the position of each attribute. The same badge can be used in dashboards, reports, and presentations.
Annotated ASPECT badge
đŠ Software Portability
Software portability describes how easily software can move across platforms and run in different environments with little or no modification. In ASPECT, this attribute helps measure whether software can work across different hardware, operating systems, and cloud setups.
Levels of Portability
Limited (Level 0)
Software at this level is tied to a specific environment. Running it elsewhere often requires major code or configuration changes. It may depend on platform-specific hardware, operating systems, or libraries that are hard to reproduce.
Source (Level 1)
Software at this level can be compiled and run on different platforms when the required compiler and build tools are available. In most cases, only minor changes are needed. Some platform-specific dependencies may still need attention during build or setup.
Containerized (Level 2)
Software at this level is packaged and run in containers such as Docker1, Podman2, or Apptainer3. Containers isolate dependencies and provide a consistent runtime. As a result, deployment and scaling are easier across local, on-premise, and cloud environments when a compatible container runtime is available.
Installable (Level 3)
Software at this level is designed to be installed and configured on multiple platforms, usually through installers or setup scripts. Some manual setup may still be required, but the process is generally user-friendly. Platform-specific installers or options are often provided to support different operating systems and hardware.
Automated Installation Available (Level 4)
Software at this level is distributed through one or more package managers such as npm4, Homebrew5, Scoop6, or the Ubuntu advanced package management tool7. It is typically published to package repositories so users can install and update it with standard tools. This approach improves deployment speed and ongoing maintenance across many environments.
WebAssembly8 (Level 5)
Software at this level is compiled to WebAssembly (WASM)9, which allows it to run in modern browsers and other environments that support a WebAssembly runtime. It can often run across desktop, mobile, and server targets without platform-specific changes. Because runtime support is broad and growing, WebAssembly is often treated as a leading portability target.
-
https://ubuntu.com/server/docs/how-to/software/package-management/ â©
-
https://webassembly.org/getting-started/developers-guide/ â©
đ€ Autonomy
In the context of ASPECT, âautonomyâ characterizes a technologyâs level of human-machine teaming (HMT) and describes the adaptive, bi-directional interaction among humans and machines that augments human capabilities for improved outcomes. This attribute builds on prior work by the Society of Automotive Engineersâ six levels of driving automation1 and expands on ISO definitions to partition technology into distinct and employable categories.
Tip
ISO 229892 defines human-machine teaming as âintegration of human interaction with machine intelligence capabilities.â
This attribute is important for understanding how well a technology can operate independently of human intervention, as well as the level of human oversight and control required for its operation. By categorizing technologies based on their autonomy, we can better understand their capabilities and limitations and make informed decisions about their use in various applications. The Visidata project popularized its own similar âlevel of machine assistanceâ characterizing LLM involvement in code changes3, and ASPECTâs autonomy attribute builds on this work to provide a more comprehensive framework for understanding the relationship between humans and machines in technology.
Tip
The
acorn-libcrate provides conversion utilities to seemlessly integrate Visidataâs AI collaboration levels into ASPECTâs autonomy attribute.
Levels
Manual (HMT 0)
This level is characterized by the execution of a script where the deterministic outcome is fully known and controlled by the human operator.
Machine-assisted (HMT 1)
In this level, the machine assists the human operator in executing a task. The human remains in full control of the task execution, with the machine offering support or suggestions as needed. This might include an iterative script that augments the input during each iteration based on prior outputs.
Human as primary (HMT 2)
Human directs execution while the machine proposes next steps and executes subtasks under continuous human approval. The human retains decision authority throughout.
Machine as primary (HMT 3)
Machine directs execution while the human intervenes on exceptions, policy checks, or contested steps. The machine carries the workflow.
Human supervisor (HMT 4)
Machine operates independently and the human monitors progress, sets bounds, and provides supervisory override. Human attention is on oversight rather than step execution.
Machine only (HMT 5)
Machine executes end-to-end with no human in the loop. All perception, decision, and action are machine-controlled within its authorized scope.
-
SAE J3016 Taxonomy and Definitions for Terms Related to Driving Automation Systems: https://www.sae.org/standards/j3016_202104-taxonomy-definitions-terms-related-driving-automation-systems-road-motor-vehicles â©
-
ISO/IEC 22989:2022 Information Technology â Artificial Intelligence Concepts and Terminology â©
-
Visidata AI Collaboration Levels: https://www.visidata.org/blog/2026/ai/ â©
đȘŽ Maturity
Discussion
ASPECT leverages a simplified mapping from augmented technology readiness levels (TRL). Wikipedia1 defines TRLs as âa method for estimating the maturity of technologies during the acquisition phase of a program. TRLs enable consistent and uniform discussions of technical maturity across different types of technology.â The U.S. federal acquisitions community widely uses TRLs to assess the maturity of a particular technology. ASPECT also incorporates work2 that adapted TRLs to directly address the particular nuances of machine learning systems. Moreover, ASPECT maturity levels work well with the capability maturity model but go beyond maintenance processes and efficiency to characterize a technologyâs maturity in practice. Specifically, ASPECTâs openness and portability attributes create a well-defined understanding of a given technology.
Maturity in ASPECT reflects the degree to which a system has been tested, validated, and proven in real-world scenarios, as well as its readiness for deployment and integration into existing workflows. In combination with the other ASPECT attributes, ASPECTâs maturity attribute provides a holistic view of the system under consideration, beyond a technologyâs age or quality.
Levels
| Maturity Level | TRL Mapping | Description |
|---|---|---|
| Unvalidated | N/A | Technology has not been assessed or lacks sufficient evidence of readiness. |
| Discovery | 0-1 | Early exploration and basic research to establish foundational principles. |
| Concept | 2-3 | Concept is defined and initial feasibility is demonstrated. |
| Development | 4-5 | Technology is built and validated through low- to high-fidelity development. |
| Prototype | 6-8 | Working prototype is demonstrated in a relevant environment through operational integration. |
| Proven | 9 | System is proven through successful real-world operation. |
Tip
-
Technology Readiness Level: https://en.wikipedia.org/wiki/Technology_readiness_level
â© -
A. Lavin et al., âTechnology readiness levels for machine learning systems,â Nat Commun, vol. 13, no. 1, p. 6039, Oct. 2022, doi: 10.1038/s41467-022-33128-9. â©
Motivity
Motivity classifies how a technology receives information from its environment, acts on that environment, and retains state. It uses three primitives: perception for input, projection for output, and comprehension for internal state and computation.
This attribute is related to autonomy, but the two measure different properties. Motivity describes a systemâs interaction and state. Autonomy describes how humans and machines divide responsibility.
Note
âMotivityâ is uncommon in software classification. ASPECT uses it for a systemâs capacity to produce change through input, output, and internal state.
Levels
Motivity has six ordinal levels ordered by interaction complexity. Perception is one-way input, projection is one-way output, and comprehension is internal state and computation.
Note
Throughout this document, âcomprehensionâ refers to a technologyâs ability to receive, store, and act on data. It does not imply general intelligence, consciousness, or AGI. A hash function, a state machine, and a lookup table exhibit comprehension in this limited sense because they maintain internal state that affects their behavior.
Stateless means no memory between interactions; stateful means the technology retains internal state that influences future behavior.
| Level | Name | Perception | Projection | Comprehension | Stateless/Stateful | Examples |
|---|---|---|---|---|---|---|
| 0 | Inert | â | â | â | None | A hammer or simple pulley system |
| 1 | Computational | â | â | â | Stateful (internal) | Digital model1, simulation |
| 2 | Perceptive | â | â | â | Stateless | Data shadow1, sensor log |
| 3 | Projective | â | â | â | Stateless | Cron job that emails status |
| 4 | Reactive | â | â | â | Stateless | Smart light switch, relay |
| 5 | Adaptive | â | â | â | Stateful | Digital twin1, autonomous agent |
Inert (level 0)
Technology at this level has no computational capability and no interaction with the environment. It is purely passive. Examples include a hammer, a simple pulley system, or any purely physical tool with no embedded intelligence.
Computational (level 1)
Technology at this level performs self-contained computation but has no input from or output to the environment. Comprehension (internal processing) is present, but neither perception nor projection are. Examples include a digital model or simulation that runs in isolation.
Perceptive (level 2)
Technology at this level receives input from the environment (one-way input binding) but produces no output and has no internal comprehension. The technology observes but does not process or act. Examples include a data shadow or a sensor that logs readings to storage without analyzing them.
Projective (level 3)
Technology at this level produces output to the environment (one-way output binding) but receives no input and has no internal comprehension. A cron job that emails a status report projects information without sensing or reasoning about its environment.
Reactive (level 4)
Technology at this level has two-way binding with the environment (perception and projection) but is stateless. It responds to input without an internal model or memory of past interactions. Examples include a smart light switch that turns lights on when motion is detected and a relay that closes a circuit when a threshold is crossed.
Adaptive (level 5)
Technology at this level has full two-way binding (perception and projection) with internal comprehension. It maintains state, builds an internal model of its environment, and changes its behavior based on accumulated experience. Examples include a digital twin that continuously synchronizes with a physical system and predicts future states and an autonomous agent that plans and adapts.
-
Y. K. Liu, S. K. Ong, and A. Y. C. Nee, âState-of-the-art survey on digital twin implementations,â Adv. Manuf., vol. 10, no. 1, pp. 1-23, Mar. 2022, doi: 10.1007/s40436-021-00375-w. â© â©2 â©3
đŸ Data
Discussion
When discussing data, we can evaluate four core aspects:
- Origin â Where does the data come from, and how was it produced?
- Availability â How accessible is the data to intended users and systems?
- Modality â What forms of information does the data contain?
- Quality â How well does the data support its intended use?
Attributes
Origin
Data origin describes whether the data is collected from real-world observations (real) or generated synthetically (synthetic). Real data is often considered more valuable for certain applications, such as training machine learning models, because it captures the complexity and variability of the real world. However, synthetic data can be useful for testing, simulation, and augmenting real datasets, especially when real data is scarce or sensitive.
NVIDIA Omniverse Replicator1 is an example of a tool that can generate synthetic data, particularly in the context of computer vision and robotics. By creating realistic virtual environments and scenarios, it allows researchers to generate large amounts of labeled data without costly and time-consuming real-world data collection.
Availability
Availability describes the extent to which data can be accessed and used. It is strongly related to âopennessâ and the âpresumed open principleâ for data.
While openness is characterized as open, public, shared, or closed, ASPECT data availability takes a more direct approach to describing the actual availability of data, which may be âopenâ but still unavailable due to other factors (e.g., technical or legal barriers).
Modality
Data modality describes the type or format of data, which can include:
- đ Text â Unstructured or structured textual data, such as documents, articles, or social media posts
- đ” Audio â Sound recordings, such as music, speech, or environmental sounds
- đŒïž Image â Visual data, such as photographs or scanned images
- đŹ Video â Moving image data, such as movies or surveillance footage
- đ Signal â Time-series data, such as sensor readings or financial market data
- đžïž Graph â Structured data representing relationships between entities, such as social networks or knowledge graphs
Multi-modal data combines multiple modalities, such as video with audio or text with images, to provide richer context and insights. In the context of ASPECT, data modality is a list, and multi-modal data can be described by including multiple modalities in the list (e.g., [âtextâ, âimageâ] for research activity data that relies on both textual and visual data).
Quality
Data quality leverages a precious metals metaphor to describe data quality.
Data quality describes the level of processing and readiness of the data for analysis and use. The levels were developed with inspiration from data readiness levels 2 and analysis-ready data3. For example, the transition from gold to platinum maps nearly directly to a transition from band B to band A in the data readiness levels. The key difference is ASPECTâs quality levels are more intuitive and directly actionable for researchers working with data in the context of research activities. See the geospatial data section below for an example of how data processing levels relates to data quality.
đ Geospatial Data
Geospatial data describes features and events tied to location. Common formats include raster data, such as satellite imagery, and vector data, such as points, lines, and polygons. These datasets support mapping, navigation, and spatial analysis. For geospatial work, data processing level is an important additional quality dimension.
For many electro-optical imagery collections, NASAâs Data Processing Levels4 define the following processing levels. SAR and other modalities use different level schemes, and not all providers adhere to NASA levels; NASA and several commercial providers publish similar level metadata.
- Level 0 â Raw
- Level 1A â Annotated
- Level 1B â Processed Annotated
- Level 1C â Spectral Variables
- Level 2 â Derived Geophysical
- Level 2A â Derived Surface
- Level 2B â Processed Derived Surface
- Level 3 â Gridded
- Level 3A â Periodic Summaries
- Level 4 â Model Output
Many remote sensing sources provide metadata that may include the data processing level, depending on the provider. Processing the geospatial data with techniques such as atmospheric correction, pansharpening, and orthorectification can change the usability of the data for various applications, thereby changing its associated processing level. For example, orthorectification corrects for terrain-induced distortions, improving the spatial accuracy of the data and changing its processing level from Level 1B to Level 2B.
Geospatial data processing level relates to ASPECTâs data quality attribute, but higher levels do not automatically mean higher quality. Level 1B data (closer to raw) preserves measured values more faithfully, while Level 2B data trades some fidelity for usability through additional processing. Which is âhigher qualityâ depends on use case â analysis-ready workflows may prefer Level 2B, calibration work may prefer Level 1B. The specific quality designation (e.g., gold, silver) would depend on additional factors such as the use case and the presence of any remaining artifacts or limitations in the data. For example, orthorectification might be the difference between silver and gold quality data for AI/ML applications.
-
NVIDIA Omniverse Replicator: https://docs.omniverse.nvidia.com/extensions/latest/ext_replicator.html â©
-
Data Readiness Levels: https://arxiv.org/abs/1705.02245 â©
-
Analysis Ready Data (ARD): https://ieeexplore.ieee.org/document/8899846 â©
-
NASA Data Processing Levels: https://www.earthdata.nasa.gov/learn/earth-observation-data-basics/data-processing-levels â©
Computation
aspect.computation records one or more computations performed by a research activity. Each computation contains stages in dependency order. A stage is classical or uses a specified quantum execution model, and its input and output ports reuse the existing ASPECT Data description. Algorithm complexity describes the work independently of any machine. Its bounds contain a time expression, a space expression, or both; variables defines the names used in those expressions. The optional case (worst, average, amortized, or best) applies to all bounds in that entry.
For example, "complexity": {"case": "worst", "bounds": [{"time": "O(n log n)"}, {"space": "O(n)"}], "variables": {"n": "number of records"}} declares worst-case time and space bounds for one stage. Each resource can appear once.
Validation accepts uppercase O(...) notation with positive integer constants, ASCII identifiers, addition, explicit or adjacent multiplication, division, grouping, positive integer or rational powers, named-difference powers, log with an optional named base, polylog, and W_out. Exponentiation binds before multiplication and division, which bind before addition. The shorthand log n accepts one identifier; use log(n^2) or (log n)^2 when an exponent is intended. Each expression is limited to 256 ASCII bytes. If variables is present, every identifier in a bound must be a key in that map; unused keys are allowed. Omitting variables leaves identifiers unconstrained. Invalid notation, undefined identifiers, empty expressions, and repeated resources are reported at bounds[index] with the respective syntax, reference, nonempty, or duplicate validation code.
For example, "complexity": {"bounds": {"time": "O(n / m)"}, "variables": {"n": "records", "m": "batches"}} is valid notation. O(n - m) is rejected because subtraction is outside the notation grammar. "complexity": {"bounds": {"time": "O(n)"}, "variables": {"m": "number of batches"}} is rejected because the supplied map does not define n.
This validation establishes that the notation is well formed and that declared variable names agree. It does not prove the mathematical bound or infer complexity from execution measurements.
An execution profile connects a computation to an environment in meta.infrastructure. Each stage execution names a platform in that environment. Profiles can record workload variable values, operation duration, repetitions, and an observed end-to-end duration. A compiled circuitâs physical depth belongs in its stage execution; a circuit stageâs logical depth belongs in the computation definition.
Compute impedance is the elapsed overhead around the operations. Profile costs describe input and output transfer, compilation, queueing, setup, state preparation, synchronization, readout, and postprocessing. Each cost says whether it was measured or estimated and whether it applies to the whole workload, a batch, an invocation, or a repetition. A transfer cost can name its stage and input or output port, and include volume in bytes, effective bandwidth in bytes per second, and latency in milliseconds. Unknown values are omitted, not interpreted as zero.
The observed end-to-end duration is recorded independently because stages and transfers can overlap. A one-second operation with a sixty-second upload can therefore have a sixty-one-second observed duration. acorn-schema stores the observations; any prediction or bottleneck calculation belongs in acorn-lib.
Quantum hardware in hardware::Resource::Quantum describes the processorâs model, physical technology, connectivity, physical and logical qubit capacities, and fault tolerance. A quantum stage describes the algorithm and its circuit, annealing, analog, or measurement-based requirements. standard::ocp continues to describe authoritative OCP records associated with infrastructure rather than the computation itself.
Standards, formats, and interoperability
ACORN reads several metadata models and produces research records, linked data, archives, documents, and service messages. Support is specific to the part of a standard that ACORN uses. A successful local check does not certify an implementation, confirm that an identifier exists in a registry, or prove that a repository will accept a deposit.
How to read this page
The terms below describe separate capabilities.
| Term | Meaning in ACORN |
|---|---|
| Parse | Decode a supported representation into ACORNâs typed model. |
| Validate | Check modeled structure, field values, and cross-field rules without contacting an external certification authority. |
| Format | Parse and serialize a file canonically. Formatting performs additional value normalization only where this page says so. |
| Crosswalk | Map the fields for which ACORN defines a relationship between two metadata models. Warnings identify known losses. |
| Generate | Produce an artifact, schema, or protocol message in a supported representation. |
| Resolve | Contact an external registry or provider. Resolution is separate from local syntax validation and respects offline mode. |
Versions appear where ACORN pins one. An unversioned name describes the implemented compatibility surface, not every version or extension of that format.
Metadata models
acorn check runs schema and semantic validation for the implemented models below. acorn format supports a smaller set. For CFF, DataCite, Dublin Core, and InvenioRDM, formatting means parse and canonical reserialization. RAD formatting also normalizes controlled values and contact data, while ACRE formatting preserves comments and property order where its format permits.
| Model or profile | Accepted representations | check | format | Interchange and generation |
|---|---|---|---|---|
| Research Activity Data (RAD) | JSON, JSONC, YAML, ZON, and ACORN Markdown; JSON Lines for batches | Structure, modeled fields, cross-field rules, quality, links, prose, and optional FAIR evidence | Canonical serialization plus controlled vocabulary, organization, affiliation, telephone, and contextual media normalization | RAD to DataCite, Dublin Core, RAiD, CFF, JSON-LD, and document or archive exports; RAiD and Dublin Core to RAD with explicit local context |
| Application Configuration for Research Enablement (ACRE) 2.0.0 | JSON, JSONC, YAML, and RON | Schema validation | Two-space layout, LF line endings, and final newline; JSONC/YAML comments are retained, while RON maps are canonically ordered and comments are removed | JSON Schema generation |
| Citation File Format 1.2.0 | CITATION.cff, YAML, and JSON | Structure, dates, identifiers, nested authors and references, prose, and links | Canonical serialization | Generated from RAD as CITATION.cff; no general CFF crosswalk target |
| DataCite Metadata Schema 4.7 | JSON and YAML | Modeled structure, required fields, present recommended metadata, controlled values, identifiers, dates, rights, and relations | Canonical serialization | Direct conversion to DCAT, Dublin Core, InvenioRDM, and HuWise; conversion from those models; RAD to DataCite |
| CKAN package and Action API | JSON and YAML for direct checks; JSON, JSON Lines, YAML, and ZON in crosswalk batches | Modeled package, resource, organization, tag, temporal, and spatial fields | No | CKAN package to DCAT Dataset only |
| Data Catalog Vocabulary 3 | JSON and YAML | Modeled Dataset, Distribution, DataService, checksum, temporal, spatial, identifier, and relation fields | No | Direct conversion to DataCite; conversion to InvenioRDM and HuWise through DataCite |
| HuWise dataset metadata | JSON and YAML | Modeled dataset, contributor, funding, resource, rights, date, identifier, and relation fields | No | Direct conversion to DataCite; conversion to DCAT and InvenioRDM through DataCite |
| InvenioRDM record metadata | JSON and YAML | Modeled record, creators, contributors, funding, rights, dates, identifiers, and CodeMeta fields | Canonical serialization | Direct conversion to DataCite; conversion to DCAT and HuWise through DataCite |
| RAiD metadata, governed by ISO 23527:2022 | JSON, JSONC, and YAML | Modeled RAiD metadata, identifiers, dates, roles, organizations, subjects, and related objects | No | RAD to RAiD and RAiD to RAD |
| KitOps Kitfile and resolved ModelKit configuration | Authoring YAML and resolved JSON | Structure, manifest compatibility, paths, layer identities, digests, local package readiness, and referenced MCP Bundles | No general metadata formatting | Kitfile resolution and OCI ModelKit packaging |
| OCI model artifact profile | Remote oci:// references | Registry descriptor, index or manifest, configuration blob, package convention, and declared model inventory | No | Manifest-level inspection of annotated GGUF artifacts, KitOps ModelKits, and CNCF ModelPacks |
| Dublin Core | Native tagged JSON and YAML, JSON-LD, RDF/XML, and Turtle | Graph structure, DCMI syntax encodings, quality guidance, FAIR evidence, links, prose, and readability | Deterministic graph serialization with canonical blank-node labels | Bidirectional DataCite, DCAT, InvenioRDM, and HuWise conversion; RAD export and explicit-context RAD import; JSON Schema generation |
Document and text selectors are analysis sources. They let check extract or analyze prose, but they are not metadata models.
Schema generation
acorn export --schema --standard <STANDARD> prints deterministic JSON Schema as JSON by default or YAML with --format yaml for ACRE, RAD/RADS, CFF, CKAN, DataCite, DCAT, Dublin Core, HuWise, InvenioRDM, RAiD, Kitfile, ModelKit, document, and text models. OCI checking has no single generated schema because it spans a registry reference, distribution responses, manifests or indexes, and configuration blobs.
Validation levels
ACORN keeps three questions separate:
- Is the record valid for its own typed model?
- Does a RAD contain the fields needed for the supported RAD to RAiD mapping?
- Is a DataCite record deposit-ready under ACORNâs required-property checks?
DataCite recommended and optional properties are validated when present. Their absence does not fail ordinary model validation. Crosswalk output should be checked against its target model before deposit or publication.
Crosswalk boundaries
The structured crosswalk command accepts JSON, JSON Lines, YAML, and ZON. Dublin Core also accepts JSON-LD, RDF/XML, and Turtle. Its supported paths are:
Each arrow is a direct mapping. A user-facing conversion may follow more than one arrow; RAD to Dublin Core and conversions among DCAT, Dublin Core, InvenioRDM, and HuWise use DataCite as the shared intermediate model.
- RAD to DataCite or RAiD directly, and to Dublin Core through DataCite; RAiD and Dublin Core to RAD require explicit local context.
- CKAN to DCAT.
- DataCite directly to DCAT, Dublin Core, InvenioRDM, or HuWise.
- DCAT, Dublin Core, InvenioRDM, and HuWise directly to DataCite. Conversions among those four models use DataCite as the intermediate representation where no direct field adapter exists.
--strict rejects output when the conversion reports a warning. Dublin Core to RAD requires --crosswalk-contact and --local-identifier; ACORN does not create placeholder local identity data. Warning coverage is strongest for direct conversions, and loss reporting for routes through DataCite remains incomplete. CKAN conversion produces ACORNâs flexible DCAT Dataset representation. It does not produce a DCAT Catalog or CatalogRecord and does not claim DCAT-US conformance.
Field-level standards and profiles
Metadata models share validators from acorn-schema. Each schema chooses which rule applies to a field, so a rule listed here is not automatically applied to every string with a similar name.
ISO and RFC representations
| Standard | ACORN enforcement |
|---|---|
| ISO 8601 | Calendar dates use YYYY-MM-DD. The reusable modern-date rule accepts years 1950 through 2029 and checks the supported month and day ranges. Year-only fields use four digits and, when a host clock is available, reject future years. ACORN does not implement the full set of ISO 8601 intervals, durations, reduced precision, or recurring dates. |
| RFC 3339 | Timestamp fields require a complete date and time with Z or a numeric UTC offset. Timestamp formatting normalizes accepted values to microsecond precision. |
| ISO 3166-1 | Country fields that use the shared country rule must match an embedded alpha-2 code, case-insensitively. |
| ISO 639:2023 | DataCite and DCAT language fields use the alpha-2 codes historically published as ISO 639-1. InvenioRDMâs general language-code rule accepts embedded alpha-2 or alpha-3 codes. Region subtags are outside these rules. |
| ISO 2108:2017 | ISBN fields use ACORNâs ISBN-13 parser and check digit validation. ISBN-10 is not accepted. |
| ISO/IEC 7064:2003 | ISNI and ORCID use MOD 11-2 checksums. ROR uses its defined MOD 97-10 and Crockford Base32 representation. |
| ISO 23527:2022 | RAiD metadata and identifiers use the modeled RAiD representation. Local validation checks the identifier form and metadata rules; it does not query the RAiD service. |
| ISO/IEC 18670:2025 | SWHIDs use the canonical v1.2 identifier model supported by ACORN. Resolution is a separate network operation. |
| RFC 6902 | acorn-diff exposes all six JSON Patch operation shapes. Generated patches use deterministic key ordering and the add, remove, and replace subset. |
| RFC 8493 | BagIt import, download, and export validate the declaration, safe payload paths, complete manifests, and SHA-256 or SHA-512 checksums before publishing payload data. |
The year and date rules are intentionally different. A standalone year may represent older material, while the shared calendar-date rule is a narrower modern-date profile. Individual metadata models may add stricter range or chronology checks.
Persistent identifiers
ACORN has local parsers for ARK, arXiv, DOI, Handle, ISBN, ISNI, ORCID, RAiD, ROR, RRID, SWHID, United States patent identifiers, and HTTP(S) URLs. Structured person and organization identifiers also check that known scheme names, scheme URIs, and identifier values agree.
These checks establish syntax, normalization, checksum, or scheme coherence. They do not establish ownership, registry status, publication status, or a relationship to the research activity. See Persistent identifier lifecycle for each parser, canonical form, and resolver boundary.
Other scalar profiles
Typed models also enforce required values, collection cardinality, string length, numeric range, nested validation, and whole-record conditions. Public metadata structs generally reject unknown fields where the external model has a closed shape. Open extension points retain their documented additional values.
| Field family | Enforced profile |
|---|---|
| URI and URL | General URI fields require parseable absolute references where their schema permits them. The stricter uri rule requires HTTP or HTTPS with a nonempty authority. This is the ACORN field profile, not a claim that every RFC 3986 production is accepted everywhere. |
| The local part is nonempty, contains the supported ASCII character set, and is at most 64 characters. Domains use valid labels, IDNA conversion, or an IP literal. This is not a complete implementation of RFC 5322 or RFC 6531. | |
| Telephone | The parser rejects known placeholder values and accepts ACORNâs supported North American or international shape. Formatting emits the canonical dotted form where applicable. |
| UUID | UUID fields require the 36-character hyphenated shape. ACORN does not use this rule to certify every RFC 9562 version and variant bit. |
| Semantic Versioning | Version fields use the supported major.minor.patch shape. A leading v is accepted only in models that explicitly define it, such as Kitfileâs manifestVersion. |
| SPDX licenses | Fields documented as SPDX license identifiers currently require a nonempty value. ACORN can download SPDX license data for enrichment, but the shared schema rule does not prove list membership. |
| Media type and file format | Some schemas use controlled enums; other fields preserve nonempty media types, extensions, or format labels supplied by the source. A valueâs presence does not prove that its payload matches the declared media type. |
| Geospatial data | Latitude and longitude use numeric bounds. Polygon values must contain coordinate pairs and close the first and final point. These checks do not perform coordinate reference system transformation. |
| Source revisions and digests | Commit values contain 7 through 64 hexadecimal characters. Portable digest fields require a lowercase sha256: value with 64 hexadecimal characters; artifact workflows also compare declared sizes and digests with transferred bytes. |
| Network addresses | IPv4 and IPv6 fields use parsed address values. Email domain literals use the same address parsers. ACORN does not apply these parsers to ordinary host names. |
| Names and embedded values | Selected fields enforce camelCase, kebab-case, snake_case, numeric text, JSON syntax, ZON-safe text, or a restricted stable-identifier character set. These are field-specific application rules. |
| Regions and postal codes | The shared state or province rule accepts two ASCII letters. Postal codes accept a non-negative integer or up to 20 letters, digits, spaces, and hyphens. Neither rule verifies the value against a postal authority. |
| Image paths | Image fields that use the shared extension rule accept PNG, JPEG, GIF, WebP, TIFF, or SVG extensions. The extension check does not decode the file. |
Vocabularies and linked data
RAD formatting resolves known keywords, technologies, sponsors, partners, organizations, and affiliations against ACORNâs configured or embedded vocabularies. Metadata models also contain controlled enums for roles, resource types, date types, relation types, title types, and similar standard-specific values.
acorn link writes JSON-LD context for RAD using terms from Schema.org, Dublin Core Terms, CodeMeta, DCAT, FOAF, BIBO, PROV-O, SKOS, and SPDX where the schema defines a mapping. A mapped term records the intended vocabulary relationship. It does not assert that every RAD record is a complete RDF graph for each vocabulary.
Contributor roles can use the CRediT taxonomy. Infrastructure metadata can record a referenced standard, its authority and version, the asserted relationship, and whether the claim is declared, inferred, or verified. Verified claims require evidence. OCP contribution, recognition, and management-profile records preserve authority data and test evidence; ACORN does not infer recognition or grant conformance.
Product-wide formats and protocols
The metadata layer sits inside a wider set of interoperability boundaries.
Serialization, documents, and archives
| Format | ACORN use and enforcement |
|---|---|
| JSON and JSONC | Metadata, configuration, API, manifest, and linked-data representations. Typed readers reject malformed input and, for models that deny unknown fields, unknown properties. ACREâs JSONC formatter preserves comments and property order. |
| YAML | Metadata, ACRE configuration, CFF, and Kitfile authoring. Typed readers apply the selected schema after parsing. |
| RON | ACRE configuration only. String-keyed maps preserve ACRE field names and string enum values; canonical formatting removes comments. |
| JSON Lines | Batch RAD and crosswalk records. Each nonblank physical line must contain one complete JSON value; blank or malformed records fail with a record location. |
| JSON-LD 1.1 | Generated linked RAD with defined context mappings, plus Dublin Core expanded or inline-context graphs. Dublin Core decoding rejects remote contexts and does not fetch vocabulary data. |
| RDF 1.1 XML Syntax and Turtle | Dublin Core default-graph input and output. ACORN rejects named graphs, RDF-star, and relative IRIs, and canonicalizes blank nodes before semantic comparison. |
| JSON Schema | Generated from ACORNâs typed models for inspection and integration. The generated schema complements runtime semantic validation; it does not encode every cross-field or external check. |
| ZON | ACORNâs deterministic, strict representation of the JSON data model. ZON is an ACORN profile, not an ISO or RFC standard. |
| Markdown | RAD authoring and export, prompt and skill content, and extracted document text. RAD Markdown requires ACORNâs frontmatter discriminator or a recognized legacy representation. |
| PDF and OOXML | PDF, DOCX, and PPTX are read or generated by specific document workflows. ACORN validates the data and the parts it consumes or creates, but does not certify general PDF, WordprocessingML, or PresentationML conformance. |
| 7z, ZIP, TAR, and TAR.GZ | Containers for BagIt and other bounded workflows. Container parsing is separate from BagIt payload and checksum verification. |
Research and model artifacts
| Format or specification | ACORN use and enforcement |
|---|---|
| OCI Image Specification and Distribution Specification | Model checks and downloads parse schema version 2 manifests and indexes, validate media types, descriptor sizes, SHA-256 digests, and safe layer paths, then use ORAS with OCI Distribution-compatible registries. Routine checks fetch manifest metadata and required configuration blobs but never model-weight layers. Runnable container images, ambiguous indexes, malformed descriptors, and unsafe paths fail closed. Digest integrity establishes content identity, not publisher authenticity. |
| KitOps ModelKit | ACORN implements the portable KitOps v1.15.0 Kitfile shape with manifestVersion: v1.0.0, authoring YAML, resolved JSON layer identities, and OCI packaging. Unsupported manifest versions produce compatibility warnings where the workflow can continue safely. |
| CNCF ModelPack | Model downloads recognize the implemented ModelPack manifest, configuration, role, and layer media types for weights, weight configuration, documentation, code, and datasets. Raw, TAR, gzip, and Zstandard layer forms are bounded and path-checked. |
| GGUF | ACORN checks the magic value, supported container version, bounded metadata, tensor declarations and data bounds, and split-file consistency before using a model. This is a safe-consumption check, not validation of every model architecture or tensor semantic. |
| MCP Bundle | Generated and inspected .mcpb archives follow manifest version 0.3 at ACORNâs pinned upstream revision. ACORN checks the root manifest, required identity and server fields, safe archive paths, in-archive entry point, and SHA-256 identity where used. Bundle creation and inspection never execute the server. |
Service and agent protocols
| Protocol or profile | ACORN boundary |
|---|---|
| Model Context Protocol | ACORN provides a local stdio server and an outbound client for configured stdio and Streamable HTTP servers. Native initialization, tool discovery, JSON Schema input, calls, cancellation, and shutdown remain MCP messages. Policy controls offline and mutation capabilities. |
| Agent Client Protocol v1 | The ACP client supervises one-shot external-agent sessions, readiness and capability negotiation, streamed updates, model selection, cancellation, and fixed-policy permission responses. ACP is the default inference backend for bounded fix suggestions. |
| JSON-RPC 2.0 | The HTTP endpoint requires JSON-RPC 2.0 request envelopes and validates method parameters against the shared operation registry before dispatch. Authentication, body limits, offline policy, and mutation policy are transport controls around the JSON-RPC contract. |
| Protocol Buffers and gRPC | The acorn.service.AcornService contract exposes explicit typed validation, readability, and repository-processing methods. It has no generic JSON envelope or version RPC and enforces bearer authentication, message limits, deadlines, HTTP/2, and TLS for non-loopback endpoints. |
| OpenAPI 3.1 | The importer reads YAML or JSON descriptions with a paths object and creates ACORN resource entries. It is a focused import adapter, not a complete OpenAPI validator or client generator. |
| OpenAI-compatible HTTP APIs | Completion, chat-completion, response, embedding, image, and audio operations use the implemented OpenAI-style JSON request and response shapes. Compatibility describes an API profile and does not imply that a server is operated by OpenAI or implements every OpenAI endpoint. |
| Dotprompt and Agent Skills | ACORN embeds .prompt templates and distributes SKILL.md packages for compatible consumers. These files carry versioned instructions and resources; their presence does not grant tools or permissions. |
MCP1, ACP2, JSON-RPC, and gRPC share selected ACORN operations and policy metadata, but each keeps its native framing, discovery, session, and error semantics. Compatibility with one transport does not imply wire compatibility with another.
Where ACORN enforces a rule
Use the command that matches the question:
# Validate a record against one metadata model
acorn check metadata.json --standard datacite
# Preview canonical formatting without modifying the file
acorn format index.json --dry-run
# Convert metadata and fail if a known loss is reported
acorn export metadata.json --from datacite --to dcat --format json --strict --dry-run
# Inspect the generated schema for a model
acorn export --schema --standard raid
# Generate linked RAD as JSON-LD
acorn link index.json --dry-run
Network-backed resolution and enrichment are separate operations. Use global --offline when validation must remain local and reproducible.
-
Model Context Protocol, âArchitectureâ and âServer featuresâ. â©
-
Agent Client Protocol, âArchitectureâ. â©
Dublin Core
ACORN models the current DCMI vocabularies as an RDF default graph. The model covers all 129 terms published in the 2020 DCMI snapshots for Metadata Terms, the legacy Element Set, the DCMI Type Vocabulary, and DCAM.
Use dcmi on the command line. dublin-core is also accepted where a standard name is parsed.
Representations
ACORN reads and writes five Dublin Core representations:
| Representation | File suffix | Media type |
|---|---|---|
| Native tagged JSON | .json | application/json |
| Native tagged YAML | .yaml, .yml | application/yaml |
| JSON-LD | .jsonld | application/ld+json |
| RDF/XML | .rdf, .rdfxml | application/rdf+xml |
| Turtle | .ttl | text/turtle |
The native JSON and YAML shape records each subject, its RDF types, and a predicate map. Values are tagged as resources or literals. Literals may have a language or datatype, but not both.
{
"descriptions": [
{
"subject": { "kind": "iri", "value": "https://example.org/dataset" },
"types": ["http://purl.org/dc/dcmitype/Dataset"],
"properties": {
"http://purl.org/dc/terms/title": [
{
"kind": "literal",
"value": { "language": "en", "value": "Example dataset" }
}
]
}
}
]
}
Unknown absolute vocabulary IRIs, repeated values, language-tagged literals, typed literals, and blank-node relationships are retained. Serialization sorts and deduplicates the graph. Blank-node labels are canonicalized, so equivalent RDF graphs compare equal across concrete syntaxes.
ACORN rejects named graphs, RDF-star, relative IRIs, remote JSON-LD contexts, malformed RDF, and literals that combine a language with a datatype. JSON-LD input must be expanded or use an inline context. The decoder never fetches a context or vocabulary.
Validation and checks
acorn check validates graph structure and the lexical forms of the DCMI syntax encoding schemes, including URI, W3CDTF, ISO language and country codes, and the DCMI Box, Period, and Point forms. At least one registered DCMI property or class is required.
DCMI domain, range, and related usage statements are guidance. ACORN reports mismatches as quality suggestions instead of rejecting the graph. FAIR checks use the metadata present in the graph, link checks follow resource IRIs when network checks are enabled, and prose and readability checks cover the descriptive literals.
acorn check metadata.ttl --standard dcmi
acorn --offline check metadata.jsonld --standard dcmi --skip link
acorn format metadata.rdf --standard dcmi
acorn diff before.ttl after.jsonld --standard dcmi
acorn export --schema --standard dcmi --format json
Generic .xml files are not treated as RDF/XML. Use .rdf or .rdfxml.
Crosswalks
Dublin Core converts in both directions with DataCite, DCAT, InvenioRDM, and HuWise. RAD can be exported to Dublin Core. RAD export and routes to DCAT, InvenioRDM, and HuWise use DataCite as their shared intermediate model. ACORN reports known field loss as crosswalk warnings.
acorn export datacite.json \
--from datacite \
--to dcmi \
--format turtle \
--output ./export
acorn export metadata.ttl \
--from dcmi \
--to datacite \
--format json \
--output ./export
RAD requires a local identifier and a complete contact that Dublin Core cannot supply reliably. Provide both when importing:
acorn export metadata.ttl \
--from dcmi \
--to rads \
--format json \
--crosswalk-contact contact.json \
--local-identifier imported-dataset \
--output ./export
The contact file may be JSON or YAML and must match the RAD ContactPoint schema. ACORN fails the conversion when either required input is missing. It does not create placeholder identity data.
Store reusable import defaults under options.crosswalk in ACRE configuration:
options:
crosswalk:
contact: contacts/default.yaml
localIdentifier: imported-dataset
Configured contact paths are resolved relative to the configuration file. Pass --config to select a file explicitly; --crosswalk-contact and --local-identifier override configured values.
Crosswalks select the first description containing a title as the root resource. Additional graph descriptions and third-party predicates remain available in Dublin Core output, but a target model may not have an equivalent field. Those losses appear in the warning list, and --strict rejects the output.
Rust and browser APIs
acorn_schema::standard::dublin_core::DublinCoreDocument implements DocumentCodec for every representation listed above. The public registry functions expose term definitions and declared relationships. DublinCoreImportOptions supplies the required RAD contact and local identifier.
The WebAssembly package validates Dublin Core in all five representations. crosswalkMetadata returns JSON output, while crosswalkMetadataAs accepts an explicit output format for Dublin Core targets. Both operate on supplied strings without filesystem or network access.
Persistent identifier lifecycle
ACORN treats a persistent identifier (PID) as evidence that moves through several distinct stages. Finding a PID does not by itself prove that it is valid, and parsing it does not contact its registration authority.
Together steps 1-7 form the evidence pipeline that turns unstructured text into candidate research activities: steps 1-4 prepare and clean identifiers locally; steps 5-7 decide their role, optionally enrich from authorities, and persist exact identities. The pipeline is local-first and additive â resolution and persistence are optional extensions.
%%{init: {'themeVariables': {'fontSize': '16px'}}}%%
flowchart LR
input["Text<br/>or metadata"] --> find["Find<br/>candidates"]
find --> parse["Parse<br/>components"]
parse --> validate[Validate]
validate --> normalize[Normalize]
normalize --> classify[Classify]
classify --> report["Report<br/>and retain"]
classify -->|Project identity| persist["Create<br/>or enrich"]
classify -. optional .-> resolve["Resolve<br/>metadata"]
resolve --> report
resolve -->|Project identity| persist
persist -. exact identity .-> merge["Merge<br/>deterministically"]
Supported identifiers
The typed Rust API supports ARK, arXiv, DOI, Handle, ISBN, ISNI, ORCID, RAiD, ROR, RRID, SWHID, and US patent parsing. The generic Identifier representation also recognizes HTTP(S) URLs. PIDINST and Unknown are classification values, but they do not currently have typed parsers.
About the table: Role indicates what the identifier proves â Project identity can create or match a research activity, while Supporting evidence, Person evidence, and Organization evidence are retained in reports but do not form candidates on their own. Validation describes the local type-checking performed (syntax, components, and checksum where the spec defines one) â it does not contact a registry. Normalized is the display form stored in RAD fields and reports (contrasted with the namespaced identity_key used for exact matching, e.g., doi:10...). Display forms that are bare identifiers or URLs reflect the canonical output for that kind.
Validation is local. It checks syntax, components, and a checksum where the implemented identifier specification defines one; it does not resolve the identifier or confirm that a registration record exists.
| Kind | Validation | Normalized | Role |
|---|---|---|---|
| ARK | NAAN and assigned-name structure | ARK, retaining a supplied resolver | Project identity |
| arXiv | Modern or legacy arXiv identifier structure | arXiv: identifier with an optional version | Project identity |
| DOI | DOI prefix and suffix structure | Bare DOI | Project identity |
| Handle | Naming-authority prefix and non-empty local name | Bare Handle, preserving case | Supporting evidence |
| ISBN | ISBN-13 length and check digit | Hyphenated ISBN components | Project identity |
| ISNI | Length and ISO 7064 check digit | https://isni.org/isni/... | Person or organization evidence |
| ORCID | Length and ISO 7064 check digit | https://orcid.org/... | Person evidence |
| RAiD | DOI-like prefix and suffix structure | Bare RAiD DOI | Project identity |
| ROR | Crockford Base32 length and check digits | https://ror.org/... | Organization evidence |
| RRID | Explicit RRID: label, bounded opaque payload, and approved resolver form | RRID:<payload> | Research-resource evidence |
| SWHID | SWHID v1 core and qualifier rules | swh:1:<type>:<object-id> with canonical qualifiers | Software project identity |
| Patent | Supported US number and kind-code structure | Spaced US patent number | Project identity |
| URL | HTTP(S) syntax | URL without a trailing slash | Supporting evidence |
ACORNâs regression suite maintains shared test-vector parity with Metadata Tools for arXiv, DOI, ISBN, ISNI, ORCID, RAiD, and ROR, and with idutils for ARK, arXiv, DOI, Handle, ISBN, ISNI, ORCID, RAiD, ROR, RRID, and SWHID. Here, parity means ACORN runs corresponding upstream cases for these overlapping identifier types; it does not mean the libraries have identical APIs, normalization policies, or support for other identifier families.
Schema validation recognizes ISNI in RAD agent identifiers; DataCite name, affiliation, publisher, and funder identifiers; InvenioRDM person or organization identifiers; and RAiD contributors whose schemaUri is https://isni.org. For known ISNI, ORCID, and ROR schemes, the declared scheme, scheme URI, and identifier value must agree. Explicitly named extension schemes remain available for identifiers outside those known registries.
A. Prepare evidence locally (steps 1-4)
Steps 1-4 are preparatory sub-components that clean and standardize evidence before any persistence decision.
1. Find candidates
Each typed PID implements PersistentIdentifierParse::find_all. The finder scans unstructured text with the PIDâs recognition pattern and returns parsed values. Full API at docs.rs â PersistentIdentifierParse.
Implementation detail â Rust
#![allow(unused)]
fn main() {
use acorn_schema::pid::{DOI, PersistentIdentifier, PersistentIdentifierParse};
let text = "The dataset is available at https://doi.org/10.11578/dc.20250604.1.";
let found = DOI::find_all(text);
assert_eq!(found.len(), 1);
assert_eq!(found[0].identifier(), "10.11578/dc.20250604.1");
}
The gather command runs the supported finders across file, document, URL, standard-input, and literal-text content. It removes duplicate normalized discoveries from the report while retaining the source reference for discovery history. ISNI and ORCID share the same 16-character number and checksum shape, so unstructured discovery requires an ISNI or ORCID label or the corresponding registry URL; ACORN does not guess the type of an unlabeled compatible value. Callers that already specify the PID type can still parse bare, spaced, or hyphenated values. To avoid classifying ordinary paths as Handles, unstructured discovery requires hdl: or an hdl.handle.net resolver URL; structured fields and direct parsing also accept bare Handles. RRID discovery similarly requires an explicit RRID: label or an approved N2T/SciCrunch resolver URL. Bare registry payloads such as SCR_003512 are not discovered as RRIDs.
2. Parse components
from_string decomposes one value into a typed structure. Parsing is intentionally separate from validation: malformed input can produce an empty or partial value, so callers that require a usable PID must validate it. See docs.rs â PersistentIdentifierParse::from_string.
Implementation detail â Rust
#![allow(unused)]
fn main() {
use acorn_schema::pid::{DOI, PersistentIdentifier, PersistentIdentifierParse};
let doi = DOI::from_string("https://doi.org/10.11578/dc.20250604.1");
assert_eq!(doi.prefix().as_deref(), Some("10.11578"));
assert_eq!(doi.suffix().as_deref(), Some("dc.20250604.1"));
assert_eq!(doi.url(), "https://doi.org/10.11578/dc.20250604.1");
}
The PersistentIdentifier trait provides common component access through identifier, prefix, suffix, check_digit, schema_uri, and url. The meaning of a component depends on the PID specification.
3. Validate locally
Use the typed is_valid method when a boolean is convenient. For ergonomic string checks, use PersistentIdentifierConvert; for validator composition, use validation::rules which returns Result<(), ValidationError>. See docs.rs â PersistentIdentifierConvert.
Implementation detail â Rust
#![allow(unused)]
fn main() {
use acorn_schema::pid::{DOI, PersistentIdentifierConvert, PersistentIdentifierParse};
assert!(DOI::is_valid("10.11578/dc.20250604.1"));
assert!("10.11578/dc.20250604.1".is_doi());
assert!(!"not-a-doi".is_doi());
}
The local checks do not make a network request. Identifier resolution is a later, optional operation.
4. Normalize a representation
format parses a value and renders the typeâs standard display form. It is a formatting operation, not a validity result. See docs.rs â Identifier::normalized.
Implementation detail â Rust
#![allow(unused)]
fn main() {
use acorn_schema::pid::{DOI, ISNI, ORCID, PersistentIdentifierParse};
assert_eq!(DOI::format("https://doi.org/10.11578/dc.20250604.1"), "10.11578/dc.20250604.1");
assert_eq!(ISNI::format("0000 0004 9229 9539"), "https://isni.org/isni/0000000492299539");
assert_eq!(ORCID::format("0000-0002-2057-9115"), "https://orcid.org/0000-0002-2057-9115");
}
For discovery and ingestion, Identifier::normalized is the safer combined boundary. It trims surrounding prose punctuation, parses according to the declared kind, formats the result, validates it, and returns None when the value is unsupported or invalid. PID::Unknown asks ACORN to detect a supported kind.
#![allow(unused)]
fn main() {
use acorn_schema::pid::{Identifier, PID};
let raw = Identifier {
kind: PID::DOI,
value: "<https://doi.org/10.11578/dc.20250604.1>".to_string(),
};
let Some(normalized) = raw.normalized() else {
panic!("expected a valid DOI");
};
assert_eq!(normalized.value, "10.11578/dc.20250604.1");
assert_eq!(normalized.identity_key(), "doi:10.11578/dc.20250604.1");
}
This distinction matters: the normalized display is suitable for RAD fields and reports, while the identity key is suitable for exact matching.
arXiv identifiers convert to their work-level DataCite DOI with DOI::from(arxiv), producing the 10.48550/arXiv.* namespace and omitting any revision suffix. The reverse conversion uses ARXIV::try_from(doi) because publisher DOIs and other DOI namespaces do not encode an arXiv identifier.
Research activity metadata stores both DOI and arXiv publication identifiers in meta.doi; validation and export classify each value by its format. Handles are stored in meta.handle and cross into CFF as other identifiers. SWHIDs are stored separately in meta.swhid and exported to CFF with identifier type swh. Authored RRIDs use meta.relatedResources with a TypedIdentifier whose scheme is RRID and an explicit relation; the hardware/compute resources field is unchanged.
B. Decide, enrich, and persist â primary purposes (steps 5-7)
Important
Classification, optional resolution/enrichment, and exact-identity persistence are the primary purposes of the lifecycle. Steps 1-4 prepare evidence; steps 5-7 decide what it proves and whether it creates candidate research activities.
5. Classify the evidence
PID records what an identifier identifies. ACORN currently divides discoveries into two groups:
- arXiv, DOI, RAiD, ISBN, patent, ARK, and SWHID values are project-like identifiers. Each can independently create or match a research activity candidate. Versioned arXiv identifiers retain their revision in evidence but share the unversioned work identity.
- Handle, ISNI, ORCID, ROR, RRID, PIDINST, unknown identifiers, and arbitrary URLs are entity or supporting evidence. They remain in reports and discovery history but cannot independently create or merge a candidate. RRIDs specifically identify research resources and never serve as project identities.
A provider can explicitly relate person or organization evidence to a project, but ACORN does not infer that relationship merely because the values occur in the same input.
6. Resolve and enrich optional metadata
acorn gather --resolve runs after local discovery and contacts authorities per identifier kind:
- arXiv / DOI â CiteAs
- Handle â public Handle proxy REST API
- ISNI â public ISNI SRU registry
- ORCID â ORCID API
- RAiD â RAiD resolver
- SWHID â Software Heritage resolver
- RRID â local-only (no remote resolver; normalized and retained as evidence)
Use the RRID portal to confirm or search RRIDs. ACORN does not send SciCrunch API keys because the published machine-API material supports query-string credentials and does not document the operational, lifecycle, and retention guarantees required for a credential-safe provider.
ISNI resolution sends one exact anonymous lookup per unique normalized identifier to the OCLC-hosted public SRU service and accepts only one assigned record whose canonical or merged identifiers account for the request. The typed outcome preserves the public person-or-organization kind, canonical and merged ISNIs, confidence, names, locations, organization types, source identifiers, and original XML as provenance. Resolution confirms an assigned public registry record; it does not prove legal identity, copyright ownership, affiliation, or a relationship to a research activity. Registry diagnostics, unavailable or malformed responses, and ambiguous or missing matches produce a failed resolution while retaining the locally valid discovery.
Handle resolution retains the complete public record as provenance and maps only direct HTTP(S) URL string values to websites on a project candidate found in the same source; it does not interpret 10320/loc or make a Handle project identity. SWHID resolution confirms archive presence and returns resolver metadata, not citation data. A successful response contributes only values with a direct candidate mapping: identifiers, title, description, websites, keywords, sponsors, partners, and related activities. A resolver failure does not turn a locally valid identifier into invalid evidence. In --raw output, resolved arXiv and DOI values use the citation family selected by --citation-format, then ACORN_CITATION_FORMAT, then IEEE; resolved ISNIs use Public Name (canonical ISNI URL) when the registry supplies a usable name, and resolved ORCIDs use Given Family (normalized ORCID) with public credit name as fallback. Failed resolutions retain the original normalized identifier while reporting a failure on stderr.
Remote DOE CODE project matches enter the same candidate pipeline with a provider identity such as osti-project:<code_id> and a DOI when one is available. DOE CODE supplies project descriptions, websites, and role-separated organization names. A --lab filter additionally associates the selected laboratoryâs known ROR. With --resolve, valid ORCIDs enrich person reports, project DOIs and person ORCIDs receive structured resolver outcomes and resolved raw rendering, repository URLs can contribute provider-reported programming languages, and provider-confirmed links are checked for liveness. These optional online operations retain the original DOE CODE result when they fail. DOE CODE people and organization searches remain report-only.
GitLab work-item intake uses the same artifact candidate representation but is separate from the gather command. An embedded or repository CITATION.cff can contribute normalized DOI and other supported identifiers, title, abstract, author names, an explicitly declared singular contact, landing and repository websites, canonical keywords, and repository languages. It does not infer sponsors, partners, or a contact from the author order. Dates, contributor roles, licenses, and award identifiers are not currently mapped or placed in notes; dedicated typed schema fields are planned.
All enrichment follows the same merge rules:
- Accept values only from a provider field with a defined semantic mapping; do not infer relationships from proximity or list order.
- Normalize recognized identifiers before identity or field mapping.
- At database persistence, prefer an existing populated scalar value and fill only missing scalar values.
- Union and deduplicate list values, using the URL as the identity for websites; normalize keywords and technologies through their controlled vocabularies.
- When resolver or provider evidence is persisted, retain it as provenance; do not coerce an unsupported value into an unrelated field.
RAiD organization roles are mapped independently from ROR name resolution. Funder produces a sponsor relationship; every supported non-funder organization role produces a partner relationship. A mixed-role organization can therefore be both. A single organization without a role is treated as the RAiD default lead organization, but roleless entries in a multi-organization record are not classified. The organization name is emitted only when its ROR is present in ACORNâs embedded sponsor or partner vocabulary; an unknown ROR remains organization evidence without a guessed name.
7. Build exact identities and persist candidates
Before persistence, project identifiers become namespaced identity keys such as doi:10.11578/dc.20250604.1 or arxiv:2106.09685. A qualified SWHID uses swhid:<core-swhid> so origin, path, and fragment context do not change byte identity; the complete qualified value remains in evidence. ACORN lowercases the namespace. arXiv versions are removed from identity keys, while normalized evidence retains them. DOI, arXiv, RAiD, ISBN, patent, and SWHID identity values are compared case-insensitively; ARK and provider-specific values preserve their value case. Keys are sorted and deduplicated.
Bucket ingestion also adds a repository-qualified RAD identity, and providers can add their own project identity. These are identity keys rather than new PID types.
Persistence uses exact identity overlap:
- No matching row creates a candidate with a portable NanoID.
- One matching row fills missing fields and unions unique arrays and identities.
- Repeated identical evidence leaves the row unchanged.
- Conflicting populated values keep the stored value and add the observation to provenance.
- Evidence matching multiple rows reports a conflict and does not mutate them.
Use acorn gather to inspect this lifecycle from the command line. Add global --no-local-database when you want discovery and reporting without history or candidate persistence.
Calculate local SWHIDs
The host CLI can hash working-tree objects or traverse an existing local SHA-1 Git repository. It never clones, fetches, changes refs, or writes working-tree files.
acorn swhid README.md --raw
acorn swhid ./src --kind directory --raw
acorn swhid . --kind revision --reference HEAD --raw
acorn swhid . --kind git-tree --reference HEAD --raw
acorn swhid . --kind release --reference v1.0.0 --raw
acorn swhid . --kind snapshot --raw
--verify <SWHID> recalculates the selected object and compares core identifiers. Qualifiers are intentionally ignored for that byte/object comparison. Directory calculation traverses the supplied filesystem directory and does not apply Git ignore rules; use --kind git-tree for committed tree state.
Metadata enrichment
ACORN enrichment uses trusted metadata services to fill gaps in research activity data (RAD). It is additive: populated values are preserved, arrays are deduplicated, ambiguous identity matches are left unchanged, and provider failures do not discard successful results from earlier providers.
Enrichment is opt-in because it performs network requests and may add externally asserted metadata. Preview changes before writing when possible:
acorn format path/to/project/index.json --enrich --dry-run
acorn format path/to/project/index.json --enrich
Global --offline mode cannot be combined with enrichment. For a configured bucket, download or copy its files locally before running the enrichment workflow; enrichment does not enumerate bucket configuration.
Providers
Without --provider, acorn format --enrich runs every provider in this deterministic order: OSTI, OpenAlex, CiteAs, ORCID, then ROR. Use repeated or comma-delimited --provider values to select a subset:
acorn format index.json --enrich --provider openalex,citeas
acorn format index.json --enrich --provider orcid --provider ror
Provider names are case-insensitive.
| Provider | When it applies | Data it can add | Environment variables |
|---|---|---|---|
| OSTI | meta.identifier is osti-<code> or the RAD has a DOI | Missing subtitle and DOI metadata from DOE CODE | None |
| OpenAlex | The RAD has one or more DOIs | Structured research outputs: OpenAlex ID, DOI, title, type, publication date, contributors and affiliations, funding, locations, keywords, and access metadata | OPENALEX_API_KEY is optional but recommended. OPENALEX_API_HOST optionally overrides api.openalex.org. |
| CiteAs | A DOI is not already represented in meta.outputs | A basic research output with identifier, DOI, title, type, publication year, and CiteAs URL | CITEAS_API_TOKEN is optional. CITEAS_SERVER_HOST optionally overrides citeas.org. |
| ORCID | The contact has complete names but no identifier, or an identifier with a missing given or family name | An ORCID for one unambiguous exact name match, or missing names from an exact ORCID profile | ORCID_API_TOKEN is optional. ORCID_SERVER_HOST optionally overrides pub.orcid.org. |
| ROR | meta.ror is missing and the contact has an affiliation or organization | A ROR for one unambiguous active organization match | ROR_API_TOKEN is optional. ROR_SERVER_HOST optionally overrides api.ror.org. |
The public defaults work without provider environment variables. Tokens are sent only when configured. Host overrides are mainly useful for proxies, compatible deployments, and tests.
In the default order, OpenAlex supplies the richer scholarly-output record and CiteAs acts as a fallback when OpenAlex does not produce an output for a DOI. gather --enrich always uses the complete default provider sequence; provider selection is available on format --enrich.
# Recommended for OpenAlex usage
OPENALEX_API_KEY=replace-with-your-key
# Optional public-API tokens
CITEAS_API_TOKEN=replace-with-your-token
ORCID_API_TOKEN=replace-with-your-token
ROR_API_TOKEN=replace-with-your-token
Do not commit secrets in .env files. Environment variables set by the shell take effect through the same provider configuration.
Matching and conflict safeguards
OpenAlex merges missing metadata into an existing output with the same normalized DOI. CiteAs adds an output only when that DOI is not already represented. Existing non-empty scalar values and non-empty collections win over provider candidates.
ORCID identifier discovery requires an exact normalized given-name and family-name match. When several records match, ACORN uses the contact email or organization to disambiguate; otherwise it reports a conflict and leaves the identifier unchanged. When an identifier is already present, ACORN uses its exact profile to fill only blank given or family names; populated local names are preserved, and the public credit name is not split or inferred. ROR similarly requires an exact active display name or alias and uses the contact email domain when several organizations match.
When a provider changes title, subtitle, contact.familyName, contact.givenName, contact.identifier, meta.doi, meta.outputs, or meta.ror, ACORN records the provider, lookup source, and changed field paths in meta.enrichment. ORCID provenance uses the identifier for profile-based name enrichment and the full name for identifier discovery. Provider failures are retained and the remaining providers continue. Successful changes can therefore be applied even when the command ultimately reports a nonzero status for one or more provider failures.
How enrichment fits the workflow
The reusable workflow engine follows this shape:
read â check â format â enrich â format â check â link â plan â apply
Planning is separated from writing, which lets callers preview a complete change and keeps --dry-run non-mutating. The engine is generic over supported metadata standards through ACORNâs input/output, validation, serialization, and enrichment traits. The current CLI enrichment mappings target RAD; additional standards can opt in without making the workflow engine schema-specific.
In the command-line workflow:
gatherdiscovers identifiers and candidate evidence from documents, URLs, and text.--resolveresolves discovered identifiers, while--enrichenriches valid RAD inputs in memory before discovery. Gather never rewrites those source files.checkvalidates the RAD structure and content.format --enrichnormalizes the local RAD, runs the selected providers, normalizes the enriched result, previews or applies the combined change, and records enrichment provenance.linkandexportcreate linked or presentation artifacts from the maintained RAD.
A review-oriented sequence is:
acorn gather path/to/project --resolve
acorn check path/to/project/index.json
acorn format path/to/project/index.json --enrich --dry-run
acorn format path/to/project/index.json --enrich
acorn check path/to/project/index.json
Use gather --raw --enrich when a pipeline needs enriched RAD candidates as JSON Lines without modifying inputs. Use format --enrich when the maintained local RAD itself should be updated.
Similarity and distance
ACORN exposes bounded similarity primitives through acorn_core::similarity. They describe resemblance between supplied values; they are not probabilities, confidence estimates, or evidence that two research records identify the same activity.
Character algorithms operate on Unicode scalar values rather than UTF-8 bytes. Raw comparison is case-sensitive and performs no hidden Unicode normalization, punctuation removal, or case folding. Callers may explicitly request Rust Unicode lowercase mapping, full locale-independent Unicode case folding, NFC canonical normalization, or NFKC compatibility normalization before comparison and token preparation.
Raw remains the default because this is a general-purpose API: normalization can change scalar-level distances, and compatibility normalization can collapse distinctions that matter in identifiers, technical notation, and source text. For human-language matching where canonically equivalent spellings should compare alike, opt in to NFC. Prefer NFC over NFKC unless the consumer intentionally treats compatibility characters such as circled digits and ordinary digits as equivalent. Case folding is separate from normalization and should be selected only when case distinctions are irrelevant.
The portable API includes exact prefix and suffix comparisons; Hamming, Levenshtein, weighted Levenshtein, restricted optimal string alignment (OSA), and unrestricted Damerau-Levenshtein distance; Jaro and conventional Jaro-Winkler; word and character n-gram preparation; overlap, Jaccard, and Sorensen-Dice set similarity; cosine and explicit-corpus TF-IDF; Monge-Elkan, collision-checked Extended Jaccard, and Soft TF-IDF; Soundex, Cologne phonetics, and original Metaphone; cutoff-based numeric and calendar-date policies; and bounded global or local sequence-alignment scores. OSA and unrestricted Damerau-Levenshtein are separate variants: for CA and ABC, their respective distances are 3 and 2.
Normalized edit similarity is 1 - distance / max(lengths), with empty/empty defined as 1. Set methods deduplicate their inputs; both-empty sets score 1 and one-empty sets score 0. Conventional Jaro-Winkler uses at most four common prefix scalars, a scale of 0.1, and applies its boost only when Jaro similarity is above 0.7.
Every allocating or nested operation accepts SimilarityLimits. The defaults allow 4,096 scalars per input, 4,000,000 comparison work units, and 4,096 collection items. Exceeding a limit is an explicit error; inputs are never truncated silently. Scores use a validated finite type bounded to [0,1], so NaN and infinity cannot be serialized as similarity scores.
The algorithm inventory and examples were independently specified with reference to Felix Naumann, Similarity measures, 11 June 2013, a 41-page lecture supplied from C:/Users/jason/Downloads/similarity_measures.pdf. Page numbers below are physical PDF pages. The lecture is reference material rather than executable specification: notably, its local transposition recurrence describes OSA rather than unrestricted Damerau-Levenshtein, and its named-only methods require independent specifications.
| Source inventory | Pages | ACORN disposition |
|---|---|---|
| Exact and truncation baselines | 6 | Shipped as exact, prefix, and suffix comparisons. |
| Hamming, Levenshtein, weighted edit costs, and transpositions | 7â13 | Shipped as Hamming, unit and weighted Levenshtein, restricted OSA, and unrestricted Damerau-Levenshtein. |
| Jaro and Winkler adjustments | 14â16 | Jaro and conventional bounded Jaro-Winkler shipped; the slide-specific uncapped and long-string adjustments remain unsupported. |
| Word and character n-grams | 19â21 | Shipped with explicit preprocessing and optional boundary padding; positional weighting is deferred. |
| Overlap, Jaccard, and SĂžrensenâDice | 22 | Shipped with deduplicated-set and empty-set contracts. |
| Soundex, Cologne phonetics, and original Metaphone | 24, 26, 28 | Shipped as standalone encoders and equality comparisons with documented language limits. |
| Double Metaphone and Metaphone 3 | 27 | Deferred because the lecture does not provide an implementable specification; Metaphone 3 also needs compatible licensing and a demonstrated consumer. |
| Monge-Elkan | 30â31 | Shipped as directional and explicitly symmetric variants. |
| Extended Jaccard | 32 | Shipped with deterministic threshold and collision handling rather than implicit many-to-many reuse. |
| Cosine and TF-IDF | 33â35 | Shipped with an explicit, reusable, identity-bearing corpus and versioned weighting formula. |
| Soft TF-IDF | 36 | Shipped with L2-normalized TF-IDF weights and collision-checked unique best matches. |
| Numeric difference policies | 38 | Shipped as finite percentage difference plus cutoff-based absolute and percentage similarities. |
| Calendar date and age policies | 39 | Day distance, optional valid day/month swapping, and explicit-reference age percentage shipped; the underspecified month-error heuristic is deferred. |
| Needleman-Wunsch, Smith-Waterman, and Smith-Waterman-Gotoh | 3, 41 | Shipped from independent primary algorithm specifications with explicit linear and affine gap conventions. |
| Geographic and domain-specific rules | 39, 41 | Deferred until a coordinate system, units, algorithm, and concrete consumer are specified. |
SecondString, SimMetrics, and GeographicLib on page 41 are software packages rather than additional algorithms. Clustering, partitioning, filtering, and learning on page 2 are research categories, not implementable method specifications.
Method contracts and appropriate use
Choose a method for the evidence represented by a field, not because one score happens to be high:
- Titles and short descriptions can use token sets or directional Monge-Elkan when word overlap is meaningful. Long prose can use an explicit, frozen TF-IDF corpus. Missing fields remain missing rather than becoming empty strings.
- Contributor or organization names can use Jaro-Winkler or a language-appropriate phonetic encoder to rank suggestions. A phonetic match never establishes a personâs or organizationâs identity. Soundex and original Metaphone are English-oriented; Cologne phonetics is German-oriented.
- Keywords and other controlled values should use the controlled-vocabulary resolver below. Identifiers, checksums, PIDs, URIs, emails, and telephone numbers retain exact or domain-specific validation.
- Numeric and date methods require a caller-chosen cutoff. Age comparison also requires an explicit reference date. Optional day/month swapping considers only valid proleptic-Gregorian interpretations and must not be treated as a correction of source truth.
- Needleman-Wunsch returns a global raw alignment score. Smith-Waterman and Smith-Waterman-Gotoh return local raw scores. The affine variant charges
gap_openfor the first gap scalar andgap_extendfor each continuation. These scores depend on the supplied scoring scheme and are not normalized similarities.
TfidfCorpus is constructed from caller-supplied tokenized documents and never scans an ACORN database. Document frequency counts a token once per document. Term frequency is count / document token count; the versioned tfidf-ratio-v1 inverse-document weight is (document_count + 1) / (document_frequency + 1), followed by L2 normalization. The corpus identity hashes ordered document boundaries and tokens, so reports can reproduce the exact snapshot and weighting version. Tokens absent from the corpus use document frequency zero. Empty token lists and zero norms are explicit errors.
Soft TF-IDF uses those L2-normalized weights, an inclusive token threshold, and unique best matches. Extended Jaccard uses the same collision rule. A tied best candidate or reuse of one right token is reported as FuzzyTokenCollision; ACORN does not silently choose a row-order winner or claim the many-to-many slide formula. Directional Monge-Elkan averages each left tokenâs best right-token score. A separately named symmetric function averages both directions.
Weighted Levenshtein accepts positive insertion, deletion, and substitution costs and normalizes by the cost of deleting the complete left input and inserting the complete right input. Cosine accepts equal-length finite vectors with nonzero L2 norms. All bounded methods return finite scores in [0,1]; alignment functions and raw distances use their natural units.
Soundex retains the first ASCII letter, does not let H or W reset adjacent-code suppression, and pads to four characters. Cologne phonetics folds German umlauts to their base vowels and Ă to S, retains an initial vowel code, removes later vowel codes, and suppresses repeated codes. Original Metaphone follows Lawrence Philipsâ 1990 English rules and returns one encoding. The encoding functions are public independently of the binary equality comparisons in acorn diff.
The slide-specific uncapped/long-string Winkler variants, Double Metaphone, Metaphone 3, positional n-gram weighting, the month-error heuristic, geographic distance, and a general domain-rule engine are unsupported. Double Metaphone and Metaphone 3 remain deferred because the supplied source names them without a complete implementable specification; Metaphone 3 also requires a compatible license and demonstrated need. Similarity-based duplicate suggestions and automatic record merging are likewise outside this API.
Release-mode Criterion observations on the 2026-10-10 development host were 1.66â1.67 ”s for 16-scalar Needleman-Wunsch and 332â333 ”s for 256 scalars; 81.3â81.9 ”s for a 16-document TF-IDF corpus and 1.077â1.084 ms for 256 documents; 1.186â1.194 ms for the bounded nested Monge-Elkan case; and 183â442 ns for the three phonetic encoders. These measurements are regression observations, not portable performance guarantees. Long edit, repeated-token, nested-comparison, and growing-corpus cases all remained within their explicit work limits.
Controlled-vocabulary resolution
acorn_schema::vocabulary::VocabularyResolver applies these primitives to ACORNâs embedded keyword, technology, partner, sponsor, and organization vocabularies. It prepares each vocabulary once per batch, treats input as literal text, and checks canonical values, declared aliases, and typed identifiers before bounded fuzzy ranking. Distinct canonical entries that share an alias or cannot clear the runner-up margin are reported as ambiguous rather than selected by row order.
Every input produces a VocabularyResolution with its original value, optional source locator, outcome, accepted canonical value, matched term, method, score, runner-up margin, and bounded alternatives. Reports also identify the vocabulary and policy revisions. The lossless projection substitutes accepted values and retains unmatched, ambiguous, invalid, or resource-limited input; the accepted projection is stable and deduplicated.
Three profiles are available:
relaxedis the default advisory policy acrossacorn check, the shared service, gRPC, TUI, and existing WASM validation binding. It lowers the vocabulary-specific fuzzy score and separation gates but keeps ambiguity and resource safeguards.strictis the higher-precision policy used by formatting unless its caller selects another mode.offdisables fuzzy scoring while retaining exact canonical, alias, identifier, and normalized matches.
Vocabulary policy revision vocabulary-v2 uses NFC plus full Unicode case folding for organization, partner, and sponsor names. Keywords and technologies use NFKC plus full folding. Organization punctuation is normalized as part of name matching; technology punctuation is preserved unless an asset declares an alias, so values such as C++, C#, and node.js remain distinct. Keyword spaces and underscores normalize to hyphens.
The resolver preflights total fuzzy work for a batch. If the complete fuzzy stage would exceed its configured ceiling, deterministic exact, alias, identifier, and normalized lookups still run, but every otherwise fuzzy-eligible unresolved input is marked resource-limited. It never accepts a prefix of an over-budget batch, and input reordering cannot change accepted canonical results.
The post-migration release corpus contains 1,465 provenance-labeled compatibility and evaluation cases generated against the historical nucleo-matcher 0.3.1 behavior at source revision b4007f43^. Nucleo is not a production or development dependency. Held-out relaxed results are:
| Vocabulary | Accepted | Precision | Recall | 95% Wilson precision interval | Ambiguous | Protected-negative failures |
|---|---|---|---|---|---|---|
| Keywords | 221 | 100% | 100% | 98.29â100% | 0 | 0 |
| Organizations | 198 | 100% | 100% | 98.10â100% | 0 | 0 |
| Partners | 234 | 100% | 100% | 98.38â100% | 1 | 0 |
| Sponsors | 170 | 100% | 97.70% | 97.79â100% | 0 | 0 |
| Technology | 226 | 100% | 100% | 98.33â100% | 0 | 0 |
These measurements describe the checked-in corpus, not a universal probability of correctness. The tests recompute the table and enforce zero known strict false canonicalizations, at least 99% relaxed observed precision, and no protected-hard-negative failures.
acorn format --fuzzy <MODE> applies the selected policy to RAD fields and contact organization data. acorn gather --fuzzy <MODE> applies it when provider evidence becomes a persisted candidate. Unknown evidence is preserved in formatted fields or provider provenance; similarity never establishes organizational or record identity.
The native resolver may reuse a versioned JSON cache keyed by vocabulary content, vocabulary revision, policy revision, cache schema, and Unicode-data version. Cache records contain prepared embedded vocabulary data only, never user input or reports. A missing, stale, or corrupt record is rebuilt without changing resolver semantics; global --clear-cache removes this ACORN-managed namespace with the other application caches. Alloc-only and WASM callers use the same embedded resolver contract without filesystem state.
Release-mode Criterion observations on the same development host were 11.83â11.91 ”s to construct the keyword vocabulary and 327â331 ”s for organizations. A validated warm organization cache loaded in 338â343 ”s versus 355â357 ”s for uncached preparation. One six-field RAD advisory pass took 20.90â21.17 ms in relaxed mode and 10.48â10.61 ms in strict mode. Maximum 256-input batches took 92.2â92.7 ms relaxed and 96.2â97.3 ms strict; the unmatched worst case took 125.7â126.3 ms.
Accepted Info and Warning advisories can produce deterministic safe-automatic fixes. Application rechecks the finding fingerprint, original located value, effective mode, complete and unambiguous outcome, selected canonical value, vocabulary revision, and policy revision against the current resolver. Scalar keyword, partner, and technology lists are stably deduplicated after replacement; structured funder records remain distinct. Ambiguous and resource-limited results have no automatic replacement, and inference cannot choose or modify one.
Every applied vocabulary formatting or fix operation writes one combined audit report in ACORNâs application-data namespace. Reports contain redacted source URIs, before/after content fingerprints, locators, original and replacement values, outcomes, bounded candidates and evidence, effective modes, completeness, resolver revisions, and scalar-deduplication effects rather than a full document snapshot. URL credentials, queries, and fragments are removed. Files use owner-only permissions on Unix and retention keeps the latest 1,000 reports. Preview, unchanged, and rolled-back operations do not leave reports. Global --clear-logs removes only this managed log namespace.
Pairwise comparison
Rust callers can use acorn_core::similarity::compare to select a method, validate its options, and receive a typed result containing the score, optional raw distance, effective parameters, and stable algorithm variant. The facade requires acorn-coreâs alloc feature and performs no file or network I/O.
Use acorn diff --method to calculate one similarity score from two supplied values. Operands are UTF-8 files by default; --values treats both operands as literal text. The command works offline and does not interpret operands as URLs.
acorn diff Paul Pual --method optimal-string-alignment --values
acorn diff before.txt after.txt --method jaccard --format json
acorn diff 10 12 --method absolute-difference --cutoff 4 --values
Text methods compare complete file contents, including trailing whitespace. Numeric methods trim surrounding whitespace before parsing finite numbers. Raw preprocessing is the default. --preprocess lowercase applies Rust Unicode lowercase mapping; case-fold applies full locale-independent Unicode case folding; nfc applies canonical normalization; and nfkc applies compatibility normalization. Each is an explicit, non-composable mode. Overlap, Jaccard, and SĂžrensenâDice use Unicode-whitespace word sets unless --ngram-width selects unpadded character n-grams.
Prefix and suffix comparisons require --length. Absolute- and percentage-difference comparisons require a positive --cutoff. The three --max-* resource options override the core defaults for textual work. Invalid or irrelevant options are errors, while a score of zero is a successful comparison.
Similarity mode defaults to human-readable text and accepts --format text or --format json. JSON reports the method and stable variant, optional preprocessing and raw distance, the normalized score and its semantics, and the effective parameters. It does not repeat operand contents. Without --method, acorn diff retains its semantic file comparison behavior and accepts diff or json-patch output.
FAIR evidence assessment
ACORNâs fair check category describes how strongly the available metadata supports the FAIR principles. It evaluates the 41 indicators in the RDA FAIR Data Maturity Model. The RDA recommendation leaves assessment methods to implementers, so ACORN reports its observed evidence instead of inventing a maturity level or compliance grade.
Evidence states
Every indicator has one of four states:
- Supported: available evidence supports the indicator. This is informational and does not fail a check.
- Unsupported: available evidence explicitly contradicts the indicator, such as a failed resolution check. This is a warning and fails the check.
- Indeterminate: metadata is missing or ACORN cannot prove the indicator. This is a non-failing suggestion.
- Not applicable: the indicator does not apply to the assessed resource. This is informational and does not fail the check.
Missing evidence does not mean that data is not FAIR. Likewise, FAIR does not mean open: authenticated or controlled access can support the Accessible principle when it is clearly described.
Supported metadata
ACORN performs native FAIR assessment for Research Activity Data (RAD), DataCite, DCAT, Huwise, InvenioRDM, and RAiD metadata. Other input standards receive a single suggestion explaining that native assessment is not supported.
For RAD, each item in meta.outputs is assessed as a separate resource. Activity-level metadata supplements each output. A command that assesses several resources prints each resource profile and a pooled profile; pooling adds indicator counts without weighting RDA priorities.
Existing link-check results are reused as resolution evidence. ACORN does not make a second request for FAIR assessment. When link checks are disabled, skipped, or offline, resolution indicators remain indeterminate unless other evidence establishes their state.
Natural-language evidence
Some evidence appears in prose rather than structured fields. Rules for access-on-request language, license wording, and unsupported compliance claims belong in ACORNâs external Science Vale package because they require sentence-level context. Those rules should remain conservative: controlled access can be FAIR, and a claim that data is FAIR is not itself evidence that every indicator is supported. ACORNâs bundled package reference should only move to a release after those rules are published and verified.
Reading output
The detailed console view uses the same located diagnostic format as other check categories. Its heading contains the RDA indicator ID, principle, and priority. The message describes the evidence or the action needed to strengthen support.
Terse output keeps ACORNâs three columns: location or resource, severity, and remediation. Machine-readable details follow the message as rule, state, and priority values. Profile tables are intentionally omitted in terse mode.
CSV output adds one stable fair column containing compact rule, principle-indicator, evidence-state, and priority metadata. The column is empty for checks outside the FAIR category. Detailed console output adds a separate per-resource FAIR profile table after the issue summary.
Use --all to include supported, indeterminate, and informational indicator results. Use --skip fair to omit the category.
Rooted in Category Theory
đ± Small laws can support large systems. ACORN borrows a few practical ideas from category theory and abstract algebra to combine diagnostics, transform configuration, and keep effects at clear boundaries.
In a nutshell
ACORN uses a few ideas from category theory to combine results predictably, keep transformations simple, and separate pure logic from side effects.
Why Composition?
ACORN reads research records, validates them, runs several kinds of analysis, and presents the resulting diagnostics through multiple interfaces. Those pieces need to combine without losing failures, changing report order, or coupling portable calculations to files, processes, and network access.
Category theory supplies a language for composition. Abstract algebra supplies structures such as monoids. The subjects are related, but the terms are not interchangeable. ACORN draws on both while keeping their use deliberately small:
| Idea | Practical meaning in ACORN |
|---|---|
| Composition | Connect transformations or combine partial results. |
| Identity | An empty value that changes nothing when combined. |
| Associativity | Regrouping combinations does not change the result. |
| Monoid | One value type with an associative combination and an identity. |
| Endomorphism | A transformation from a type back to the same type, such as ValeConfig -> ValeConfig. |
| Applicative style | Accumulate results from independent computations without making one result the input to the next. |
These names describe useful laws and boundaries. ACORN does not expose generic Category, Monoid, or Applicative traits. A concrete operation earns its place when callers use it and its laws make changes safer.
Ordered Checks
Analyzer operations already return an ordered CheckBatch. An empty batch contributes nothing, while combine preserves every check from left to right:
let checks = schema_checks
.combine(link_checks)
.combine(prose_checks);
CheckBatch::empty() acts as the identity:
empty + checks = checks = checks + empty
Combination is associative:
(schema + link) + prose = schema + (link + prose)
ACORN has tests for both laws and for insertion order. Combination is not commutative: schema + link and link + schema contain the same checks in a different report order. That intentional distinction lets callers regroup partial work without sacrificing deterministic output.
The portable schema ValidationReport has a similar collect-all shape. Independent field rules contribute ordered issues to one flat report. Dependent whole-value and asynchronous rules can still be skipped after field errors when they cannot produce meaningful diagnostics from an invalid prerequisite.
Additive Summaries
Analyzer diagnostics are summarized by an additive CheckSummary monoid that separates the domain count from its presentation:
#[derive(Clone, Copy, Default)]
struct CheckSummary {
schema: usize,
link: usize,
prose: usize,
quality: usize,
fair: usize,
readability: usize,
crosswalk: usize,
}
impl CheckSummary {
fn combine(self, other: Self) -> Self {
Self {
schema: self.schema + other.schema,
link: self.link + other.link,
prose: self.prose + other.prose,
quality: self.quality + other.quality,
fair: self.fair + other.fair,
readability: self.readability + other.readability,
crosswalk: self.crosswalk + other.crosswalk,
}
}
}
CheckSummary::zero() is the identity, combine is associative, and counts() exposes ordered domain data without prescribing a presentation. Laws are tested in crates/acorn-lib/src/analyzer/tests/mod.rs. Partial reports can therefore be summarized independently and reduced to one value:
let total = reports
.iter()
.map(|report| CheckSummary::from(report.checks().as_slice()))
.fold(CheckSummary::zero(), CheckSummary::combine);
The CLI renders total as a table while WebAssembly serializes it for JavaScript. The domain value defines what the counts mean; each interface owns its labels and layout. This monoid does not merge with the separate discovery summary, which counts different things.
Independent Checks, Dependent Steps
Applicative-style validation applies when several checks receive the same input and none needs another checkâs output:
ââ schema check ââ
research input ââââ link check ââââŒâ ordered report
ââ prose check âââ
Every branch can contribute diagnostics even when another branch reports a failure. The checks may execute sequentially or concurrently; independence does not require parallelism. Their declared order can still determine the order of the combined report.
Dependent work grows differently:
bytes â deserialize â validate value â resolve identifiers
Identifier resolution cannot consume a value that failed to deserialize. Hiding that dependency behind collect-all machinery would make the control flow less accurate. ACORN keeps prerequisite chains in ordinary Result control flow and reserves applicative-style accumulation for genuinely independent work.
Schema validation follows this distinction via ordered ValidationReport accumulation of independent branches, with whole-value and async rules skipped after prerequisite field errors. Analyzer orchestration likewise traverses selected categories in declared order through shared Analysis::check and analyze<T> collection. Each category can retain its own failures, while parse, validation, and resolution prerequisites remain ordinary Result chains. CLI --exit-on-first-error remains an outer reporting policy rather than changing the collection contract.
Context Through Composition
ACORN becomes context-aware by composing partial views of the same research activity. Schema, link, prose, quality, readability, and crosswalk checks each answer a different question about one input. Their results retain their category and order when combined, so the final report carries more context than a single pass or fail result. A caller can see what ACORN observed, which rule produced the observation, and where it belongs in the record.
Prerequisite chains determine when ACORN has enough context for the next operation. Deserialization must produce a typed value before validation can interpret its fields, and identifier resolution needs a valid identifier before it can add external evidence. This ordering prevents a later step from treating malformed input as meaningful context.
Pure transformations and explicit effect boundaries keep that context consistent across interfaces. The CLI and WebAssembly can render the same ordered checks differently without changing what the checks mean. Network and filesystem operations may add evidence or materialize a result, but they do so after the portable transformations have established the value being carried forward.
Normalize, Then Materialize
An endomorphism transforms a value back into the same type. Vale configuration normalization already uses that shape (crates/acorn-lib/src/analyzer/host/vale.rs:89):
ValeConfig â normalize packages â merge policy â deduplicate â ValeConfig
Each pure step (normalize_packages host/vale.rs:107, merge_policy 115, deduplicate 124) is tested independently and composed in declared order as normalize() (host/vale.rs:89 fold; tests/mod.rs:787 ordering/idempotence). Package-source transformation resolve_package (host/vale.rs:94) trims input, preserves paths and URIs, and expands named Vale packages. The normalized value is then passed to deterministic ini construction before host code performs release discovery and writes the configuration to disk. Offline materialization selects the pinned fallback (DEFAULT_VALE_PACKAGE_URL / vale-package at v0.0.1) without release discovery.
Host operations discover remote releases, select fallbacks, create directories, write the INI file, and launch Vale only after normalization (host/runtime/mod.rs:217 check_prose_for, 728 StaticAnalyzer<ValeConfig>, 1005 sync). Network and filesystem operations are effects, not configuration normalization. Keeping that boundary visible supports ACORNâs portability and offline guarantees.
A consuming method implemented with local mut is not automatically impure from its callerâs perspective. A builder that consumes and returns a value may still compose cleanly. The meaningful question is whether the transformationâs result depends on hidden external state.
Avoid Unnecessary Abstraction
Category-inspired design is a constraint, not a destination. ACORN does not need:
- a generic category, monoid, or applicative framework;
- an abstraction used by only one call site;
- concurrency merely because operations are independent;
- algebraic terminology in user-facing diagnostics;
- effectful work disguised as a pure transformation; or
- a rewrite of clear
Result, iterator, or builder code.
The practical test is simple: does an operation have an identity, an associative combination, or a pure transformation boundary that real callers use? If so, naming and testing that law can provide strong roots for later changes. If not, a direct function is healthier.
Current Direction
| Pattern | Status | Intended benefit | Evidence |
|---|---|---|---|
Ordered CheckBatch combination | Implemented | Flatten partial analyzer results without losing order. | check.rs:279 empty / 289 combine; tests/mod.rs:21,26,36 |
Ordered ValidationReport accumulation | Implemented | Report independent schema failures together while preserving dependent skips. | acorn_schema::validation::ValidationReport + acorn_core::validation derive |
| Additive analyzer summary | Implemented | Calculate once and let each interface render its own representation. | check.rs CheckSummary::zero / combine / counts; CLI and WASM host formatters; analyzer law tests |
| Applicative vs dependent orchestration | Implemented | Collect independent categories while preserving prerequisite chains (bytes â deserialize â validate â resolve). | host/service/mod.rs Analysis::check, analyze<T>, and analyze_paths; focused collect-all tests |
| Unified link evidence and evaluation | Implemented | Preserve completed resolution outcomes under offline policy while gating new URL reachability. | host/runtime/mod.rs LinkEvidence / evaluate_link_evidence; host/service/mod.rs composition entry point |
| Vale configuration endomorphisms | Implemented | Separate deterministic normalization from host effects. | host/vale.rs:89 normalize pipeline; tests/mod.rs:787,854 |
These patterns give ACORN a stable way to accumulate context without losing its source, category, or order. Composition explains how the branches fit together; the next question is âŠBut Is It Agentic?.
âŠBut Is It Agentic?
ACORN is developing agent capabilities through Intelligence in Depth (IID), an architecture that builds on deterministic automation with prompts, workflows, context, memory, and agent supervision. Each layer remains useful on its own, and a system can stop at the shallowest layer that meets its needs, including layer 0 without a model call.
Note
IID terminology is internal to ACORN and is being prepared for formal publication in the Journal of Open Research Software (JORS). Cite this page as a pre-publication description and contact the authors about prior-art claims.
In a nutshell
IID organizes automation and model-assisted work into seven layers, numbered 0 through 6. Layer 0 uses schemas, validators, conversion code, and other deterministic operations. Higher layers add model capabilities up to a supervised agent harness. The architecture supports local operation and keeps durable work in user-controlled files.
IID adapts defense in depth, an information security strategy that combines people, technology, and operations across multiple layers.1 It distributes intelligence across explicit rules and deterministic code, reusable prompts, controlled workflows, skills and context, memory, and an interoperable agent harness.
The arrows show composition and control flow. A task can finish at layer 0, and higher layers can reuse its operations to transform data and check inputs and outputs. IID is distinct from the ASPECT maturity scale. IID describes layered control, while autonomy describes how humans and machines divide responsibility.
Principles
IID uses two principles across every layer:
- Local-first operation keeps data, models, validation, and orchestration on the userâs machine by default. Network and remote services remain explicit choices.2
- File over app keeps durable instructions, context, state, and results in files that users can retrieve, inspect, copy, modify, version, preserve, and move between applications.3
Together, these principles support user sovereignty: practical control of project artifacts without dependence on continued access to a particular application or provider. Files remain the source of truth when model APIs or protocols connect IID to external capabilities. Applications, agents, databases, and remote services can operate on those files without becoming the only authoritative copy. The Model Context Protocol (MCP) can give agents access to prompts, resources, and tools.4 The Agent Client Protocol (ACP) can let clients communicate with and supervise external agents.5
Here, sovereignty describes user agency over project artifacts. It does not determine intellectual property ownership, national data-residency rules, or institutional, community, and Indigenous research-data governance. This control also brings responsibility for backups, access control, and long-term preservation.
Local-first operation can include remote services when users select them. It differs from portability, which describes where a complete capability can run after accounting for model, tool, and service dependencies. Databases may provide rebuildable indexes and operational storage. Credentials belong in environment variables or dedicated secret stores, not portable project files.
Context awareness in IID
Within IID, context awareness means that a model or workflow receives the structured information needed for its task. For ACORN, that can include a research record, its schema, persistent identifiers, provenance, relationships, source material, prior decisions, validation results, and allowed tools.
This supplied context gives a model evidence for interpreting the project and tracing connections between records. It can also expose missing fields, conflicting observations, or unsupported relationships. The harness must preserve the boundary between recorded evidence and model inference so generated suggestions do not become authoritative data without validation or review.
How IID guides ACORN
ACORNâs layer 0 includes schema validation, identifier checks, formatting, metadata conversion, linking, and artifact generation. These operations use explicit rules and code without requiring model inference. AI can consume or produce data around those operations, while the deterministic rules provide validation and provenance.
IID guides ACORN development in these ways:
- Use layer 0 when schemas, validators, and conversion code can complete the task. Its results also provide machine-checkable context for model-assisted work.
- Prompts, skills, model APIs, local-model configuration, and future tools remain useful separately and can be composed when a workflow needs them.
- Iteration has exit criteria and budgets. Memory has provenance and lifecycle rules. Tools have permissions, and consequential actions require validation or human approval.
- Core operations and locally available models continue to work without a remote AI service. Network use respects ACORNâs offline boundary.
- Research records,
.prompttemplates,SKILL.mdinstructions, configuration, provenance, and generated artifacts remain portable files under user control. Users can inspect and version them independently of the current application.
MCP and ACP are optional extensions. MCP defines what context and capabilities an agent can access. ACP defines how a client communicates with and supervises an agent. Skills remain portable instruction and resource packages independent of both protocols, while model APIs provide direct model invocation.
| Optional extension | Initial ACORN role | Purpose |
|---|---|---|
| Protobuf/gRPC | Server and client library, available | Expose the shared operation registry through a versioned binary contract and establish reusable transport, policy, deadline, and cancellation boundaries for protocol integrations. |
| MCP | Server and allowlisted client, available | Let external agents call deterministic ACORN tools, and let ACORN applications call configured remote MCP tools through bounded one-operation sessions. |
| ACP | Client, planned | Let ACORN invoke and supervise interchangeable agents, beginning with OpenCode. |
| OpenAI-compatible API | Client, available | Let ACORN applications call a model server through supported OpenAI-style HTTP endpoints and JSON formats without requiring a full agent. |
The Protobuf/gRPC transport is an implementation stepping stone for ACP and MCP integrations. It proves that protocol adapters can share registered operations, validation, effect metadata, authentication context, offline and mutation policy, and bounded operation errors. Its transport adapter also establishes deadline and cancellation handling. ACP sessions and MCP tool semantics remain native to their respective protocols rather than being encoded as gRPC calls.
See Intelligence in Depth layers for layers 0 through 6, examples, and current implementation status.
-
National Institute of Standards and Technology, âdefense-in-depth,â Computer Security Resource Center Glossary. The glossary traces the definition to CNSSI 4009-2015 and multiple NIST publications, including SP 800-53 Rev. 5. â©
-
Martin Kleppmann, Adam Wiggins, Peter van Hardenberg, and Mark McGranaghan, âLocal-first software: You own your data, in spite of the cloudâ, Ink & Switch, 2019, doi: 10.1145/3359591.3359737. â©
-
Steph Ango, âFile over appâ, 2023. â©
-
Model Context Protocol, âArchitectureâ and âServer featuresâ. â©
-
Agent Client Protocol, âArchitectureâ. â©
Intelligence in Depth layers
Intelligence in Depth (IID) organizes automation and model-assisted systems into seven layers, numbered 0 through 6. The layers are composable: use the shallowest sequence that reliably satisfies the task, starting with deterministic automation. See âŠBut Is It Agentic? for the architectureâs principles.
0. Deterministic automation
Explicit rules and code handle tasks with defined inputs, transformations, and acceptance criteria. Schemas describe accepted data structures, validators enforce constraints, and conversion code maps fields or serializes records according to known rules. With fixed inputs, rule versions, and configuration, these operations produce repeatable results without model inference.
For example, ACORN can validate a research record, normalize its formatting, or convert DataCite metadata to DCAT using implemented field mappings. Schema generation, identifier syntax and checksum checks, and artifact generation also belong here.
A task can finish at layer 0. A script or pipeline that composes deterministic operations stays at this layer; model workflow composition begins at layer 3. Higher layers can call layer 0 operations as tools and use the same validators to check model-generated data. Validation establishes conformance to the encoded rules; factual accuracy and ambiguous mappings may still require source evidence or human review. Conversions can be lossy, so their documented limitations and reported warnings remain part of interpreting the result.
1. One-time prompting
An application sends a direct instruction to a model through a library or API. This layer suits a single transformation or answer whose inputs and outputs are already defined.
For example, an application can send one research narrative to acorn-libâs OpenAI-compatible chat-completion API with the instruction âSummarize this activity,â then return the response.
âOpenAI-compatibleâ describes the connection format, not the model provider. A compatible server accepts supported OpenAI-style HTTP endpoints and JSON requests and responses. The server may be OpenAIâs service or another implementation, including llama-swap, vLLM, or LiteLLM. ACORN uses this format because local and hosted servers widely support it, which reduces custom client code.
2. Prompt templates
Prompt templates store reusable instructions in version-controlled .prompt files with defined inputs, configuration, and expected outputs. Googleâs Dotprompt specification documents this executable file pattern.1
For example, ACORN renders its embedded summarize.prompt template with a source narrative, maximum word count, and output structure so callers can reuse the same instructions.
3. Workflow composition and iteration
A workflow coordinates model calls, deterministic operations, and tools through explicit control flow. It may sequence, select, repeat, delegate, or combine bounded tasks, but the application defines its path and safeguards. Anthropic distinguishes these predefined workflows from agents that direct their own process and tool use.2
Repeated workflows need clear exit conditions, measurable progress, state passed between calls when required, and limits on iterations, time, tokens, and cost.
A planned ACORN workflow could ask a model to address gaps in a research narrative, run deterministic validation, and pass remaining findings to another bounded attempt. It would stop when no high-severity issue remains or when it reaches an iteration, token, or time limit.
4. Skills, context, and capabilities
This layer assembles the instructions, research data, evidence, examples, tools, constraints, and current state needed for an invocation. Agent Skills package specialized instructions and optional resources into portable, version-controlled directories.3 MCP can connect an agent to live prompts, resources, and tools.4
This is the layer where an application makes a model context-aware for a specific task. The model can use supplied relationships and provenance to explain connections or identify gaps, but it cannot treat an unsupported inference as source data.
For example, an agent can load the ACORN skill with a ResearchActivity schema, source record, validation results, and allowed tools before proposing a correction. The local stdio MCP server exposes the same canonical tool registry and deterministic checks through a standard interface.
5. Connected memory
Connected memory preserves selected state across iterations, sessions, or tasks. Useful memory includes attributable facts, decisions, provenance, and prior results. Its origin, availability, modality, and quality are part of its data profile.
A planned workflow could retrieve a previously reviewed project identity, identifier mapping, and provenance record instead of reconstructing them from conversation history.
6. Agent harness and interoperability
An agent harness orchestrates models, skills, tools, workflows, context, memory, permissions, validation, recovery, observability, and human approval. It owns resource budgets and stopping conditions. Permissions and approvals shape autonomy, while perception, state, actions, and feedback shape motivity. ACP can standardize sessions, streamed updates, and permission requests between a harness and external agents.5
ACORN launches OpenCode through ACP for bounded fix suggestions, sends the normalized check results as context, streams progress, and applies a fixed permission policy. The returned suggestions remain reviewable data; acorn check does not apply them.
ACORNâs Protobuf/gRPC transport provides part of the foundation for that work. Its shared operation registry, policy context, authentication, deadlines, and cancellation behavior can support more protocol adapters. ACP will still use ACP sessions, streaming, and permission messages, while MCP keeps its own tool discovery and invocation semantics.
Applying the principles
| # | IID layer | Local-first, file over app, and user sovereignty |
|---|---|---|
| 0 | Deterministic automation | Validate and convert data locally using schemas and code. Keep inputs, outputs, rule versions, and configuration inspectable and versionable so users can reproduce the work without a model service. |
| 1 | One-time prompting | Prefer a local model when it satisfies the task. Make remote transmission explicit. Let users save the prompt and result independently of the model service. |
| 2 | Prompt templates | Keep reusable instructions in portable, version-controlled .prompt files. |
| 3 | Workflow composition and iteration | Persist inputs, control flow, exit criteria, budgets, checkpoints, and results so the workflow remains inspectable and resumable. |
| 4 | Skills, context, and capabilities | Package reusable instructions and references in SKILL.md directories. Use MCP for live resources and tools while keeping durable context in files. |
| 5 | Connected memory | Preserve selected facts, decisions, and provenance in inspectable records. Databases may index them without becoming the only source. |
| 6 | Agent harness and interoperability | Configure workflows through files and CLI options. Treat applications and ACP agents as replaceable interfaces. |
Current ACORN support
| # | Layer | Status | ACORN support |
|---|---|---|---|
| 0 | Deterministic automation | Implemented | Schemas and validators, identifier checks, canonical formatting, metadata crosswalks, and artifact generation run without model inference. These operations are available through library APIs and commands such as acorn check, acorn format, and acorn export. |
| 1 | One-time prompting | Available as a library API | acorn-lib exposes completion, chat-completion, response, embedding, image, and audio operations through supported OpenAI-style HTTP endpoints and JSON formats. Applications decide when to invoke a model. ACORN does not provide a general-purpose interactive prompt command. |
| 2 | Prompt templates | Implemented | acorn-lib embeds and renders versionable .prompt templates for summarization, translation, teaching, simple explanation, claim extraction, and gap finding. Templates accept source text, output limits, sampling parameters, and stop sequences. |
| 3 | Workflow composition and iteration | Not implemented | ACORN does not provide a general model workflow executor with explicit control flow, exit criteria, evolving state, progress checks, and resource budgets. File watching and service polling are operational loops, not IID model workflows. |
| 4 | Skills, context, and capabilities | Implemented | acorn skill distributes task-oriented instructions. acorn serve mcp, MCPB packaging, and opt-in client synchronization expose the canonical policy-filtered tool registry. acorn mcp discovers and invokes configured remote tools without automatically re-exporting them. |
| 5 | Connected memory | Building blocks available | ACORNâs local database persists research candidates, activity history, model metadata, and provenance-bearing records. ACORN does not manage conversational memory, cross-session agent recall, or memory selection and retention policies. |
| 6 | Agent harness and interoperability | Partially implemented | ACORN manages local model metadata and weights, synchronizes model configuration into OpenCode, VS Code, Goose, and llama-swap, distributes its agent skill, runs a GitLab bot service, provides a versioned gRPC boundary over its shared operation registry, and supervises one-shot OpenCode sessions through ACP. It does not provide a unified general-purpose agent runtime. |
ACORN can develop each layer independently. Layer 0 remains useful without any model integration, and its deterministic operations can become tools for higher layers. Prompt evaluation can precede workflow execution, and memory provenance can be defined before agent state is retained.
-
Google, Dotprompt specification and Dotprompt reference documentation. â©
-
Anthropic, âBuilding effective agentsâ, 2024. â©
-
Agent Skills, Specification. â©
-
Model Context Protocol, âArchitectureâ and âServer featuresâ. â©
-
Agent Client Protocol, âArchitectureâ. â©
ZON serialization
ACORN supports ZON as a compact serialization of the JSON data model. ZON is a file format, not a research-metadata standard: the same Research Activity Data (RAD) schema and validation rules apply whether a record is stored as JSON, YAML, Markdown, or ZON.
Use the .zonf extension and provisional text/zonf media type. ACORN deliberately does not treat .zon as a ZON file because that extension is used by other formats.
meta{title:Example activity,keywords:"[research,metadata]"}
contact{email:researcher@example.org,name:Researcher}
The portable acorn_schema::standard::zon codec emits a deterministic strict profile: object keys and table columns are sorted, booleans use T and F, null uses null, line endings are LF, and output has no trailing whitespace or final newline. Decoding also accepts the selected aliases used by the pinned TypeScript reference implementation, including @N root-table headers, single-quoted strings, exponent numbers, and case-insensitive boolean and null aliases. Encoding always returns to the canonical form.
ACORNâs profile is pinned to upstream commit 1b5917dbbf254ba11fb217a378d8ea05a17598d2. It supports JSON primitives, objects, arrays, compound arrays, and uniform-object tables. It rejects the separate labeled v2 syntax and enforces bounded document, line, depth, array, and object sizes.
For tests/fixtures/data/valid_project/index.json, the compact JSON data is 3,018 bytes, canonical ZON is 3,302 bytes, and the checked-in pretty JSON is 4,385 bytes. These are byte-size comparisons only; token counts depend on the selected model and tokenizer.
Command-line use
Valid .zonf RAD files participate in normal discovery, checking, formatting, exporting, crosswalking, repository workflows, and GitLab review:
acorn check activity.zonf
acorn format activity.zonf
acorn export activity.json --format zon
acorn export datacite.zonf --format zon --from datacite --to dcat
--format zon writes .zonf. Check reports keep their existing console, JSON, Markdown, or YAML output formats; ZON support describes the checked input and does not add a ZON diagnostic-report format.
Model-facing prompt data
Prompt instructions remain Markdown. PromptHydrator appends the complete serializable data object once in a fenced canonical ZON block by default. Library callers can select deterministic pretty JSON with PromptDataFormat::Json when troubleshooting.
This setting changes only the text supplied to the model. ACP continues to use its official JSON-RPC wire protocol, and OpenAI-compatible APIs continue to use their JSON HTTP request envelopes; both adapters forward the already hydrated prompt body verbatim.
Command Line Reference
The command pages explain workflows and common decisions. For the exact options in the version you installed, run:
acorn help
acorn <command> --help
The repositoryâs generated option reference is rebuilt from the same Clap definitions as the binary. Documentation checks keep its top-level command list aligned with the curated pages.
Configuration
Flat file
Application Configuration for Research Enablement (ACRE) is the versioned configuration standard used by ACORN and reusable by other research-enablement applications such as Xylem. ACRE files may use JSON, JSONC (JSON with Comments), YAML, or RON.
The current schema version is 2.0.0. New files should declare it with the schemaVersion property. Files that omit the property are interpreted as version 2.0.0. Other explicit versions, including a v prefix, are rejected. There is no backwards compatibility: version 1.0.0 documents are rejected.
Attribute names are snake_case in every format â JSON, JSONC, YAML, and RON â so one document shape is valid everywhere. Pre-existing camelCase attributes such as schemaVersion keep their current spelling. RON uses string-keyed maps and string enum values; () represents an explicit null.
The optional auth attribute uses the frozen tenantId, clientId, defaultResource, sitePath, libraryPath, and itemPath field names in every format. Named profiles retain declaration order across JSON, JSONC, YAML, and RON, so the first profile is the default for future auth commands. Auth configuration is non-secret: place no password, client secret, access token, refresh token, or device code in ACRE. See the synthetic SharePoint example for profile and source fields. The schema and source matching are available now; CLI auth commands and profile resolution are implemented separately.
Example
.acorn.json file
{
"schemaVersion": "2.0.0",
"buckets": [
{
"name": "bessd",
"source": {
"provider": "gitlab",
"id": 17603,
"uri": "https://code.ornl.gov/research-enablement/buckets/bessd"
}
}
],
"models": [
{
"name": "qwen-0.5b",
"source": {
"provider": "huggingface",
"location": "https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF"
},
"quantization": [
"Q4_K_M"
],
"gpuMemory": "4GB"
}
],
"runners": [
{
"name": "oklahoma-runner",
"description": "Oklahoma Docker Runner",
"repository": {
"provider": "gitlab",
"id": 24758,
"uri": "https://code.ornl.gov/research-enablement"
},
"type": "group",
"executor": "docker",
"gpuEnabled": false,
"tags": ["docker", "oklahoma"],
"runUntagged": false,
"host": "code.ornl.gov",
"target": {
"host": "oklahoma"
},
"dockerImage": "gitlab/gitlab-runner:latest"
}
]
}
The runner example includes every user-configurable runner field. The top-level runner host is the GitLab domain override, while target.host is an SSH URI or alias for the machine running Docker. The shorter "target": "oklahoma" form is equivalent to "target": {"host": "oklahoma"}. Bare aliases use the local SSH client configuration and are normalized to ssh://oklahoma. Omit target to run the container locally.
Set GITLAB_TOKEN, PRIVATE_TOKEN, or CI_JOB_TOKEN, then create every configured runner with:
acorn create runner
Runner containers always start detached. Command-line --host or --context overrides target.host for every runner in that invocation.
For a shell runner, set "executor": "shell" and omit the container target:
{
"schemaVersion": "2.0.0",
"runners": [
{
"description": "Windows shell runner",
"repository": {
"provider": "gitlab",
"id": 12345,
"uri": "https://code.ornl.gov/research-enablement"
},
"type": "group",
"executor": "shell",
"tags": ["windows-x86_64"],
"host": "code.ornl.gov"
}
]
}
Run acorn create runner on the intended shell host with GitLab Runner installed and a running service. The registration process must write the same config.toml that the service reads. GitLab Runner supports CONFIG_FILE to select that path; ACORNâs --config selects the ACRE file instead. Shell jobs run locally on the host under the runner service account. See GitLab Runner commands and the shell executor.
.acorn.jsonc file
{
// ACORN bucket configuration
"buckets": [
{
"name": "bessd",
"source": {
"provider": "gitlab",
"id": 17603,
"uri": "https://code.ornl.gov/research-enablement/buckets/bessd"
}
},
]
}
Tip
.jsoncfiles permit//line comments,/* block */comments, and trailing commas. All other syntax follows standard JSON rules. Rename a.jsonfile to.jsoncif you need comments. [!TIP] ACORN looks for.acorn.json,.acorn.jsonc,.acorn.yaml,.acorn.yml, then.acorn.ronin the current working directory. You can also specify a different configuration file using the--config <FILE>flag when running ACORN commands.
Validate canonical filenames directly; ACORN detects ACRE from the exact filename:
acorn check .acorn.json
For custom filenames or standard input, select the standard explicitly:
acorn check settings.jsonc --standard acre
cat settings.yaml | acorn check --paste --format yaml --standard acre
Export the JSON Schema with acorn export --schema --standard acre.
Bucket sources
Repository-backed buckets accept a bare path or HTTPS URL when no label is needed:
{
"buckets": [
"./science",
"https://github.com/example/research-activities",
"https://gitlab.example/research/science"
]
}
Use a source string to add a name or description:
buckets:
- name: science
description: Reviewed science activities
source: https://gitlab.example/research/science
Provider-specific fields use the detailed source form. The legacy repository and codeRepository keys remain accepted as input aliases:
{
"buckets": [{
"name": "science",
"source": {
"provider": "gitlab",
"id": 42,
"location": "https://gitlab.example/research/science"
}
}]
}
Do not specify more than one of source, repository, and codeRepository on the same bucket. Concise remote sources must be credential-free HTTPS URLs; use local paths or file: URIs for local buckets.
MCP clients
The optional mcp map configures outbound MCP servers by stable alias. Every server requires a tagged transport and a non-empty tool allowlist:
mcp:
research-tools:
transport:
type: child-process
command: research-mcp
args: [serve, --stdio]
environment:
RESEARCH_TOKEN: RESEARCH_MCP_TOKEN
allowed:
resolve_identifier:
effects: [network-read]
max_output: 256KB
timeout: 20
Child-process environment values and Streamable HTTP bearer_token_env values are environment-variable names, not credentials. Streamable HTTP requires HTTPS except on localhost or a loopback IP address:
mcp:
institutional-tools:
transport:
type: streamable-http
url: https://mcp.example.org/service
bearer_token_env: INSTITUTIONAL_MCP_TOKEN
allowed:
lookup_record:
effects: [network-read]
Supported effects are credentials, destructive, filesystem-read, filesystem-write, inference, mutation, network-read, and process. Duplicate effects and zero time or output limits are rejected. Omitted tool limits default to 30 seconds and 1 MiB. See acorn mcp for runtime policy and examples.
.env file and Environment Variables
The ACORN CLI tool can also be configured using .env files and/or environment variables.
Enrichment providers use optional API tokens and host overrides. See Metadata enrichment for the complete provider-by-provider table and defaults.
Example
.env file
ACORN_LOG_LEVEL=info
READABILITY_METRIC=ari
MAX_ALLOWED_ARI=12
ACORN_CITATION_FORMAT selects the DOI citation family used by acorn gather --raw --resolve when --citation-format is not provided. Accepted case-insensitive values are apa, chicago, harvard, ieee, mla, and vancouver; IEEE is the default. The precedence is CLI option, environment variable, then IEEE. An unsupported environment value emits a warning and falls back to IEEE.
$env:ACORN_CITATION_FORMAT = "apa"
acorn gather report.pdf --raw --resolve
Commands
- â Check
- đïž Create
- đšââïž Doctor
- đ Diff
- đ„ Download
- đ€ Export
- đ€ Format
- đŸ Gather
- đ„ Import
- đ§ Infer
- đ„ Intake
- đžïž Link
- đ MCP
- đ Report
- đĄ Serve
- đ§© Skill
- đ§Ź SWHID
- đ Sync
- đ„ïž TUI
Command workflows
Research activity data
Persistent identifiers
Local AI and agents
ACORN keeps its core research-data commands deterministic while offering optional tools for local AI and agent workflows:
import modelcatalogs GGUF metadata without downloading weights.download modelselects and downloads local GGUF weights.syncconfigures supported agent and inference applications to use those models.skillgives compatible AI agents ACORN-specific operating instructions.inferuses Needle for free-form tool selection;infer runhydrates a known embedded prompt and runs it through ACP or an OpenAI-compatible endpoint.mcpdiscovers and invokes tools explicitly approved in application configuration.
â Check
In a nutshell
Validate research metadata structure, links, FAIR evidence, and prose with
acorn check <PATH>.
Example Use
# Check a specific research activity index
acorn check path/to/project/index.json
# Check Markdown research activity data
acorn check path/to/project/index.md
# Check ZON research activity data
acorn check path/to/project/index.zonf
# Check a Citation File Format file
acorn check path/to/project/CITATION.cff
# Check Dublin Core in any supported RDF syntax
acorn check path/to/metadata.jsonld
acorn check path/to/metadata.rdf
acorn check path/to/metadata.ttl
# Check a KitOps authoring file or resolved ModelKit configuration
acorn check path/to/model/Kitfile
acorn check path/to/model/modelkit.json
# Check a remote OCI model artifact
acorn check oci://registry.example.org/models/qwen:latest
# Validate canonical or custom ACRE configuration
acorn check path/to/project/.acorn.jsonc
acorn check path/to/project/settings.yaml --standard acre
acorn check path/to/project/.acorn.ron
acorn check path/to/project/settings.ron --standard acre
printf '{"schemaVersion":"2.0.0"}' | acorn check --format ron --standard acre
# Check prose, readability, and links extracted from a PDF
acorn check path/to/report.pdf
# Check all research activity data in a directory
acorn check path/to/project/
# Check a remote document
acorn check https://example.org/project.json
# Check text from standard input
printf 'Text to check' | acorn check
# Check text copied to the system clipboard
acorn check --paste
# Force clipboard content to YAML and validate it as RAD
acorn check --paste --format yaml --standard rads
HTTP and HTTPS inputs are downloaded to a temporary file and checked using content-based format detection, with the URL extension as a fallback. This supports extensionless PDF URLs. Remote inputs require network access and are rejected in global --offline mode.
Computation complexity
Checking a complete Research Activity document validates every aspect.computation[*].stages[*].complexity.bounds[*] time or space expression. Syntax errors, undeclared names when a variables map is present, empty bounds, and repeated time or space resources retain the existing schema-check category and appear at the nested metadata path. For example:
acorn check path/to/project/index.json --output json
The JSON check envelope reports unsuccessful schema findings for invalid bounds; the human output shows the same metadata location. A valid document keeps its authored expressions unchanged. This checks notation and declarations, not whether the claimed algorithmic bound is correct. See Computation for the accepted grammar.
Bounded fix suggestions
--suggest-fixes analyzes the input once and sends normalized failing checks to the selected inference backend. Suggestions are reviewable data only; this command never builds or executes a fix plan. ACP through OpenCode is the default. Use --backend ollama --model MODEL for a local Ollama server, or --backend openai --model MODEL for another OpenAI-compatible endpoint. Use --output json for a single object containing normalized checks and the grouped fix report. Suggestion mode cannot be combined with --watch, and check failures retain their normal exit status.
ACORN recognizes .md and .markdown research activity files by their schema: acorn/research-activity YAML frontmatter discriminator. Legacy Markdown previously exported by ACORN is also accepted. Ordinary Markdown remains plain text and is not selected by RAD directory discovery.
Controlled-vocabulary checks
For Research Activity Data, prose checks also compare authored values in meta.keywords, meta.technology, meta.partners, meta.funders[*].name, contact.organization, and contact.affiliation with ACORNâs embedded vocabularies. The default --fuzzy relaxed profile reports high-precision relaxed-only canonical changes as warnings. Use strict matching or disable these findings without disabling other prose checks:
acorn check activity.json --fuzzy strict --all
acorn check activity.json --fuzzy off
acorn check activity.json --fuzzy relaxed --output json
The three modes retain the same exact lookup policy:
offemits no vocabulary findings.strictemits non-failing Info checks for exact alias, identifier, uniquely normalized, and strict fuzzy canonical changes. Info checks follow the existing--allvisibility rule.relaxedemits the same Info checks and Warning checks for changes accepted only by the relaxed profile. Ambiguous and resource-limited evaluations are Warnings in both active modes.
Warnings use the normal check failure rules, so they are visible by default and produce the usual nonzero result unless --no-fail is selected. Unmatched and invalid values do not produce vocabulary findings; schema and other prose rules still apply.
The stable rule IDs are vocabulary.canonical-change, vocabulary.relaxed-match, vocabulary.ambiguous, and vocabulary.resource-limited. Human output names replacements or bounded ambiguity candidates without displaying numeric scores. JSON and YAML output attach a versioned vocabulary_advisory with the original value, source locator, effective mode, vocabulary and policy revisions, completeness, method and algorithm variant, similarity evidence, and up to three candidates.
When --suggest-fixes is enabled, a complete and unambiguous accepted result becomes a deterministic safe-automatic replacement generated by ACORN. The inference backend cannot alter that replacement. Ambiguous and resource-limited findings are context only and do not receive document-change proposals.
Checking text from standard input or the clipboard
When no file, directory, Git selector, filter, or ignore pattern is supplied, acorn check reads non-empty piped standard input automatically. Use --paste to read text from the system clipboard instead. ACORN infers JSON, JSONC, RAD Markdown, RAD YAML, and ZON; other content is checked as plain text.
Use --format to override inference with cff, json, jsonc, jsonld, markdown, rdfxml, text, turtle, yaml, or zon. Combine it with --standard to select the schema or analyzer independently:
cat metadata.jsonc | acorn check --format jsonc --standard datacite
acorn check --paste --format cff --standard cff
printf '# Notes\n\nText to check.' | acorn check --format markdown --standard text
cat activity.zonf | acorn check --format zon --standard rads
cat settings.yaml | acorn check --format yaml --standard acre
cat metadata.ttl | acorn check --format turtle --standard dcmi
The aliases json-ld, md, rdf-xml, ttl, txt, yml, and zonf are accepted. --format applies only to piped standard input and clipboard content and conflicts with filesystem, Git, filter, and merge-request selectors. The option selects the input serialization only; check reports retain their existing output formats.
An explicit filesystem selection or --paste takes precedence over piped standard input. Empty implicit standard input preserves the existing behavior of checking the current directory. Clipboard input must contain non-whitespace text, and clipboard or standard-input checks cannot be combined with --watch.
Application Configuration for Research Enablement is auto-detected only for the exact filenames .acorn.json, .acorn.jsonc, .acorn.yaml, and .acorn.yml. Use --standard acre for custom filenames, standard input, or clipboard content. ACRE runs schema validation only; prose, readability, link, FAIR, quality, and crosswalk checks are not applicable.
Checking Dublin Core
ACORN accepts its native normalized graph JSON, compact or expanded JSON-LD, RDF/XML, and Turtle. The standard names dcmi and dublin-core are equivalent. Files ending in .jsonld, .rdf, .rdfxml, or .ttl are detected by syntax and extension; use --standard dcmi when ordinary .json contains the native graph form.
Dublin Core checks validate absolute term and resource IRIs, language tags, registered DCMI syntax, blank-node structure, and literal datatype rules. Prose and readability use title, alternative, description, abstract, tableOfContents, and subject literals. Link checks visit IRI-valued objects unless offline mode or --disable-website-checks suppresses them. FAIR assessment projects the graph into the common evidence model. Quality suggestions report declared DCMI domain or range guidance without treating that guidance as a schema error.
ACORN rejects remote JSON-LD contexts, relative IRIs, RDF-star quoted triples, and named graphs. This keeps decoding local and deterministic. Unknown absolute extension predicates and their values are preserved.
Checking OCI model artifacts
An explicit oci://registry/repository:tag or oci://registry/repository@sha256:... source selects the OCI model-artifact profile automatically. --standard oci is accepted but optional for these sources. A conflicting standard is rejected.
OCI checks resolve a tag to an immutable digest and inspect the registry descriptor, one unambiguous index child when present, the manifest, and a ModelKit or ModelPack configuration blob when required. Schema findings cover malformed references and distribution structures. Quality findings cover the supported artifact convention and declared model inventory. Use --all to display the resolved digest, package format, and selected or ignored layer counts.
The check is deliberately manifest-level. It does not transfer model-weight layers, inspect GGUF bytes, create an installation destination, verify signatures or attestations, or establish publisher identity. Deep layer verification remains part of model materialization. OCI checks require ORAS and network access; --offline rejects the target before invoking ORAS.
OCI sources cannot be combined with clipboard or standard-input content, local or HTTP paths, Git revision selectors, merge-request selection, watch mode, filters, configured workflow hooks, or fix suggestions. Only schema and quality categories apply, so selecting OCI does not install or synchronize Vale.
Checking Kitfiles and ModelKits
ACORN recognizes files named Kitfile as KitOps authoring YAML and resolved ModelKit JSON by its layer identity fields. A file named modelkit.json is treated as a ModelKit even when malformed, so validation errors use the correct schema. Directory and Git-change discovery include Kitfile alongside supported JSON files.
Kitfile and ModelKit checks reject unknown fields, duplicate keys, empty content placeholders, blank content paths, invalid path kinds, path collisions, malformed layer digests, and other modeled-value errors. Resolved ModelKit JSON must include a compressed digest for every local layer. An uncompressed diffId remains optional, but missing values are reported as quality warnings because ACORN cannot verify uncompressed layer integrity without them.
For an authoring Kitfile, quality checks also verify that every local content path exists, cannot traverse or resolve outside the Kitfile directory, and is ready to package. Referenced .mcpb files must be valid ZIP archives with a root manifest.json, required manifest identity and server fields, and an in-archive server.entry_point. Remote model and dataset references are not treated as local files.
Compatibility conditions remain warnings rather than schema errors: an unrecognized manifestVersion, a remoteHash ignored for a ModelKit dataset reference, and missing resolved diffId values. A standalone modelkit.json does not contain its OCI manifest, so acorn check can validate its structure and layer identity fields but cannot cross-check its config or layer descriptors against a registry manifest. ACORN performs those descriptor checks when downloading a ModelKit artifact.
Use --standard kitfile or --standard modelkit when a file uses an unconventional name or its content is too malformed for automatic detection. Use --skip quality to run format and schema validation without package-readiness or compatibility warnings.
Checking PDF documents
PDF files are discovered in directories and Git changes and are automatically analyzed as document text. ACORN extracts each text-bearing page once, caches the result for the duration of the process, and applies prose, readability, link, and extraction-quality checks. Diagnostics rendered against extracted text include the original one-based PDF page number when the matched text can be located.
Prose diagnostic line and column coordinates refer to the complete source file, not the subset of prose sent to the analyzer. For converted binary documents, coordinates refer to the complete extracted Markdown. When ACORN cannot map a finding to one unambiguous source location, it reports the finding without a line number.
The document standard can also be selected explicitly. The previous docx name and pdf are retained as aliases:
acorn check report.pdf --standard document
PDF extraction is limited to 100 MiB and 1,000 pages. Encrypted, malformed, and wholly image-based PDFs fail with a specific diagnostic. OCR is not bundled; when only some pages require OCR, ACORN checks the extractable pages and reports the skipped page numbers as quality warnings. Filenames are matched case-insensitively, including .PDF.
Watch mode
Use the global --watch flag to run immediately and repeat the check whenever the effective input changes:
acorn --watch check path/to/project/
acorn check --watch --watch-mode poll https://example.org/project.json
--watch-mode auto uses native filesystem notifications for local inputs and polling for remote inputs, with polling as a fallback when native notifications fail. Use --watch-mode poll for network-mounted paths, containers, WSL-mounted paths, or other filesystems where native events are unreliable. Configure polling with --poll-interval (-p), such as --poll-interval 5s. Press q or Ctrl+C to stop watching.
Before checking, ACORN synchronizes the extensions used by the selected prose analyzer and tries up to three times when synchronization fails. Both one-shot and watch-mode checks use the configured --poll-interval between attempts; it defaults to one second. Watch mode does not repeat synchronization on later file changes. If all attempts fail, the check exits; use --ignore-sync-failure to let watch mode continue with locally available analyzer extensions instead. Use --skip prose to skip prose analyzer synchronization and analysis entirely.
Checking CITATION.cff
ACORN recognizes a directly supplied .cff file as Citation File Format (CFF) data. You do not need to select the standard explicitly:
acorn check ./CITATION.cff
Use --standard cff when CFF data is stored with a .yaml or .json extension:
acorn check ./citation.yaml --standard cff
For CFF input, ACORN checks:
- Schema: Parses the YAML or JSON, rejects unknown fields, and validates modeled values such as dates, DOIs, URLs, identifiers, licenses, and nested author or reference data.
- Prose and readability: Analyzes the
title,abstract, andmessagetext. - Links: Checks repository, license, landing-page, DOI, URL identifier, and reference links.
Link checks require network access. Use acorn --offline check ./CITATION.cff or --disable-website-checks to skip them.
Note
Directory and Git-change discovery selects RAD
.json,.jsonc,.yaml,.yml,.md, and.zonffiles, but not.cfffiles. Pass eachCITATION.cffpath directly.
Check categories
The command can validate data against its schema, assess evidence of support for the FAIR principles, analyze prose and readability, check links, find inconsistent or incomplete data, and enforce naming or organization-specific conventions.1
FAIR checks evaluate all 41 indicators in the RDA FAIR Data Maturity Model. They report an evidence profile rather than a compliance grade. Native assessment is available for ACORN Research Activity Data, DataCite, DCAT, Dublin Core, Huwise, InvenioRDM, and RAiD metadata. See FAIR evidence assessment for the evidence states and output contract.
Customization options
Use command options to select or skip checks and to control when the command exits.
Include --exit-on-first-error to stop execution upon encountering the first error.
Bypass verifying the checksum of downloaded artifacts with --skip-verify-checksum2
Configure Vale
By default, ACORN uses a vale executable on PATH, reuses an ACORN-managed executable when available, or downloads its pinned Vale release into the platform cache directory. Generated configuration, synchronized styles, and vocabularies are stored alongside the managed installation rather than in the checked project.
Use --vale-directory <PATH> to select an existing installation containing vale (or vale.exe on Windows) and .vale.ini. ACORN treats this directory as read-only: it does not download, rewrite configuration, or run vale sync there.
In --offline mode, ACORN can use a custom, system, or previously cached installation, but it never performs release discovery, downloads, or synchronization. If no installation is available, the command reports how to provide one.
Skip checks
--skip schema: Skip schema validation checks--skip fair: Skip FAIR evidence assessment--skip prose: Skip prose quality checks--skip readability: Skip readability checks--skip schema,prose: Skip both schema validation and prose quality checks (this works for any combination of categories)--disable-website-checks: Disable all website-related checks (link integrity, etc.)
Note
--disable-website-checksis redundant whenacorn --offlineis used for commands that need to be run in offline environments.
Configure readability
Readability can be configured for desired metric and level by passing options directly to the command line or via a .env file. Command line options override .env settings.
--readability-metric <METRIC>: Specify which readability metric to use- Set
READABILITY_METRICin your.envfile to choose the readability metric. Default metric isfkgl(Flesch-Kincaid Grade Level). - Set
MAX_ALLOWED_FKGLin your.envfile to define the maximum acceptable FKGL score. Each metric has its own corresponding maximum score variable (e.g.,MAX_ALLOWED_ARIfor Automated Readability Index).
Example .env file
Configure ACORN to use the Coleman-Liau Index (CLI) readability metric with a maximum allowed score of 14.0 (default value is 12.0):
READABILITY_METRIC=cli
MAX_ALLOWED_CLI=14.0
Next stop:Â Normalize a checked record with Format.
-
See the readability module documentation for a full list of available readability metrics. â©
-
â ïž Skipping checksum verification may expose you to security risks. Use this option with caution. â©
đïž Create
In a nutshell
Create an ACORN-backed runner or bot with
acorn create <RESOURCE>.
Runner, bot, and MCP Bundle creation are available:
# Register and start a GitLab runner from ACORN configuration
acorn create runner
# Create a runner directly for a GitLab group
acorn create runner --group 12345 --description "Research runner" --name research-runner
# Register a local shell runner for a self-managed GitLab group
acorn create runner --no-config --group 12345 --description "Windows shell runner" --runtime shell --tags windows-x86_64 --repo code.ornl.gov
# Create a detached bot container for a GitLab project
acorn create bot 12345 --detach
# Package the running executable
acorn create mcp
# Package a release binary and update an authoring Kitfile
acorn create mcp --binary ./acorn --platform linux --kitfile ./Kitfile
Runner creation supports Docker, Podman, Apptainer, and local shell selection with --runtime. Shell registration runs gitlab-runner on the machine running ACORN; it does not create a container. Install GitLab Runner first and ensure its running service reads the config.toml written by registration. Set GITLAB_TOKEN, PRIVATE_TOKEN, or CI_JOB_TOKEN with runner-creation access. Use --repo for the GitLab domain. Shell jobs run on that host with the service accountâs permissions, so use a host dedicated to trusted jobs. See GitLab Runner commands and the shell executor.
Runner containers always start detached. A remote Docker daemon can be selected with --host or configured per runner with target.host; volumes then belong to the remote host. --host, --context, and target.host select container targets, not the GitLab domain or a remote shell host. See the full runner configuration for a config-only example.
Run acorn create <resource> --help for the exact authentication, runtime, and network options.
create mcp emits a deterministic MCPB archive. Use --dry-run to inspect the manifest and inventory, --clobber to replace an existing regular file, and --output to select its destination. External binaries require an explicit --platform darwin|linux|win32; Windows inputs must end in .exe. See MCP Bundles for the manifest, trust, and release contract.
Next stop:Â Run the bot you created with Serve.
đšââïž Doctor
In a nutshell
Inspect the host environment and capture a support report with
acorn doctor.
Start broad, then narrow the diagnostic category:
acorn doctor
acorn doctor --check software
acorn doctor --check system,memory,network
acorn doctor --report > acorn-doctor.json
Doctor reports use the same discovery-record JSON schema as the interactive Doctor screen. The software probes cover ACORN, Chromium, Codex, Codex ACP, Git, Node.js, npm, npx, OpenCode, Ollama, ORAS, Pandoc, and Vale.
If Codex ACP is reported as missing, install its executable globally and rerun the software check:
npm install -g @agentclientprotocol/codex-acp
acorn doctor --check software
This global installation does not require npx. If npm and npx are unavailable, install Node.js/npm or download a standalone binary from the codex-acp releases and place it on PATH.
--fix applies only reversible, low-risk automatic fixes and then reports the verified host state. Package-manager and network installers require --fix --interactive: select findings with Space, preview the fixed operations with f, and confirm with y. n or Escape declines the plan. --interactive without --fix remains report-only, and --report cannot be combined with interactive mode.
Rescue: ACORN cannot find Chrome
PDF export needs Chrome or Chromium. Point ACORN at an existing executable instead of relying on automatic discovery:
# Linux
acorn --offline export index.json --format pdf \
--chrome-path /usr/bin/google-chrome-stable
# macOS
acorn --offline export index.json --format pdf \
--chrome-path "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
On Windows, pass the executable path with --chrome-path or set CHROME_PATH. Connected export can download ACORNâs pinned browser; offline export needs a configured, installed, or already cached browser. See Chrome selection.
Rescue: offline mode unexpectedly fails
Global --offline forbids network reads; it does not turn remote inputs into local ones. Check these common causes:
- Replace HTTP(S) inputs and model-list URLs with local paths or
file://URIs. - Use
check --skip proseif analyzer extensions have not already been synchronized. - Configure
--chrome-pathor cache the pinned browser before offline PDF export. - Do not combine
gather --resolve,gather --merge-request, orgather --ostiwith offline mode.
Run the failing command with -vv to expose the resource ACORN attempted to resolve.
Rescue: a model sync target is not detected
With no target flags, acorn sync selects applications whose commands it detects. Request a target explicitly to make the decision visible:
acorn sync --vscode --dry-run
acorn sync --vscode --force --dry-run
--force bypasses command detection only for targets you explicitly include. If the application is detected but weights are elsewhere, set --models-dir; use --assume-models only when another system guarantees those paths exist. Continue with the Sync troubleshooting guide.
Next stop:Â Preview application routing with Sync.
Diff and pairwise similarity
acorn diff has two explicit modes. Without --method, it compares two files through their typed metadata representation and emits a unified diff by default. With --method, it calculates a bounded pairwise similarity score.
Semantic file comparison
acorn diff before.json after.json
acorn diff before.yaml after.yaml --format json-patch
acorn diff before.json after.json --standard rads
acorn diff before.ttl after.jsonld --standard dcmi
Semantic mode accepts diff (unified is an alias) and json-patch. A standard override is available only in this mode.
For Dublin Core, semantic mode decodes native graph JSON, JSON-LD, RDF/XML, and Turtle into the same normalized graph before comparison. Equivalent RDF in different syntaxes produces an empty diff. Unified output uses the first fileâs syntax; JSON Patch operates on ACORNâs canonical graph JSON representation.
Similarity comparison
Files remain the default operands:
acorn diff first.txt second.txt --method levenshtein
acorn diff first.txt second.txt --method jaccard --ngram-width 3 --format json
Use --values when the operands themselves are the values:
acorn diff Paul Pual --method optimal-string-alignment --values
acorn diff 10 12 --method absolute-difference --cutoff 4 --values
Available methods are:
exact,prefix, andsuffixhamming,levenshtein,weighted-levenshtein,optimal-string-alignment(osa), anddamerau-levenshteinjaroandjaro-winkleroverlap,jaccard, andsorensen-dice(dice)monge-elkan,extended-jaccard,tfidf-cosine, andsoft-tfidfsoundex,cologne-phonetic, andmetaphonecosinefor comma- or whitespace-delimited finite vectorsabsolute-differenceandpercentage-difference
Prefix and suffix require --length. Numeric methods require a finite positive --cutoff. Extended Jaccard and Soft TF-IDF require an inclusive --threshold; tied or reused fuzzy-token matches fail instead of selecting by input order. Set and hybrid methods split on Unicode whitespace by default; --ngram-width N switches to unpadded character n-grams. Weighted Levenshtein uses insertion 1, deletion 1, and substitution 2 in the CLI. Preprocessing is explicit through --preprocess: choose raw (the default), lowercase, full locale-independent case-fold, canonical nfc, or compatibility nfkc. The modes are not combined. NFC is the recommended opt-in for human-language text that should ignore canonically equivalent encodings; NFKC is appropriate only when compatibility distinctions may also be erased.
The TF-IDF CLI methods use the two compared token sequences as an explicit pair-local corpus and report its deterministic identity. For reusable research corpora, use acorn_core::similarity::TfidfCorpus directly so document boundaries and corpus identity remain fixed across comparisons. Monge-Elkan is directional: swapping operands can change its score. Phonetic methods compare their language-specific encodings for equality; they rank spelling resemblance and do not establish contributor or organization identity.
Similarity mode accepts text and json, defaulting to text. A low score is a successful result. Invalid input, incompatible parameters, unreadable files, and exceeded resource limits fail the command.
Use --max-input-scalars, --max-work-units, and --max-collection-items to replace the documented similarity defaults. Inputs are rejected rather than truncated when a limit is exceeded.
đ„ Download
In a nutshell
Fetch bucket content, verified BagIt archives, or local-model weights with
acorn download <SOURCE>.
- See the configuration documentation for details on configuring ACORN commands.
- By default,
downloadwill save files to./contentin the working directory unless an output path is specified via the--outputflag.
Example usage
# Download research activity data from a single bucket repository URL
acorn download https://code.ornl.gov/research-enablement/buckets/nssd
# Download the verified payload of a BagIt archive
acorn download https://example.org/bags/nssd.zip --output ./content
# Download research activity data from a list of buckets
acorn download --config /path/to/.acorn.json
# Download research activity data to a specific output directory
acorn download --config /path/to/.acorn.yml --output /path/to/output
# Download selected files directly beneath the output directory
acorn download https://github.com/example/project --filter '^examples/quest/' --flatten --output ./quest
# Replace selected paths that already exist in the output directory
acorn download https://github.com/example/project --output ./content --clobber
# Download using JSONC configuration (supports comments and trailing commas)
acorn download --config /path/to/.acorn.jsonc
Buckets
After a bucket transfer, ACORN ingests transferred JSON, JSONC, YAML, YML, ZONF, and recognized Markdown research activity files into the local research_activities table. Unrelated Markdown documentation is ignored. Each row has a portable NanoID and retains the typed RAD JSON plus versioned provenance for the bucket, credential-free source, opaque source key, original virtual path, output path, exact source version when available, declared size, and observation time. Exact DOI, RAiD, ISBN, and patent metadata identities are used when present; a source-qualified RAD identifier always identifies the transferred activity.
Repeated transfers are idempotent. A matching candidate gains missing fields and unique array values, while conflicting populated fields remain unchanged and are recorded as provenance. Filters and ignore rules apply before transfer, so only transferred RAD files are ingested.
Use --flatten to discard repository directory components and save every selected file as a direct child of the output directory. Filters and ignore rules continue to match the original repository-relative paths. If multiple selected paths have the same filename, the command fails.
By default, a local bucket copy fails rather than overwrite an existing destination, while a complete existing remote file is skipped. Add --clobber to replace files, symlinks, or directories that conflict with selected output paths. Local imports obtain the replacement content before removing the old destination; remote downloads remove the selected destination before streaming its replacement. Unrelated contents beneath the output directory are preserved. This flag applies only to bucket transfers; the model subcommandâs existing --force flag retains its synchronization-specific meaning.
If a transferred RAD file cannot be parsed or persisted, the files already written to the output directory are preserved and the command fails. Deprecated RAD fields are accepted with warnings and serialized under their canonical names in the database. Pass --canonicalize to rewrite deprecated fields in transferred files before ingestion, or --strict to reject them. Combining both flags canonicalizes first and then verifies the rewritten files with strict ingestion. Global --no-local-database performs the transfer but skips RAD parsing and candidate persistence; --canonicalize still rewrites deprecated fields when database access is disabled.
# Rewrite deprecated RAD aliases in downloaded files, then require canonical ingestion
acorn download --config /path/to/.acorn.json --canonicalize --strict
# Transfer bucket files without creating or updating local candidates
acorn --no-local-database download --config /path/to/.acorn.json
Local and remote sources
Top-level download accepts remote bucket repositories and BagIt archives. Remote repositories require online mode, and local directory or local repository sources are still rejected. Use acorn import for local directories and local bucket entries in configuration. This policy does not apply to download model, which retains its documented local-file and offline behavior.
"buckets": [
{
"name": "nssd (remote)",
"source": {
"provider": "gitlab",
"id": 17411,
"uri": "https://code.ornl.gov/research-enablement/buckets/nssd"
}
},
{
"name": "test (local)",
"source": {
"provider": "git",
"location": "file:./tests/fixtures/data/bucket/"
}
}
]
Bare paths and URLs are the concise form. Use a detailed source object when a provider-specific field such as a GitLab project ID is required; the legacy repository and codeRepository keys are also accepted as input aliases.
BagIt archives
A local path, file: URI, or HTTP(S) URI that names a 7z, ZIP, TAR, or TAR.GZ BagIt archive is verified and downloaded to a folder of project folders. ACORN completes BagIt verification before publishing anything, then writes only the contents of the bagâs data/ directory, preserving the project-directory structure beneath it. A bagit.zip containing data/project-a/index.json becomes <output>/project-a/index.json. BagIt tag files such as bagit.txt, bag-info.txt, and payload manifests are never copied to the output.
The bag is resolved at the archive root or beneath one enclosing directory. Filters, ignore rules, --flatten, --clobber, --canonicalize, --strict, provenance, ingestion, counts, and activity logging all apply to the verified payload paths, exactly as they do for bucket repositories.
Local BagIt archives work offline. A remote BagIt archive requires online mode and is rejected before any network access under --offline. An incomplete or incorrect bag fails without publishing payload, and downloaded archives, extraction staging, and unpublished output are cleaned up on both success and failure.
The archive format is inferred from the source name and, for local files, from the content header. Pass --archive-format to force 7z, tar, tar.gz, or zip for extensionless or misleading names. The flag applies only to bucket downloads and is rejected by download model and download needle.
# Download a verified local BagIt archive
acorn download ./bag.zip --output ./content
# Download a BagIt archive over HTTPS
acorn download https://example.org/bags/nssd.zip --output ./content
# Download a local BagIt archive without network access
acorn download ./bag.7z --offline --output ./content
# Force the archive format for a source name inference cannot classify
acorn download ./release-bundle --archive-format zip --output ./content
GitLab and GitHub
The download command supports both GitLab and GitHub remote repositories for ACORN buckets. The configuration for each is similar, with the main difference being the provider field in the source object.
"buckets": [
{
"name": "ccsd (gitlab)",
"source": {
"provider": "gitlab",
"id": 17410,
"uri": "https://code.ornl.gov/research-enablement/buckets/ccsd"
}
},
{
"name": "test (github)",
"source": {
"provider": "github",
"uri": "https://github.com/jhwohlgemuth/bucket"
}
}
]
Models
Download model weights for use with ACORN research harnesses and local inference. By default, ACORN selects GGUF model files from Hugging Face repositories and prefers the Q4_K_M quantization. Python, pip, or the hf tool are not required.
For complete metadata-import options, configuration examples, authentication, and database behavior, see Import model.
# Import GGUF file metadata without downloading weights
acorn import model openai/gpt-oss-20b --search-limit 20
# Import metadata for repositories listed in a local or remote document
acorn import model --model-file https://example.org/models.json
# Download models listed in a local or remote document
acorn download model --model-file https://example.org/models.json
# Select an exact quantization that fits in available GPU memory
acorn download model openai/gpt-oss-20b --quantization Q4_K_M --gpu-memory 24GB
# Download default GGUF (Q4_K_M) from a Hugging Face repo
acorn download model meta-llama/Llama-3.1-8B
# Download model weights into a specific local directory
acorn download model meta-llama/Llama-3.1-8B --local-dir ./models
# Download a specific quantization
acorn download model meta-llama/Llama-3.1-8B --quantization Q8_0
# Exclude low-quality quantizations
acorn download model meta-llama/Llama-3.1-8B --ignore "Q2_|Q3_|imatrix"
# Download models from a config file
acorn download model --config .acorn.json
Use --model-file to load model IDs from a local path, file:// URI, or HTTP(S) URL. Plain-text lists and JSON/YAML lists of IDs or model details are accepted. Positional models, entries from --model-file, and supported --config entries are combined and deduplicated before download. Remote model-list documents cannot be loaded with --offline.
Pass --sync to add the unique model identifiers resolved by this invocation to the ACORN configurationâs models list and to both OpenCode and llama-swap configuration. Existing ACORN model entries are preserved and duplicate identifiers are omitted. Use --sync opencode or --sync llama-swap to select one inference target:
acorn download model openai/gpt-oss-20b --sync
acorn download model openai/gpt-oss-20b --sync opencode
acorn download model openai/gpt-oss-20b --sync llama-swap
--dry-run continues to avoid model downloads and prints ACORN and target-configuration diffs without writing them when combined with --sync. Only models already available in the selected output/models directory can appear in the inference-configuration diffs by default. Add --force to skip this existence check and assume each model is located at <models-dir>/<model-id>:
acorn download model openai/gpt-oss-20b --sync --dry-run --force
Inline --sync is additive and operates only on models resolved by the current download. The standalone acorn sync command remains the full reconciliation operation for every model in ACORN configuration, including target-path and models-directory overrides, independent dry runs, and removal of stale ACORN-managed entries with --prune.
Metadata import resolves the configured revision, records each GGUF file URL, quantization, and byte size, and inspects a selected fallback GGUF repository when the base repository is unavailable or has no GGUF files. It does not transfer model weights or checksum sidecars. --quantization is an ordered, comma-separated exact allowlist. When only --gpu-memory is supplied, ACORN evaluates Q4_K_M. Split shards are treated as one variant and their sizes are summed.
ACORN also preserves the model context limit. The selected local or downloaded GGUF metadata has highest precedence, followed by the selected Hugging Face repositoryâs GGUF metadata and then the persisted models.dev catalog value. Matching split shards must report the same context length. When a higher-priority context replaces a catalog value, input and output limits are retained only when they fit within the new context. These artifact limits are separate from provider serving limits and runtime memory allocation. Optional context metadata that is absent or unreadable does not prevent a model download.
Detailed configuration entries can set the same constraints:
{
"models": [{
"name": "gpt-oss",
"source": {
"provider": "huggingface",
"location": "https://huggingface.co/openai/gpt-oss-20b"
},
"quantization": ["Q5_K_M", "Q4_K_M"],
"gpuMemory": "24GB"
}]
}
OCI model artifacts
Explicit oci:// references download model artifacts from any OCI Distribution-compatible registry, including Harbor. ORAS 1.3.0 or newer must be installed and available on PATH; acorn doctor --check software reports its availability. Unqualified owner/repository values remain Hugging Face selectors.
# Resolve a tag and preview its immutable digest and selected files
acorn download model oci://savannah.ornl.gov/models/gpt-oss:20b --dry-run
# Pull an immutable artifact digest
acorn download model oci://registry.example.org/ai/models/qwen@sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
Tags are resolved during planning. Dry-run and raw output include the requested reference, resolved SHA-256 manifest digest, detected package format, selected and ignored transfer layers, known logical files, transfer size, and inventory confidence. Archive inventories remain explicitly deferred when they cannot be known without downloading the archive. Downloads pin the resolved digest, verify the config and every selected blob against its descriptor, stage into a unique sibling directory, validate every materialized path, and publish with one rename. A non-empty existing destination is rejected. --skip-verify-checksum does not disable OCI descriptor verification.
OCI model downloads have a GGUF-only inference boundary. ACORN accepts annotated artifact layers with safe .gguf org.opencontainers.image.title paths, KitOps ModelKits whose declared model is GGUF, and current CNCF ModelPacks. Native ModelKit configuration is decoded through ACORNâs portable KitOps v1.15.0 Kitfile schema, including package, model parts, datasets, code, documentation, prompts, MCP Bundles, parameters, and resolved layer identity. The model command selects the primary GGUF and GGUF model parts by their resolved digests; valid unrelated package components remain metadata and are not materialized implicitly. Older configs without layer identity are accepted only when each selected path maps unambiguously to one supported manifest layer.
ModelPack recognizes weight, weight-configuration, documentation, code, and dataset layers in raw, TAR, TAR+gzip, and TAR+Zstandard forms. The model command installs selected GGUF weights and their weight-configuration layers while reporting documentation, code, and datasets as ignored package components. Raw selected layers require a safe org.cncf.model.filepath or an unambiguous file-metadata name; archive inventories are filtered and validated after bounded extraction.
Every downloaded GGUF is checked for its magic, supported container version, bounded metadata, tensor declarations, data bounds, and consistent split metadata. A selection must contain exactly one complete primary model group; related projector GGUFs are allowed, while projector- or adapter-only artifacts fail. SafeTensors, ONNX, PyTorch, extensionless application-store blobs, ordinary runnable container images, unsafe paths, symbolic links, malformed digests, and unknown ModelPack media types are rejected. Valid non-runtime ModelPack roles are ignored explicitly rather than misclassified. A one-candidate OCI index resolves to its child manifest digest; ambiguous, nested, or mixed runnable/model indexes fail closed. Digest integrity proves content identity, not publisher authenticity.
Custom Harbor endpoints
Use an explicit oci:// reference for a model in any Harbor registry. A named registry profile is optional for public artifacts, but enables Harbor metadata and registry-specific authentication or TLS settings. ORNLâs Savannah Harbor instance is one example:
# Inspect the tag, resolved digest, GGUF files, and transfer layers
acorn download model oci://savannah.ornl.gov/models/qwen:Q4_K_M --dry-run --raw
# Download into ACORN's digest-addressed model directory
acorn download model oci://savannah.ornl.gov/models/qwen:Q4_K_M --local-dir ./models
ACORN keeps the verified artifact in a registry/repository/digest-qualified directory so mutable tags cannot overwrite another resolution; the directory names are portable to Windows. Application-specific model stores are outside this commandâs scope.
ORAS uses the normal Docker-compatible credential store by default. A named profile may instead identify a credential environment variable; ACORN passes that value through standard input and never places it in configuration, process arguments, or diagnostics. TLS verification stays enabled. Plain HTTP is allowed only by an explicit development profile.
{
"registries": {
"savannah": {
"kind": "harbor",
"endpoint": "https://savannah.ornl.gov",
"credentialEnv": "ACORN_SAVANNAH_TOKEN"
}
},
"models": [
{
"name": "gpt-oss-20b",
"source": {
"provider": "oci",
"location": "oci://savannah.ornl.gov/models/gpt-oss:20b",
"registry": "savannah"
},
"auth": "required"
},
{
"name": "qwen-huggingface",
"source": {
"provider": "huggingface",
"location": "Qwen/Qwen2.5-Coder-7B-Instruct-GGUF"
}
},
"oci://ghcr.io/example/models/qwen:Q4_K_M"
]
}
The second entry continues to use the pre-OCI Hugging Face API. The final entry shows the simplified selector syntax for an OCI artifact that does not need a named registry profile.
Profiles also support username, registryConfig, caFile, paired clientCert/clientKey, and plainHttp. They intentionally have no password or token field. Harbor profiles enable its v2 artifact metadata API; content transfer always remains portable through ORAS. Global --offline rejects OCI access before ORAS or Harbor is contacted.
Command-line constraints override configuration. If neither constraint is present, download selection remains unchanged. With global --no-local-database, import reports metadata without persisting it and constrained downloads proceed with an eligibility-unknown warning.
Filter and ignore semantics
The --filter flag behaves as an include rule: only sources matching at least one pattern will be downloaded. The --ignore flag behaves as an exclude rule: sources matching any ignore pattern are excluded even if they match a filter pattern. Both flags accept regular expression patterns, not Hugging Face glob patterns. Simple patterns are automatically optimized to glob matching for Hugging Face repositories.
Note for Transformers and PyTorch users
Users of Transformers or PyTorch typically need the full repository or a broader filter that includes config.json, tokenizer files, tokenizer_config.json, and optionally custom code files. The default GGUF-only filter is designed for llama.cpp inference.
Whitelists
A model whitelist restricts downloads to matching user-facing model names. ACORN uses the first non-empty whitelist source in this order: --whitelist or --whitelist-file, application configuration, then ACORN_MODEL_WHITELIST. The environment variable accepts comma-separated inline entries or one remote HTTP or HTTPS whitelist URI. An empty whitelist does not restrict downloads.
Use --whitelist-file to load a whitelist from a remote HTTP or HTTPS URI. For example, the following command allows the requested model only when it appears in the ORNL Research model catalog:
acorn download model openai/gpt-oss-20b --whitelist-file https://research.ornl.gov/api/models.json
The --whitelist option accepts inline model names; it does not fetch a URI supplied as its value.
Configure an inline whitelist with whitelist.models:
{
"models": [
"openai/gpt-oss-20b",
"meta-llama/Llama-3.1-8B",
"https://huggingface.co/Qwen/Qwen3-8B"
],
"whitelist": {
"models": [
"openai/gpt-oss-20b",
"https://huggingface.co/Qwen/Qwen3-8B"
]
}
}
The models value in the whitelist object accepts either one string or an array of strings:
- One HTTP or HTTPS URL is treated as a remote whitelist document and fetched when the command runs.
- An array is treated as inline whitelist entries. Each string may be a model name, model ID, or model URL. URLs inside an array are entries and are not fetched as nested whitelist documents.
- One non-URL string is treated as one inline whitelist entry.
For example, this configuration loads the whitelist from a remote document:
{
"models": [
"openai/gpt-oss-20b",
"meta-llama/Llama-3.1-8B"
],
"whitelist": {
"models": "https://example.org/acorn/models.json"
}
}
The remote document may contain one model-details JSON object with a name or id:
{
"name": "openai/gpt-oss-20b"
}
It may instead contain a JSON array of model names, IDs, or URLs:
[
"openai/gpt-oss-20b",
"meta-llama/Llama-3.1-8B",
"https://huggingface.co/Qwen/Qwen3-8B"
]
An array of model-details objects is also accepted:
[
{
"name": "gpt-oss",
"id": "openai/gpt-oss-20b"
},
{
"id": "meta-llama/Llama-3.1-8B"
}
]
For model-details objects, ACORN accepts both name and id as whitelist entries when both are present. At least one of these fields is required. YAML arrays and newline-separated plain-text entries are also supported.
Remote whitelist documents cannot be loaded with --offline. Use --whitelist-file <URI_OR_PATH> when the whitelist document is a local path or file:// URI. An explicitly supplied configuration path must exist; otherwise, ACORN reports Configuration file does not exist.
Next stop:Â Follow downloaded weights through the model workflow.
đ€ Export
In a nutshell
Turn one RAD source into a shareable artifact with
acorn export <PATH> --format <FORMAT>.
acorn export converts one RAD record or a directory of records into formats such as CFF, PDF, PowerPoint, Markdown, JSON, JSON Lines, YAML, or ZON.
Markdown, .zonf, .jsonl, and .ndjson RAD are accepted as inputs for their supported RAD export targets alongside JSON and YAML. Exported Markdown uses YAML frontmatter with schema: acorn/research-activity; its generated ## ASPECT section includes nested data and model details.
The command creates each selected artifact from the same source record, so a project can maintain its data once and regenerate its public outputs when that data changes.
Tip
You can see some export command results by visiting the ORNL Research Activity Index, which features a variety of research activity data presented in different formats.
Example usage
# Export research activity data to PDF fact sheet
acorn export /path/to/index.json --format pdf
# Create PowerPoint presentations from all research activity data in a directory
acorn export /path/to/project/ --format powerpoint
# Create a CITATION.cff file from a research activity index
acorn export /path/to/project/index.json --format cff
# Convert a JSON array or JSON Lines batch to canonical .jsonl output
acorn export /path/to/project/activities.json --format jsonl
# Print the Application Configuration for Research Enablement JSON Schema
acorn export --schema --standard acre
# Print the RAiD schema as YAML
acorn export --schema --standard raid --format yaml
# Print the native Dublin Core graph schema
acorn export --schema --standard dcmi --format json
Schema mode defaults to JSON without changing the ordinary export default of PDF. ACRE, RAD/RADS, CFF, CKAN, DataCite, DCAT, Dublin Core, HuWise, InvenioRDM, Kitfile, ModelKit, RAiD, document, and text are supported. Schema output is limited to JSON and YAML.
Note
Most export formats use the
--outputoption to specify the output file or directory path. If not provided, ACORN will generate a default output path based on the input path and selected format. For example,--format pdfand--format powerpointwill generate files in the default export location (./export/) with names based on the project parent folder(s),--format bagwill add.zipto the output path (i.e.,--output ./exportwill create./export.zipand--output /path/to/bagwill create/path/to/bag.zip). CFF output is the exception described below.
BagIt export supports 7z, ZIP, TAR, and TAR.GZ containers. A recognized --output suffix selects the format, while an output without an archive suffix defaults to ZIP. Use --archive-format 7z|zip|tar|tar.gz as an explicit override:
acorn export ./research --format bag --output ./deposit.tar.gz
acorn export ./research --format bag --output ./deposit.7z
acorn export ./research --format bag --archive-format tar --output ./deposit
An explicit format that conflicts with an output suffix is rejected. --archive-format is not accepted for non-BagIt exports.
JSON Lines batches
Use --format jsonl to write newline-delimited JSON. --format ndjson is an alias for the same format; output always uses the canonical .jsonl suffix.
# Convert a JSON array to one compact JSON object per line
acorn export activities.json --format jsonl
# Normalize an .ndjson batch to the canonical .jsonl suffix
acorn export activities.ndjson --format jsonl
# Convert a JSON Lines RAD batch to a JSON array
acorn export activities.jsonl --format json
Each nonblank physical line must contain exactly one complete JSON record. LF and CRLF line endings are accepted, the final newline is optional on input, and output always ends with one newline. Empty input, blank record lines, malformed JSON, and records that do not match the selected schema fail the entire export with a one-based line number.
Record order and cardinality are preserved when converting among JSON Lines, JSON, YAML, and ZON batch representations. Directory export still writes one output file per source file; it does not combine unrelated sources into one batch. Export discovery recognizes both .jsonl and .ndjson, while commands such as check and format keep their existing input sets.
Standard crosswalks
Use --to with JSON, JSON Lines, YAML, or ZON export to convert metadata between supported metadata standards. Dublin Core may also use JSON-LD, RDF/XML, or Turtle. ACORN can infer the source standard from recognizable fields, but --from is recommended for repeatable scripts and for records with an ambiguous shape.
# Convert one DataCite JSON record to DCAT JSON
acorn export datacite.json --format json --from datacite --to dcat --output ./export
# Convert DCAT JSON to DataCite YAML
acorn export dataset.json --format yaml --from dcat --to datacite --output ./export
# Convert DataCite ZON to DCAT ZON; output uses .zonf
acorn export datacite.zonf --format zon --from datacite --to dcat --output ./export
# Convert an ordered DataCite JSON Lines batch to DCAT JSON Lines
acorn export datacite.ndjson --format jsonl --from datacite --to dcat --output ./export
# Convert a CKAN package_show record or successful Action API response to a DCAT Dataset
acorn export package.json --format json --from ckan --to dcat --output ./export
# Preview a directory conversion without writing files
acorn export ./metadata --format json --from invenio --to dcat --dry-run
# Export DataCite as deterministic Turtle
acorn export datacite.json --format turtle --from datacite --to dcmi --output ./export
# Import Dublin Core into RAD with required local context
acorn export metadata.ttl --format json --from dcmi --to rads \
--crosswalk-contact contact.json \
--local-identifier imported-dataset \
--output ./export
Reusable import defaults can be stored in ACRE configuration and selected with --config:
options:
crosswalk:
contact: contacts/default.yaml
localIdentifier: imported-dataset
The command-line contact and identifier override configured values. A configured relative contact path is resolved from the directory containing the ACRE file.
The crosswalk graph includes RAD/RADS, RAiD, DataCite, Dublin Core (dcmi), DCAT, InvenioRDM, HuWise, and the CKAN source adapter. Some conversions use DataCite as an intermediate representation:
| Source | Direct targets | Targets routed through DataCite |
|---|---|---|
| CKAN | DCAT | None |
| RAD/RADS | DataCite, RAiD | Dublin Core |
| RAiD | RAD/RADS | None |
| DataCite | DCAT, Dublin Core, InvenioRDM, HuWise | None |
| Dublin Core | DataCite, RAD/RADS | DCAT, InvenioRDM, HuWise |
| DCAT | DataCite | Dublin Core, InvenioRDM, HuWise |
| InvenioRDM | DataCite | DCAT, Dublin Core, HuWise |
| HuWise | DataCite | DCAT, Dublin Core, InvenioRDM |
Crosswalk export has these constraints:
- The input and output must be JSON, JSON Lines, YAML, or ZON unless the Dublin Core source or target uses JSON-LD, RDF/XML, or Turtle. PDF, PowerPoint, CFF, BagIt, and Markdown are not crosswalk targets.
- A single object, an array of objects, or one object per JSON Lines record is accepted. Directory export writes one target file for each resolved source file.
- Dublin Core describes one RDF default graph rather than a JSON Lines batch. ACORN preserves unknown predicates inside that graph.
- Dublin Core to RAD requires a JSON or YAML
ContactPointfile through--crosswalk-contactand a kebab-case--local-identifier. Missing local context fails before output is written. - CKAN input may be an unwrapped
package_showresult or a successful{ "success": true, "result": ... }Action API response. Package-search result envelopes are not supported. - Source-standard inference checks every JSON Lines record. A batch containing mixed standards fails at the first conflicting record and reports its record index and physical line.
- Conversion can be lossy because the standards have different fields and cardinalities. Normal direct conversions report field-level crosswalk warnings when ACORN has a mapping for that pair.
- CKAN metadata-record timestamps, administrative fields, plugin extensions, malformed resource URLs, and service simplification are reported as warnings.
--strictfails before writing when any warning is present;--dry-runreports the same warnings without writing. - CKAN conversion emits ACORNâs flexible DCAT Dataset representation. It does not claim DCAT-US conformance, create a DCAT Catalog or CatalogRecord, or support DCAT-to-CKAN publishing.
- Warning collection for conversions routed through DataCite remains incomplete; use direct pairs when loss accounting is required.
Run acorn check --standard <target> <output> after conversion when the target artifact must pass ACORNâs schema and validation checks.
Citation File Format (CITATION.cff)
Use --format cff to convert ACORN research activity data (RAD) into a CFF 1.2.0 citation file:
acorn export /path/to/project/index.json --format cff
The generated /path/to/project/CITATION.cff includes the RAD title, contact information as author and contact metadata, keywords, and DOI information when available. When narrative sections are present, the research purpose is used as the abstract. ACORN also supplies the CFF version and default citation message.
For CFF export:
- The input must be RAD in JSON, JSONC, YAML, ZON, or canonical/legacy ACORN Markdown. Existing
.cffinput is skipped because it is already in the target format. - The output is always named
CITATION.cffand written beside its source RAD file.--outputdoes not relocate CFF output. - ACORN generates at most one
CITATION.cffper source directory. When several discovered RAD files share a directory, they resolve to the same output path and only one is exported.
Run acorn check /path/to/project/CITATION.cff after export to validate the generated citation metadata.
Chrome selection for PDF export
Use --chrome-path to select an installed Chrome or Chromium executable. CHROME_PATH provides the same setting through the environment, and an explicit command-line value takes precedence.
# macOS
acorn --offline export /path/to/index.json --format pdf \
--chrome-path "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
# Linux
CHROME_PATH=/usr/bin/google-chrome-stable \
acorn --offline export /path/to/index.json --format pdf
# Windows
acorn --offline export C:\path\to\index.json --format pdf `
--chrome-path "$env:ProgramFiles\Google\Chrome\Application\chrome.exe"
When configured, this path is validated and used without checking ACORNâs browser cache or downloading Chrome. Without it, offline export uses the cached pinned browser when available and otherwise lets chromiumoxide detect an installed browser. Connected export retains the pinned browser download fallback.
Draft PDF and PowerPoint exports do not require authored media. When a RAD has no usable image, ACORN inserts its embedded 1920 Ă 1280 pixel (3:2) acorn placeholder so the layout remains meaningful. A media path that was explicitly authored but cannot be read is still reported as an error.
PowerPoint reference template
Use the --reference option to provide a PowerPoint template with the styles, layouts, and branding for the exported presentation.
acorn export /path/to/index.json \
--format powerpoint \
--reference /path/to/reference.pptx
Place text such as {{ PLACEHOLDER_NAME }} in the template where ACORN should insert a RAD value. An example PowerPoint reference template is available in the ACORN GitLab repository.
Available placeholders
The following placeholders can be used in your PowerPoint reference template:
String values
caption- First image captionchallenge- Challenge descriptioncitation- DOI citationemail- Contact emailfirst- Contact first namefocus- Research focus arealast- Contact last namemanagers- Manager names (joined with"and")missionnotes- Presentation notes (intended to be added PowerPoint speaker notes)partners- Partner names (joined with", ")programs- Program names (joined with"and")subtitletitle
Lists (bullet points)
achievementareas- Research areasimpacttechnical- Technical approach
Next stop:Â Practice the complete loop in the Quick Quest.
đ€ Format
In a nutshell
Normalize RAD fields and controlled vocabulary values with
acorn format <PATH>.
Example usage
# Format a specific research activity index
acorn format path/to/project/index.json
# Format canonical or legacy Markdown RAD
acorn format path/to/project/index.md
# Format canonical ZON RAD in place
acorn format path/to/project/index.zonf
# Format all research activity data in a directory
acorn format path/to/project/
# Perform a dry-run to see proposed changes without modifying files
acorn format path/to/project/index.json --dry-run
# Keep exact aliases but disable fuzzy typo correction
acorn format path/to/project/index.json --fuzzy off
# Preview formatting and provider enrichment together
acorn format path/to/project/index.json --enrich --dry-run
# Format an ACRE configuration file while preserving comments and property order
acorn format .acorn.jsonc --standard acre
# Preview canonical RON formatting, including comment removal
acorn format .acorn.ron --standard acre --dry-run
# Canonicalize a Dublin Core graph while retaining Turtle syntax
acorn format metadata.ttl --standard dcmi
ACRE configuration
Use --standard acre to format Application Configuration for Research Enablement files. JSON and JSONC use two-space indentation, LF line endings, and a final newline while retaining property order, comments, and existing trailing commas. YAML uses the same indentation and line-ending policy and retains comments. RON sorts map keys except ordered auth.profiles, uses two-space indentation, LF line endings, and a final newline; it removes comments and source layout. A dry run shows the exact rewrite without writing. Formatting validates the file first and preserves an omitted schemaVersion field.
When the path is a directory, only .acorn.json, .acorn.jsonc, .acorn.yaml, .acorn.yml, and .acorn.ron are selected. An explicit file may use any supported JSON, JSONC, YAML, YML, or RON filename. ACRE formatting does not invoke configured workflows and rejects --config, --enrich, and --provider.
Dublin Core
Dublin Core formatting parses the complete graph, normalizes statement order and repeated values, and writes deterministic native JSON, JSON-LD, RDF/XML, Turtle, or YAML according to the source extension. A dry run shows the resulting textual change without writing the file.
Formatting preserves unknown absolute extension predicates. It does not resolve remote JSON-LD contexts or add inferred statements. Because Dublin Core has no ACORN enrichment or format-hook pipeline, --enrich, explicit configuration, and configured format hooks are rejected for this standard.
Example output
meta:
keywords:
- - automatin
+ - automation
technology:
- - JavaScript
- - TypeSpec
- astro
+ - javascript
- react
- - rs
+ - rust
+ - typespec
sponsors:
- - DOD
+ - Department of Defense
...
contact:
jobTitle: Primary Investigator
givenName: Jasdrey
familyName: Wohlson
email: me@example.com
- telephone: '(123) 456-7890'
+ telephone: '123.456.7890'
url: https://www.ornl.gov/staff-profile/jason-h-wohlgemuth
- organization: GSHS
+ organization: Geospatial Science and Human Security Division
+ affiliation: National Security Sciences Directorate
Features
Markdown formatting rewrites the document into ACORNâs canonical representation. YAML frontmatter retains lossless structured metadata and ASPECT data, while the body contains the title, prose sections, research fields, contact details, and a generated ASPECT summary. This also upgrades Markdown produced by older ACORN releases. ZON formatting uses ACORNâs deterministic strict profile and keeps the .zonf extension.
- đ ïž Auto-fixing: Automatically fix common inconsistencies in RAD structure and prose
- đš Consistent Formatting: Ensure consistent JSON formatting across all data files
- đ©č Resolve Values: Resolve certain values against controlled vocabularies to ensure correct meaning
- đŒïž Resolve missing images: Find first image in associated RAD folders and add to metadata if missing
Fuzzy matching policy
--fuzzy strict is the default and applies high-precision vocabulary-specific score and runner-up separation gates. Use --fuzzy relaxed to accept more typo and truncation matches, or --fuzzy off to retain only exact canonical, declared alias, typed identifier, and normalized matches. Ambiguous, unmatched, and resource-limited values are preserved rather than erased. The selected policy also applies when --enrich or configured format hooks run.
Enrichment
Use --enrich to normalize RAD and fill missing metadata through ACORNâs ordered provider pipeline. All providers run by default; use repeated or comma-delimited --provider values to select OSTI, OpenAlex, CiteAs, ORCID, or ROR. Enrichment requires network access and is rejected in global --offline mode before files are written.
acorn format index.json --enrich
acorn format index.json --enrich --provider openalex,citeas
acorn format index.json --enrich --provider orcid --provider ror --dry-run
Existing populated values are preserved, ambiguous identity matches remain unchanged, and successful provider results survive later provider failures. See Metadata enrichment for provider behavior, environment variables, provenance, and the complete workflow.
Resolved values
meta.keywords: Resolve keywords against ACORN Keywords Vocabularymeta.technology: Resolve technology against ACORN Technology Vocabularymeta.partners: Resolve partner names against ACORN Partners Vocabularymeta.sponsors: Resolve sponsor names against ACORN Sponsors Vocabularycontact.organization: Resolve organization name against a given org chart (currently only supports ORNL org chart)contact.affiliation: Resolve organization name against a given org chart (currently only supports ORNL org chart)
Examples
- Keywords:
"ai"â resolves to"artificial-intelligence" - Partners:
"NREL"â resolves to"National Renewable Energy Laboratory" - Technologies:
"rs"â resolves to"rust" - Sponsors:
"Dept. of Energy"â resolves to"Department of Energy"
Next stop:Â Create a shareable artifact with Export.
đŸ Gather
In a nutshell
Discover identifiers and candidate records from documents, URLs, or text with
acorn gather <INPUT>.
Discover persistent identifiers in files, documents, URLs, standard input, and literal text.
Directory traversal
Directory inputs are searched recursively by default, including files in every descendant directory. When no input, --text, or standard input is supplied, gather recursively searches the current directory.
Use --max-depth to limit traversal. Direct children of an input directory have depth 1, grandchildren have depth 2, and so on. A depth of 0 processes no directory descendants but does not exclude explicitly supplied files.
# Search the complete directory tree
acorn gather path/to/project
# Search only files directly inside the directory
acorn gather path/to/project --max-depth 1
# Include one nested directory level
acorn gather path/to/project --max-depth 2
--filter and --ignore are applied to the paths found within the selected depth.
Other inputs
acorn gather report.docx
acorn gather --text "doi:10.1234/example hdl:10013/epic.10033 RRID:SCR_012345"
printf 'https://ror.org/01qz5mb56' | acorn gather
Non-empty standard input is gathered automatically and can be combined with positional inputs. arXiv identifiers may use modern or legacy arXiv: forms or arxiv.org/abs/ and /pdf/ URLs. ISNI and ORCID have the same number shape, so discovery requires an explicit ISNI or ORCID label or the corresponding registry URL; an unlabeled compatible value is not guessed. RRIDs require an explicit RRID: label or an approved n2t.net or SciCrunch resolver URL; an unlabeled registry payload is not discovered. Remote URLs require network access. Global --offline mode rejects remote input and cannot be combined with --resolve.
Enrich RAD inputs
Use --enrich to enrich valid RAD inputs in memory before identifier discovery. Unlike format --enrich, gather does not rewrite source files. With --raw --enrich, enriched RAD candidates are emitted as JSON Lines for downstream processing.
--enrich and --resolve operate at different stages: enrichment augments RAD documents before discovery, while resolution looks up identifiers discovered from any supported input. See Metadata enrichment for provider configuration and the broader workflow.
acorn gather path/to/project --enrich
acorn gather path/to/project --raw --enrich > enriched.jsonl
acorn gather report.docx --resolve
acorn gather --text "ISNI: 0000 0004 9229 9539" --raw --resolve
acorn gather --osti projects "ACORN" --fuzzy relaxed
Watch mode
Use the global --watch flag to run immediately and gather again only when effective source content changes:
acorn --watch gather path/to/project
acorn gather --watch --watch-mode poll https://example.org/report.json
acorn gather --watch --osti projects "ACORN"
--watch-mode auto uses native filesystem notifications for local-only inputs and polling for HTTP(S), resolved identifiers, DOE CODE searches, and merge-request selections. Use --watch-mode poll for network-mounted paths or environments where native events are unreliable. --poll-interval (-p) accepts durations such as 500ms or 5s. Press q or Ctrl+C to stop watching. Standard input cannot be replayed and is therefore rejected in watch mode; repeated --text values remain static inputs.
Output formats
Gather supports console, json, markdown, and yaml output. When --format is omitted, an interactive terminal receives a table containing only discoveries and remote provider matches; piped or file output uses JSON. Resolution checks are rendered separately using the same detailed format as acorn check. Use --terse to render compact checks without the discovery table. Warning and error states are visible by default, while -vv also shows informational transitions such as found, resolved, created, enriched, and unchanged.
Use --raw to print only the normalized identifiers, one per line, for piping to another command. Raw stdout remains machine-readable: check diagnostics are suppressed unless -v is present, and verbose diagnostics are written to stderr without a table. With --raw --resolve, arXiv and DOI lines become citations, ISNI lines become Public Name (https://isni.org/isni/...), and ORCID lines become Given Family (https://orcid.org/...); other PID types retain their normalized form. An ISNI response without a usable public name uses its canonical URL. Use --citation-format to select apa, chicago, harvard, ieee, mla, or vancouver. The CLI option takes precedence over ACORN_CITATION_FORMAT, and the default is IEEE. Unsupported environment values produce a warning and use IEEE; unsupported CLI values are rejected. Use -q or --quiet to suppress output.
acorn gather report.docx --format console
acorn gather report.docx --format yaml --output discoveries.yaml
acorn gather report.docx --terse
acorn gather report.docx --raw | sort -u
acorn gather report.docx --raw --resolve --citation-format apa
Resolved raw output remains machine-readable: successful values use one line each. Load or resolution failures retain a nonzero exit status; they are silent by default and are rendered to stderr when verbosity is enabled. A DOI without the selected citation style and an ORCID without public given/family or credit-name data falls back to its normalized identifier. ISNI resolution queries the public registry once per unique normalized value, preserves the typed registry record as provenance, and leaves the local ISNI intact when the registry is unavailable, malformed, ambiguous, or has no assigned match. An assigned ISNI record confirms registry status only; it does not establish legal identity, ownership, affiliation, or a project relationship.
Research activity candidates
Unless global --no-local-database is set, ordinary gather appends every discovered identifier to discovery history and persists project-like discoveries as evolving research activity candidates. arXiv, DOI, RAiD, ISBN, patent, and ARK values can independently identify a candidate. arXiv revisions retain their versioned evidence but match the same unversioned candidate. Handle, ISNI, ORCID, ROR, PIDINST, RRID, unknown identifiers, and arbitrary URLs remain in the report and discovery history but do not create or merge candidates by themselves. Unstructured Handle discovery requires an explicit hdl: label or hdl.handle.net URL.
See the persistent identifier lifecycle for how ACORN finds, parses, validates, normalizes, classifies, and persists this evidence.
Candidates merge only when they share an exact normalized project identity. A new identity creates a row with a portable NanoID; one matching row gains missing fields and unique array values; repeated evidence is unchanged. Conflicting populated fields keep their stored value and record the observation as provenance. Evidence matching multiple rows is reported as a conflict without merging those rows.
Enrichment mapping
Enrichment is additive and evidence-driven. ACORN starts with the identifiers found locally or returned by the selected provider, calls only the resolvers applicable to that entity and URL, and maps explicitly asserted values into candidate fields. Identifiers are normalized before use; arrays are deduplicated; and websites are deduplicated by URL. Keywords and technologies are resolved to canonical values from ACORNâs embedded controlled vocabularies, including known aliases. --fuzzy strict is the default; relaxed lowers the automatic acceptance gates, while off disables fuzzy scoring and retains exact and normalized lookup. Values with no accepted vocabulary match are omitted from mapped candidate fields but remain in provider provenance. At database persistence, a new scalar fills an empty field, while a conflict with an existing populated scalar preserves the stored value and records the new observation as provenance. Unmapped values are not coerced into unrelated fields. Failure of an optional ORCID, GitHub, or GitLab lookup leaves the original provider result intact.
| Source and trigger | Candidate mapping | Guardrails |
|---|---|---|
CiteAs for a DOI found with --resolve | DOI, title, canonical project URL, and categories to meta.keywords | Empty title and URL values are ignored. |
CiteAs for an arXiv identifier found with --resolve | arXiv ID, any returned DOI, title, canonical project URL, and categories to meta.keywords | Resolution uses the canonical arXiv abstract URL; empty title and URL values are ignored. |
Handle proxy record found with --resolve | Normalized Handle to meta.handle; direct HTTP(S) URL string values to meta.websites | The Handle is supporting evidence for a project identifier found in the same source and never creates or merges a candidate independently. The complete record remains provenance; 10320/loc and non-string values are not interpreted. |
RAiD metadata found with --resolve | Primary title, primary or brief description to notes, supported alternate identifiers, alternate URLs to meta.websites, organization RORs to meta.ror, subject keywords to meta.keywords, normalized related RAiDs to meta.related, and one explicitly flagged contact to contact | A primary title is preferred, with the first non-empty title as fallback. Organization names are added only through the role-aware ROR mapping described below. A contributor is never inferred to be the contact; if zero or multiple distinct contributors are flagged as contacts, no singular contact is selected. |
| DOE CODE project search | osti-project:<code_id> identity, DOI, title, description to notes, repository and related links to meta.websites, sponsor names to meta.sponsors, and research, contributing, and developing organization names to meta.partners | DOE CODE people and organization results remain report-only. |
--lab with a DOE CODE project search | The selected laboratoryâs canonical ROR to meta.ror | The ROR must match the laboratory entry in ACORNâs embedded partner or sponsor vocabulary. |
| ORCID on a DOE CODE person result | Preferred display name, ORCID, public email when DOE CODE has none, and the union of public institutions and existing affiliations | Applies only to a valid ORCID on a person result and does not create a research activity candidate. |
| GitHub or GitLab repository on a project candidate | Provider-reported programming language names to meta.technology | ACORN checks the canonical URL and additional repository websites. GitHub requires an overt github.com repository URL. GitLab requires the configured GitLab domain and credentials. |
RAiD organization classification is driven by the explicit organization role, not by the organizationâs name. Funder maps to meta.sponsors; lead or other research organization, partner, contractor, facility, and other organization roles map to meta.partners. An organization carrying both funder and non-funder roles is represented in both lists. A single roleless organization is treated as the default lead organization and therefore as a partner; roleless entries in a multi-organization record are not classified. ACORN resolves a display name only when the ROR exists in its embedded sponsor or partner vocabulary. Otherwise, the normalized ROR remains in meta.ror without an invented name.
The persistent identifier lifecycle describes field precedence, identity matching, CFF intake, and provenance in more detail. JSON and YAML reports include each persisted candidateâs iid and action, plus created, enriched, unchanged, and conflicts totals under summary.candidates.
# Discover identifiers without writing discovery history or candidates
acorn --no-local-database gather --text "doi:10.1234/example" --format json
# Resolve supported metadata and create or enrich candidates
acorn gather report.docx --resolve --format yaml
acorn gather report.docx --raw --resolve
Candidates are internal evolving records. Database-backed candidate export and completeness scoring are not currently available.
DOE CODE searches
Use --osti to search DOE CODE for projects or to aggregate credited people and organizations from matching projects.
acorn gather --osti projects "ACORN"
acorn gather --osti people https://orcid.org/0000-0002-2057-9115
acorn gather --osti projects --organization ORNL --organization-role site-owner
acorn gather --osti organizations ORNL --all --format json
acorn gather --osti projects --lab ORNL --all
--lab restricts results to projects submitted by one of DOEâs 17 national laboratories. Laboratory acronyms are case-insensitive. It sets the organization role to site-owner and cannot be combined with --organization or --organization-role. Each persisted project candidate is enriched with the laboratoryâs canonical ROR from ACORNâs partner and sponsor vocabularies.
DOE CODE searches return one page by default. --limit controls the upstream page size, --offset selects a later page, and --all retrieves every page sequentially. DOI and ORCID resolver URLs are normalized to the bare identifier expected by DOE CODE. --organization-role can restrict organization matching to site-owner, research, sponsor, contributor, or developer; the default matches any credited role.
Project matches create or enrich candidates using the DOE CODE project ID and DOI when available. Gather retains the project title and description, repository and related websites, sponsoring organizations, and research, contributing, and developing partner organizations. When the repository overtly uses github.com, gather queries the GitHub API for programming languages. A repository on the configured GitLab domain receives equivalent enrichment when GitLab credentials are available. Language names are recorded in meta.technology.
With --resolve, people searches enrich valid ORCID matches with the preferred name, public email, and institution data returned by the ORCID API; project repository links are checked and enriched with provider-reported languages when available. Canonical and additional provider links are also checked for liveness during this optional online stage. A failed lookup retains the original provider data. People and organization searches are report-only. Global --no-local-database keeps all DOE CODE results report-only.
OSTI mode treats positional inputs and --text values as direct queries rather than files or URLs. It requires network access and is incompatible with file filtering, merge-request gathering, and schema analysis options. With --resolve, project DOIs and person ORCIDs use the same raw rendering and structured resolution metadata as local discoveries.
Next stop:Â Validate a gathered candidate with Check.
đ„ Import
In a nutshell
Import local or remote research-content buckets and BagIt archives, or populate ACORN's model catalog.
Research content and BagIt archives
Use acorn import without a subcommand to transfer research content from a local directory, a remote repository, or a 7z, ZIP, TAR, or TAR.GZ BagIt archive:
acorn import ./local-bucket
acorn import https://github.com/example/research-data
acorn import https://example.org/deposit.tar.gz --output ./content
acorn import https://example.org/deposit.7z --output ./content
Archive type is inferred from a bounded content header. --archive-format 7z|zip|tar|tar.gz bypasses inference, which is useful for extensionless downloads. Extracted archives must contain valid BagIt metadata at their root or beneath one enclosing directory; their complete SHA-256 or SHA-512 payload manifest is verified before files are imported. Extraction rejects traversal paths, links, duplicate destinations, and writes through pre-existing symlink components.
--filter, --ignore, --flatten, and --clobber have the same transfer meaning as bucket download. --config loads bucket sources from an ACORN configuration. Offline import is accepted only when every selected source is local. The original archive URI is retained as transfer provenance.
Import and download share one BagIt archive resolution path. The two commands differ only in transfer policy: import accepts local directories, local bucket entries in configuration, and offline local transfers, while top-level download is reserved for remote repositories and verified BagIt archives. Both publish only the contents of the bagâs data/ directory, and neither copies BagIt tag files to the output.
Configuration accepts bare bucket paths and URLs, or a named source string when a stable label is useful:
buckets:
- ./local-bucket
- name: shared-research
source: https://github.com/example/research-data
Use a detailed source object for provider-specific fields. The legacy repository and codeRepository keys remain accepted as input aliases, and all forms use the same fallible source parser as positional command input.
Top-level acorn download remains for remote repository transfers and rejects local sources and offline operation. Model commands retain their own local and offline behavior.
Model metadata
acorn import model can populate the general model catalog or inspect selected Hugging Face repositories for GGUF metadata. Repository inspection records GGUF file URLs, exact quantizations, revisions, and byte sizes without downloading model weights or checksum sidecars.
Import the model catalog
Run the command without model selectors or a configuration file to populate the local database from the models.dev catalog:
acorn import model
If the model table is already populated, ACORN leaves the existing records in place.
Import selected Hugging Face models
Supply one or more Hugging Face repository IDs to inspect only those repositories:
acorn import model openai/gpt-oss-20b
# Comma-separated and space-separated repository IDs are accepted
acorn import model openai/gpt-oss-20b,Qwen/Qwen2.5-0.5B-Instruct-GGUF
Use --model-file to load repository IDs from a local path, file:// URI, or HTTP(S) URL:
acorn import model --model-file ./models.txt
acorn import model --model-file file:///path/to/models.yaml
acorn import model --model-file https://example.org/models.json
The document may be a newline-separated plain-text list, a JSON or YAML list of repository IDs, one model-details object, or a list of model-details objects. For minimal model details, id is preferred and name is used when id is absent:
[
{
"name": "gpt-oss",
"id": "openai/gpt-oss-20b"
},
{
"id": "Qwen/Qwen2.5-0.5B-Instruct-GGUF"
}
]
For catalog records that declare open_weights or weights, ACORN uses explicit Hugging Face repository URLs from weights. When an open-weight record has no declared weight source, ACORN uses its id to search for a GGUF fallback, including when that ID is not itself a Hugging Face repository. Closed models and records with non-Hugging Face weight sources are skipped. Entries that still cannot resolve produce warnings without aborting the remaining catalog import. This allows catalogs containing both hosted and open-weight models to be used directly:
acorn import model --model-file https://research.ornl.gov/api/models.json
Positional repository IDs, entries from --model-file, and supported --config entries are combined and deduplicated before import.
Synchronize imported models
Pass --sync to add the unique model identifiers resolved by this invocation to the ACORN configurationâs models list and to both OpenCode and llama-swap configuration. Existing ACORN model entries are preserved and duplicate identifiers are omitted. Select one inference target with --sync opencode or --sync llama-swap:
acorn import model openai/gpt-oss-20b --sync
acorn import model openai/gpt-oss-20b --sync opencode
acorn import model openai/gpt-oss-20b --sync llama-swap
Import resolves and persists repository metadata; it does not download weights. Synchronization therefore adds only imported models whose GGUF files are already available in the configured models directory by default. Models without a resolvable local GGUF are reported and skipped.
Add --force to skip the local existence check and assume each imported model is located at <models-dir>/<model-id>:
acorn import model openai/gpt-oss-20b --sync --force
Use --dry-run without --sync to resolve and report model metadata without persisting it to the database:
acorn import model openai/gpt-oss-20b --dry-run
Combine --dry-run with --sync to also print ACORN and inference-configuration diffs without writing files:
acorn import model openai/gpt-oss-20b --sync --dry-run
Inline --sync is additive and operates only on models resolved by the current import. Use the standalone acorn sync command to reconcile every model in ACORN configuration, override target paths or the models directory, preview changes independently, or remove stale ACORN-managed entries with --prune.
When a repository has no GGUF files, ACORN searches for a GGUF repository derived from that model. Control fallback discovery with:
# Search at most 50 candidate repositories
acorn import model openai/gpt-oss-20b --search-limit 50
# Require GGUF files in the selected repository
acorn import model Qwen/Qwen2.5-0.5B-Instruct-GGUF --no-fallback
# Choose interactively when fallback discovery finds multiple candidates
acorn import model openai/gpt-oss-20b --interactive
The default search limit is 20 and can also be set with ACORN_SEARCH_LIMIT.
Import models from configuration
Use --config to inspect Hugging Face models listed in an ACORN configuration file:
acorn import model --config .acorn.json
A detailed entry can select a repository revision:
{
"models": [{
"name": "qwen-gguf",
"source": {
"provider": "huggingface",
"location": "https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF"
},
"revision": "main"
}]
}
Individual model selectors must be Hugging Face repository identifiers. --model-file identifies a document containing selectors; it does not import a local weight file or a direct model-weight URL.
Database, authentication, and offline behavior
Use the global --database-path option to select the local database:
acorn --database-path ./acorn.db import model openai/gpt-oss-20b
With --no-local-database, selected repositories are still resolved and reported, but their metadata is not persisted. A catalog import without selectors is skipped:
acorn --no-local-database import model openai/gpt-oss-20b
For private or gated Hugging Face repositories, set HF_TOKEN, HF_API_TOKEN, or HUGGINGFACE_HUB_TOKEN. Global --offline mode rejects HTTP(S) model-list URLs and remote Hugging Face metadata import; local paths and file:// model lists can still be read.
Use imported metadata during download
After importing metadata, constrain the download by exact quantization and available GPU memory:
acorn import model openai/gpt-oss-20b --search-limit 20
acorn download model openai/gpt-oss-20b \
--quantization Q4_K_M \
--gpu-memory 24GB
See Download for download selection, filtering, split-shard sizing, and configuration details.
Next stop:Â Select model weights with Download.
đ§ Infer
acorn infer has three paths. A prompt argument or piped text uses the managed Needle sidecar and its legacy tool loop. --route opts into native capability routing. The run subcommand hydrates an embedded prompt asset or local Rhai script and optionally sends it to ACP or an OpenAI-compatible endpoint. ask is an alias for infer.
acorn infer "Validate this research activity"
echo "Validate this research activity" | acorn infer
acorn infer run summarize input.json --dry-run
acorn infer run summarize inputs/ --dry-run
acorn infer run summarize 'notes/*.json' --dry-run
acorn infer run summarize --data '{"text":"Inline JSON"}' --dry-run
acorn infer run summarize input.json --data '{"text":"Additional context"}' --dry-run
printf '%s' '{"text":"Additional context"}' | acorn infer run summarize input.json --data --dry-run
acorn infer run summarize --data --paste --dry-run
acorn infer run translate input.yaml --set language=French
cat input.zon | acorn infer run teach -
acorn infer run summarize input.json --agent codex
acorn infer run ./crates/acorn-cli/examples/prompts/summary.rhai --data '{"text":"Research notes"}' --dry-run
acorn infer run ./crates/acorn-cli/examples/prompts/title.rhai --data '{"description":"A study of local water quality"}' --agent codex
acorn infer run summarize --backend openai --model qwen3 --base-url http://localhost:8080
acorn infer run summarize --backend ollama --model gemma4
Native capability routing
--route opts into the native capability registry. Without --capability, it only previews Needleâs choice and never invokes a handler. When Needle returns a call, its name appears in response.function_calls; the outcome may be needs-input or withheld. The pinned runner selected 44 of 75 supported calibration capabilities correctly, below the required 95% gate. Use a direct ACORN command when you need a reliable operation choice. See the routing evaluation for the measured limits.
acorn infer "Return the running ACORN version" --route
acorn infer "Return the running ACORN version" --route --capability acorn.version --input-json '{}'
acorn infer "Return the running ACORN version" --route --capability acorn.version --input-json '{}' --route-preview
An explicit --capability limits the catalog to that ID. A handler can run only when you also supply exact --input-json and the confidence, grounding, schema, binding, and policy checks pass. --route-preview keeps an explicit route in preview mode. Mutating operations additionally require --apply, --binding, and --destination; the destination must match the JSON arguments exactly. Keep the default confidence threshold while the selection gate is open.
After validating a complete research activity document, compare two of its Big-O expressions through the offline-safe native binding:
acorn --offline infer "Compare these validated Big-O bounds" --route \
--capability acorn.diff::bigo --binding native:acorn.diff::bigo \
--input-json '{"left":"O(n^2)","right":"O(n log n)"}'
The native route uses the same comparison input and result as acorn.compare_big_o in MCP. A completed result contains content.dominance and effective content.assumptions; incomparable and undetermined are successful results. Invalid notation or an unknown assumption yields tool-failed with a bounded error naming the side or symbol. The route requires a configured local Needle sidecar and may be withheld by its grounding or confidence gate; explicit capability and binding selection does not bypass those checks.
Embedded prompts
Known assets are eli5, extract-claim, find-gaps, suggest-fixes, summarize, teach, and translate. Each resolved input file must contain a JSON, YAML, or ZON object. infer run merges those objects and supplies the result to the template as data.
Prompt variables
The built-in templates read these data variables:
| Prompt | Variable | Type and default | Description |
|---|---|---|---|
eli5 | text | String, defaults to "" | Material to explain in simple terms. |
extract-claim | text | String, defaults to "" | Material from which to extract explicit claims and supporting evidence. |
find-gaps | text | String, defaults to "" | Material to inspect for omissions and unanswered questions. |
suggest-fixes | version | String, defaults to "1" | Version associated with the findings. |
suggest-fixes | findings | Array, defaults to [] | Structured findings for which the prompt should suggest fixes. |
summarize | text | String, defaults to "" | Material to summarize. |
teach | text | String, defaults to "" | Material to turn into an instructional explanation. |
translate | language | Required string | Target language. Supply it in an input object, --data, or --set language=French. |
translate | text | String, defaults to "" | Material to translate. |
Additional top-level fields are accepted and remain visible in the complete data block appended to every hydrated prompt, even when the template does not interpolate them directly. The names config and data are reserved and cannot be supplied as top-level data fields.
The templates also use internal configuration values. infer run currently uses their embedded defaults; --data and --set modify prompt data, not configuration. The prompt-specific settings are:
eli5:maxWordsis 150 andincludeAnalogyistrue.extract-claim:maxItemsis 5 andminConfidenceis 0.5.find-gaps: no prompt-specific settings.suggest-fixes: no prompt-specific settings.summarize:maxItemsis 5 andmaxWordsis 160.teach:includeExamplesandincludePracticeare bothtrue.translate: no prompt-specific settings.
All templates also carry Dotprompt model configuration fields such as temperature and maxOutputTokens. Most carry topK and stopSequences as well. These are not accepted as infer run data variables. Prompt input and output names use camelCase; existing snake_case input names remain accepted when they correspond to a declared prompt setting.
Files, directories, and glob patterns may be combined for collective analysis. Directories recursively select JSON, YAML, YML, ZON, and ZONF files as if passed as DIRECTORY/**/*; matches are sorted, strings are joined with blank lines, arrays are concatenated, and conflicting scalar values are rejected.
Use --data JSON for an inline JSON object. Bare --data reads JSON from piped standard input; --data --paste reads it from the system clipboard instead. Piped standard input and --paste are mutually exclusive. Positional sources are loaded first, --data is merged after them, and repeated --set KEY=VALUE options are applied last. Bare piped standard input without --data retains automatic JSON, ZON, then YAML decoding. JSON booleans, numbers, and null supplied through --set retain their types, while other input becomes a string. Arrays, objects, reserved keys, invalid keys, and type changes are rejected.
The prompt data block defaults to canonical ZON; use --format json for troubleshooting. --dry-run prints the hydrated prompt without reading credentials, checking an executable, starting a process, or making a network request. --output json emits a tagged preview or result envelope.
Backends
Backend precedence is an explicit --backend, then ACORN_INFERENCE_BACKEND, then acp. ACORN does not fall back if the selected backend fails.
- ACP uses
opencode acpby default. Select--agent codexto use Codex through an installedcodex-acpadapter.--agent-executable,--working-directory, and optional--modelcustomize either agent session; ACORN does not install adapters or fall back between them. - Ollama uses its OpenAI-compatible Chat Completions API at
http://localhost:11434/v1/chat/completionsby default. Select--backend ollama --model MODELwith a model already available to your Ollama server.--base-urlselects another server and--endpoint-mode responsesopts into its Responses API. The Ollama selector ignoresOPENAI_SERVER_HOST; it does not start Ollama or download a model. - OpenAI-compatible inference requires
--model.--base-urloverridesOPENAI_SERVER_HOST,--endpoint-modeselectsresponsesorchat-completions, andOPENAI_API_KEYis the only credential source.
All backends use a 30-second default timeout. ACP tool mutation stays denied by policy. Local Ollama needs no credential; an explicit remote server uses the existing HTTPS and OPENAI_API_KEY rules.
Codex through ACP
ACORN starts codex-acp, requests a read-only Codex session, and rejects tool mutation requests. It does not invoke the codex executable directly. Use the software diagnostic to check the Codex CLI and adapter separately, then select Codex for a run:
acorn doctor --check software
acorn infer run summarize input.json --agent codex
acorn infer run summarize input.json --agent codex --model MODEL
acorn infer run summarize input.json --agent codex --agent-executable /path/to/codex-acp
If codex-acp is missing, install it with npm install -g @agentclientprotocol/codex-acp. That global installation does not require npx. If npm and npx are unavailable, install Node.js/npm or place a standalone binary from the codex-acp releases on PATH.
Custom Rhai prompts
Pass a local .rhai path where infer run normally accepts an embedded prompt name. The standard ACORN binary enables the libraryâs exec feature for this. The script uses the workflow Rhai header // @acorn-exec-v0.2.0 and defines one fn evaluate(context) that returns nonempty text. That text is the complete prompt sent to the selected backend. ACORN does not append data after it.
For a prompt that includes every supplied input field, save this as summary.rhai. A copy is in crates/acorn-cli/examples/prompts/summary.rhai:
// @acorn-exec-v0.2.0
fn evaluate(context) {
"Summarize the following research material in three concise points. State uncertainty explicitly.\n\n" + context.data_block
}
Run it with the same file, directory, stdin, --data, and --set inputs used by embedded prompts:
acorn infer run ./summary.rhai --data '{"text":"Research notes"}' --dry-run
acorn infer run ./summary.rhai notes.json --agent codex
acorn infer run ./summary.rhai notes.json --format json --output json --dry-run
context.data is the merged input object, context.config contains the current prompt configuration defaults, and context.data_block is the complete fenced input block. --format selects ZON (the default) or JSON for that block. Scripts can use individual values instead; crates/acorn-cli/examples/prompts/title.rhai reads context.data.description. A script that needs no input receives an empty data object.
Prompt scripts have bounded size, runtime, and output. They receive no filesystem, network, process, environment, import, or dynamic evaluation functions. ACORN reads the script file, and --dry-run evaluates it and prints the result without starting an agent. Script errors stop the command before an inference request.
Cargo examples
The Rust examples in crates/acorn-cli/examples/ show the same library API used by infer run. Each has a built-in demonstration script and can also read a .rhai path. The preview runs without an agent; the ACP example starts the selected installed agent:
cargo run --example rhai_preview
cargo run --example rhai_preview -- ./crates/acorn-cli/examples/prompts/summary.rhai
cargo run --example rhai_preview -- ./crates/acorn-cli/examples/prompts/title.rhai
cargo run --example rhai_acp -- opencode
cargo run --example rhai_acp -- codex ./crates/acorn-cli/examples/prompts/title.rhai
đ„ Intake
In a nutshell
Review logbook submissions from a JSONL source with
acorn intake. Usestage --source,inspect, andapplyfor local review, whether the source is a local file or a GitLab file URL. Userunfor the configured GitLab merge-request workflow.
Workflow
Both workflows check submissions against the configured folder and member rules before proposing a project change. Local review writes proposals for existing local indexes; the GitLab worker creates merge requests. The source location does not change the review workflow or destination.
The arrows show the main review path. intake export is an optional, read-only artifact step after a GitLab review branch exists. Run intake run again to process review notes. intake deliver separately sends ready callbacks from the durable queue; it is not required to export a diff.
JSONL sources for local review
--source accepts an ordinary filesystem path, an absolute file: URI, or a GitLab HTTPS file link. For example:
acorn intake stage --batch --config .acorn.json --source logbook.jsonl
acorn intake stage --batch --config .acorn.json --source 'file:///Users/me/project/logbook.jsonl'
CI_SERVER_HOST=code.ornl.gov acorn intake stage --batch --config .acorn.json \
--source 'https://code.ornl.gov/research-enablement/experiments/power-automate/-/raw/main/.acorn/intake/logbook.jsonl'
GitLab links may use /-/raw/ or /-/blob/, followed by a branch, tag, or commit and the file path. Encode a slash inside a revision as %2F (for example, feature%2Freport). Encode spaces in URI paths as %20; ordinary local paths can be quoted. Use links without credentials, query parameters, or fragments. Other remote services and URI schemes are not supported by this adapter.
GitLab access uses the existing GITLAB_TOKEN, PRIVATE_TOKEN, or CI_JOB_TOKEN environment references. The linkâs origin must match CI_SERVER_HOST (default gitlab.com); credentials are never taken from the link. The remote adapter resolves the revision to an immutable commit, reads that exact file, and saves its original bytes plus a source.json provenance receipt under .acorn/intake/sources/. The receipt records the GitLab service, project, branch, path, commit, last file commit, and SHA-256 content digest. Missing files fail explicitly. Sources are limited to 10 MiB and individual records to 64 KiB.
Subsequent inspection and apply use the captured file, including when offline. They do not re-fetch a moving branch. Keep the snapshot directory with the proposals or batch manifest; changing or deleting the captured bytes invalidates a batch. Staging the same revision and content reuses the snapshot without overwriting it. To review newer remote content, stage the link again. --offline rejects remote links before fetching; it accepts local paths and file URIs, including previously captured snapshots.
Remote staging does not require a bot, operation database, or Power Automate callback configuration. It does not drain the remote inbox, create a merge request, or send notifications. Destination and membership rules still come from the explicit ACRE configuration.
For one reviewed batch across existing standalone file: project indexes:
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>
stage --batch prints a stable batch ID and stores a private manifest under .acorn/intake/batches/. It groups entries by canonical project and folds repeated project lines in source order. Review each line outcome, destination, and proposed diff with inspect before applying. A rejected line prevents applying the whole batch. The summaryâs canApply field reports this decision. Stage and inspect leave the inbox and indexes untouched. Apply rechecks the exact source, configuration, routes, access, and index digests before its first write. If interrupted, repeat apply with the same batch ID; inspect shows each projectâs current state. An unrelated index change requires a new reviewed batch.
Both apply selectors display the terminal Yes / No buttons before changing an index. No is selected initially: Enter declines, Tab or the left/right arrows switches the selection, and y or n chooses directly. Escape or Ctrl+C cancels. Declining or cancelling returns a nonzero exit status without applying changes. Review the staged proposal or batch diff first; the prompt identifies the selection and configuration.
For a previously reviewed unattended invocation, add --yes. This is required if either input or output is redirected, including piping the receipt to another program. Missing terminal access never implies approval. Apply reloads its configuration after approval so membership changes during the prompt take effect. --yes skips only the prompt; admission, source, route, digest and replay checks still run.
An entry may supply identifier, global, archived, origin, and discovery when preserving existing report records. Without them, intake generates a submission-based identifier and uses a manual, active, project-only entry. Discovered entries require discovery provenance.
Submission corrections
An edited submission is a new immutable receipt. Its optional revision object identifies the original receipt (rootSubmissionId) and the exact receipt being corrected (supersedesSubmissionId). Each correction has a new submissionId; it retains the original submitter, project, report placement and logical entry identifier. Keep both original and correction rows in the downloaded logbook.
Use stage --batch, inspect, then confirmed apply for corrections. Inspection identifies the predecessor and shows the proposed change. The batch replaces the exact previous logbook entry, so the current index contains one entry per logical highlight. Original receipt bytes remain in the source snapshot and batch manifests. A correction source may include its ancestry in chronological order, or use ancestry from previously applied batches in the same local workspace.
Missing ancestors, competing corrections, ownership or placement changes, and altered or graduated predecessors stop the batch for operator review. Apply revalidates the correction evidence before writing. Existing generated reports are unchanged; corrected content is available for a later report. This does not automatically amend published reports or undo graduated metadata. Single-submission intake and the GitLab worker reject corrections until they have a revision-aware review adapter.
This is the local receipt contract; availability of editing in a deployed PowerApp depends on that appâs separately validated history and correction flow.
For the existing single-submission workflow:
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>
stage writes proposals without changing the inbox or RAD index. apply --submission-id rechecks the destination and base index digest before writing one reviewed proposal. If the index changed, stage the submission again. A GitLab-sourced inbox needs an explicit handoff: stop its intake worker, use an exact local snapshot, reconcile reviewed index changes into the approved repository, and handle only the exact completed lines before restarting the worker.
Downloaded JSONL to a local PDF
For a SharePoint export, download the combined logbook.jsonl in the browser first. Direct SharePoint HTTPS authentication is planned, not yet implemented. If reviewing only selected submissions, copy their complete original lines into a separate JSONL file without changing UUIDs or payload bytes.
Run from the local workspace containing intake.json, report.json and selected-demo.jsonl. Both ACRE configs must reference the same local destination indexes; the intake config also declares authorized members. Keep this order:
# 1. Stage the selected original rows.
acorn --offline intake stage --batch \
--config intake.json --source selected-demo.jsonl
# 2. Inspect the batch ID returned by stage.
acorn --offline intake inspect --config intake.json --batch-id <batch-ID>
# 3. Apply after review; confirm with the Yes / No buttons.
acorn --offline intake apply --config intake.json --batch-id <batch-ID>
# 4. Produce one local PDF for this example reporting window.
acorn --offline report --config report.json \
--from 2026-10-26 --through 2026-10-27 \
--dry-run --combine
Replace the batch placeholder and reporting dates for your review. The report uses the current directory as its root, includes all configured folders, and writes .acorn/reports/report.pdf. Use --project only to narrow a multi-project configuration, --output only for a different output directory, and --root only when reporting from another directory. Combined mode needs no commit identifier. --through is required unless supplied by ACORN_REPORT_THROUGH or inferred from a month-only --from; omitting --from includes all earlier history. Browser discovery uses cached or installed Chrome/Chromium; set CHROME_PATH if needed, since offline mode cannot fetch a browser.
Intakeâs config/source/batch arguments remain explicit. Apply prompts by default; --yes is only for reviewed unattended execution. This local flow sends no callbacks, messages or published reports. Optional metadata graduation is separate and is not needed to report the ingested logbook entries.
Both bounds accept YYYY-MM-DD dates, interpreted as midnight UTC, or full RFC 3339 timestamps with an explicit offset. They also accept DDMMM (for example, 27OCT) and MMM (for example, OCT), case-insensitively, using the current UTC year. Calendar dates use the supported 1950â2029 range. A month-only --from OCT starts on October 1 and defaults --through to November 1, including Octoberâs final day; --through OCT has the same exclusive November 1 bound. --from is inclusive and --through is exclusive: the example includes all of October 26 UTC and excludes October 27. Use the following dayâs date to include a complete final day. The same bound syntax works in ACORN_REPORT_THROUGH; invalid calendar dates and timestamps without offsets are rejected.
Local graduation
After ingestion, run --index promotes supported logbook entries into canonical metadata. Choose how to approve them:
acorn intake run --index project/index.json --dry-run > candidates.json
acorn intake run --index project/index.json --interactive
# Accept every eligible promotion without prompts:
acorn intake run --index project/index.json --force
# Alternatively, accept specific entries from an exact reviewed preview:
acorn intake run --index project/index.json \
--accept <reviewed-entry-ID> --expected-digest sha256:<digest-from-preview>
The preview prints candidates, source logbook context, and base/proposed SHA-256 digests without changing the file. Personnel entries propose contributor names; supported administration entries can propose classification. Review the proposed target and value before accepting. Repeat --accept for multiple reviewed entries; this mode requires --expected-digest and writes without prompting.
| Mode | Behavior |
|---|---|
--dry-run | Validate and preview every eligible promotion; write nothing. |
--interactive | Ask Yes / No for each candidate, then confirm the selected write. |
--force | Accept every eligible promotion without prompts. |
--accept ID --expected-digest DIGEST | Apply the specified reviewed entries without prompts. |
Interactive buttons default to No. No skips an individual candidate; Escape or Ctrl+C cancels the entire operation. Declining the final write also cancels without creating a backup. Interactive mode requires terminal input and output. --dry-run --interactive previews the selected entries without a final write prompt. --dry-run --force remains read-only. --force conflicts with --interactive and --accept. With eligible candidates, a bare run --index requests an explicit approval mode; with none, it returns unchanged without writing.
Graduation validates the whole selection and both input and output, retains and archives the source entries, and saves exact original bytes in an adjacent .graduation-<SHA256>.before file before atomic replacement. --force preserves these checks and leaves unsupported entries unchanged. You can also supply --expected-digest with --force or --interactive to pin a previous preview. The index is checked again after interactive approval. JSON, JSONC, YAML/YML, and ZONF indexes are supported; serialization may normalize formatting and remove JSONC comments.
Unknown, archived, ambiguous, or stale selections fail without modifying the index. A repeated invocation with the old digest fails safely; rerun the preview to see remaining candidates. Use an isolated checkout with exclusive ownership while applying: the digest is a review guard, not a lock against unrelated concurrent editors. Preserve the emitted before/after digest receipt and backup. These local commands neither approve a remote merge nor remove any GitLab inbox lines.
GitLab review
acorn intake run --config .acorn.json
acorn intake export --config .acorn.json --submission-id <submission-UUID> --output change.diff
acorn intake deliver --config .acorn.json
run --config polls the configured inbox and review notes once, then processes bounded durable work. export writes a unified diff and an adjacent JSON receipt for an admitted submission. deliver attempts ready callback intents without running the bot. This mode rejects local graduation flags and cannot run offline. GitLab commands need a persistent ACORN_DATABASE_PATH; see ACREâs GitLab logbook inbox setup for configuration, retry behavior, and prerequisites.
đžïž Link
In a nutshell
Add linked-data context and create JSON-LD with
acorn link <PATH>.
acorn link maps RAD fields to defined ontologies and vocabularies, then writes the result as JSON-LD for programmatic use.
Tip
Linked Data creates a connected network of standards-based, machine-readable data across Web sites.
Example usage
# Link a specific research activity index
acorn link path/to/project/index.json
# Create JSON-LD from Markdown RAD
acorn link path/to/project/index.md
# Link all research activity data in a directory
acorn link path/to/project/
Tip
The
linkcommand is almost identical to theformatcommand, complete with support for the--dry-runflag to preview changes without creating files.
Example output
"contact": {
+ "@context": {
+ "jobTitle": "https://schema.org/jobTitle",
+ "givenName": "https://schema.org/givenName",
+ "familyName": "https://schema.org/familyName",
+ "identifier": "https://orcid.org",
+ "email": "https://schema.org/email",
+ "telephone": "https://schema.org/telephone",
+ "url": "https://schema.org/url",
+ "organization": "https://schema.org/worksFor",
+ "affiliation": "https://schema.org/affiliation"
+ },
+ "@type": "https://schema.org/person",
"jobTitle": "Primary Investigator",
"givenName": "Audson",
"familyName": "Cargohlmuth",
"email": "wohlgemuthjh@ornl.gov",
"telephone": "865.576.7658",
"url": "https://www.ornl.gov/staff-profile/jason-h-wohlgemuth",
"organization": "Geospatial Science and Human Security Division",
"affiliation": "National Security Sciences Directorate"
}
Next stop:Â Turn linked RAD into an artifact with Export.
MCP client
In a nutshell
Discover and invoke explicitly allowlisted tools on configured MCP servers with
acorn mcp.
Configure a server and the tools ACORN may use:
mcp:
research-tools:
transport:
type: child-process
command: research-mcp
args: [serve, --stdio]
environment:
RESEARCH_TOKEN: RESEARCH_MCP_TOKEN
allowed:
resolve_identifier:
effects: [network-read]
max_output: 256KB
timeout: 20
The environment mapping names a child variable on the left and a parent environment variable on the right. ACORN resolves the executable without a shell, clears the inherited child environment, and supplies only those mappings. Missing or empty variables are rejected without printing their names or values.
List the allowlisted tools the server currently advertises, then call one with a JSON object:
acorn mcp --config .acorn.yml list research-tools
acorn mcp --config .acorn.yml call research-tools resolve_identifier \
--arguments '{"identifier":"https://doi.org/10.1000/example"}'
Connect to the ACORN MCP server
The ACORN CLI can use another ACORN process as its MCP server. Configure a child-process transport that starts acorn serve mcp, and allowlist the built-in tools the client may use:
mcp:
local-acorn:
transport:
type: child-process
command: acorn
args: [serve, mcp]
allowed:
acorn.version:
max_output: 4KB
timeout: 10
The client starts the server automatically for each command, exchanges MCP messages over standard input and output, and closes the server when the operation finishes:
acorn mcp --config .acorn.yml list local-acorn
acorn mcp --config .acorn.yml call local-acorn acorn.version --arguments '{}'
The first command lists acorn.version. The second returns the server version in structuredContent.version. Replace or extend the allowed map to use other tools exposed by acorn serve mcp; tools absent from that map cannot be called.
Both commands write deterministic pretty JSON to standard output. The call output is the complete MCP result, including content, structured content, metadata, and isError. When a server returns isError: true, ACORN prints that result and exits unsuccessfully.
Streamable HTTP servers use HTTPS except for loopback development endpoints. Bearer tokens are read only from a named environment variable:
mcp:
institutional-tools:
transport:
type: streamable-http
url: https://mcp.example.org/service
bearer_token_env: INSTITUTIONAL_MCP_TOKEN
allowed:
lookup_record:
effects: [network-read]
Global --offline rejects Streamable HTTP before any connection. Local child-process servers remain available, but tools declaring network-read are unavailable. Mutation, destructive, and filesystem-write effects require --allow-mutation on mcp call; credential and process effects are unavailable. Remote tool annotations are returned for display but cannot relax the configured effects policy.
Each list or call creates, initializes, and closes one MCP session. ACORN does not accept arbitrary commands, URLs, headers, or tool names from call arguments, and it does not automatically expose remote tools through its MCP server, JSON-RPC, gRPC, webhooks, or ACP.
Next stop:Â Embed the same policy-checked client with the Rust MCP client API.
đ Report
acorn report selects accepted logbook updates from configured project index.json files and creates PDF reports, local PowerPoint decks, or both. Apply reviewed intake entries before reporting; graduation is optional and archived entries remain eligible.
# Existing PDF publication workflow.
acorn report --config .acorn.json --through 2026-11-01 --commit "$CI_COMMIT_SHA"
# Local PowerPoint decks for an explicit window.
acorn --offline report --config .acorn.json --from 2026-10-01 --through 2026-11-01 \
--format powerpoint --commit 0123456789abcdef --dry-run
# One combined local PDF and one local deck per selected project.
acorn --offline report --config .acorn.json --from OCT --format pdf,powerpoint \
--combine --commit 0123456789abcdef --dry-run
--format defaults to pdf. Specify pdf, powerpoint, or both; repeat --format or separate the values with commas. Use --project ID to restrict configured projects and --output PATH to change the default .acorn/reports output directory. --root PATH selects the repository checkout containing the configured project paths.
Reporting window
--from is inclusive and --through is exclusive. Both accept YYYY-MM-DD, DDMMM, MMM, and RFC 3339 timestamps with an offset. A date names midnight UTC. Month shorthand uses the current UTC year: --from OCT begins October 1 and, when --through is omitted, ends at November 1; --through OCT also means November 1. Supply the following dayâs date to include an entire final day. ACORN_REPORT_THROUGH can supply the upper bound.
An explicit --from selects the same window for every requested format. Without it, normal PDF reporting uses each projectâs previous GitLab manifest through as the lower bound, or full history if none exists. When a PDF manifest is replayed for an unchanged upper bound, a deck requested in the same normal run uses that manifestâs recorded window. PowerPoint-only and --combine runs use full history through the selected upper bound when --from is omitted.
Updates without a project stay on the PDF title-page path; they do not become project slides. Projects without selected project updates produce no deck.
PowerPoint decks and templates
PowerPoint output is one report.pptx per selected project, with one slide for each category containing updates in the window. Slides follow schema category order; entries within a category are newest first. The slides include project context, available authored media, and source entry IDs in speaker notes. A category that exceeds the reference slideâs capacity fails with an error; an earlier valid deck remains in place.
By default, each project uses reference.pptx beside its index.json. Use --reference PATH to choose another template. A relative path is resolved beside each projectâs index.json; an absolute path is used for every selected project. The reference must contain the named title, subtitle, and achievement slide fields and a notes field on its notes slide. --reference affects PowerPoint only.
Project artifacts use <output>/<project-id>/<through>-<commit>/report.pptx, beside report.pdf when both are produced. The directoryâs upper bound has its punctuation removed, and the commit component uses the first 12 hexadecimal characters of --commit. The full selected window appears inside the deck. PowerPoint output needs a commit identity for this path, including with --combine; it needs no GitLab pipeline or job ID.
PDF publication and --combine
Normal PDF reporting retains its GitLab PDF package, manifest, and callback workflow. PowerPoint decks stay local and are absent from those PDF packages and callbacks. PowerPoint-only reporting creates local decks without publishing manifests or sending callbacks. --dry-run generates local artifacts and PDF manifests, where applicable, without publication or callbacks.
--combine applies to PDF only: it writes <output>/report.pdf with the selected projects and does not publish per-project PDFs. It never merges PowerPoint decks or changes their count. A PDF-only combined run needs no commit identity; add --commit when the selection includes PowerPoint. --full-timestamp changes PDF date display only. PDF rendering needs Chrome or Chromium; use --chrome-path PATH when browser discovery is insufficient.
đĄ Serve
In a nutshell
Run an ACORN bot, local stdio MCP service, or authenticated JSON-RPC or gRPC endpoint with
acorn serve.
Start a bot for a GitLab project:
acorn serve bot 12345
acorn serve bot 12345 --event-source webhook \
--public-url https://bot.example.org --register-webhook
Bot event delivery can use polling, authenticated webhooks, or a hybrid of both. Use acorn serve bot --help to review bind, port, timestamp, polling, and webhook options before exposing the service.
Repository automation is constrained by the workflow section of application configuration passed with --config. The policy is validated before the bot starts; unknown workflow names, formats, actions, effects, and unsafe paths are rejected.
workflow:
allow-forks: false
# destination: "12345" # Required, with allow-forks: true, for fork publication.
workflows:
repository-quality:
paths:
- "**/*.cff"
- "**/*.{json,jsonc,yaml,yml,md,zonf}"
formats: [cff, json, jsonc, markdown, yaml, zon]
actions: [validate, format, link]
outputs:
mode: source-and-artifacts
effects:
- branch
- commit
- commit-status
- completion-comment
- draft-merge-request
- label
- note
acorn serve bot 12345 --event-source webhook \
--config /etc/acorn/.acorn.json
Paths are repository-relative globs. Repository content cannot add workflows or widen this policy. Fork writes are denied by default and require both allow-forks: true and an explicit destination; publication then targets only that configured project. Detached bot containers mount this file read-only.
Start the local MCP server with acorn serve mcp. Protocol frames use stdin/stdout and diagnostics use stderr. The default catalog is read-only; global --offline removes open-world tools. --allow-mutation enables persistent tools and requires a local database selected by the global database options:
acorn serve mcp
acorn --offline serve mcp
acorn --database-path ./acorn.db serve mcp --allow-mutation
Start the JSON-RPC 2.0 HTTP endpoint with a dedicated bearer token. The endpoint accepts POST /rpc, requires application/json, limits request bodies, and is read-only unless mutation is explicitly enabled:
export ACORN_SERVICE_TOKEN='replace-with-a-secret'
acorn serve rpc --bind 127.0.0.1:8001
curl --fail-with-body http://127.0.0.1:8001/rpc \
--header 'Authorization: Bearer replace-with-a-secret' \
--header 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":1,"method":"acorn.version"}'
Use global --offline to deny open-world operations. Durable status and replay remain in the catalog; a composition without persistence returns a typed unavailable error.
The Protobuf/gRPC transport exposes the three canonical application operations through the typed, unversioned acorn.service.AcornService. Build the CLI normally and use the same dedicated service token:
cargo build --release --package acorn-cli
export ACORN_SERVICE_TOKEN='replace-with-a-secret'
./target/release/acorn serve grpc --bind 127.0.0.1:50051
Call the typed readability operation with grpcurl and the committed Protobuf contract:
grpcurl -plaintext \
-H 'authorization: Bearer replace-with-a-secret' \
-import-path crates/acorn-server/proto \
-proto acorn/service/service.proto \
-d '{"text":"A complete sentence for analysis.","metric":"READABILITY_METRIC_ARI"}' \
127.0.0.1:50051 \
acorn.service.AcornService/CheckReadability
Loopback development may use plaintext HTTP/2. A non-loopback bind requires a PEM certificate chain and private key:
export ACORN_SERVICE_TOKEN='replace-with-a-secret'
./target/release/acorn serve grpc \
--bind 0.0.0.0:50051 \
--tls-cert /etc/acorn/tls/server.pem \
--tls-key /etc/acorn/tls/server.key
Clients send authorization: Bearer ⊠metadata. Non-loopback clients require TLS; message limits and deadlines apply on both sides. Application errors map to gRPC status codes. The committed contract is at crates/acorn-server/proto/acorn/service/service.proto; generated Rust remains in Cargoâs build output. acorn.version intentionally has no gRPC method. See Protobuf and gRPC.
Next stop:Â Diagnose the service host with Doctor.
đ§© Skill
In a nutshell
Extract ACORN's bundled agent instructions with
acorn skill.
acorn skill
The command writes the bundled SKILL.md into ACORNâs platform cache directory, prints its path, and attempts to copy agent instructions to the clipboard. A clipboard warning does not remove the extracted file; use the printed path when clipboard access is unavailable, such as in a headless session.
What the skill enables
The extracted skill gives compatible AI agents a current, task-oriented guide to ACORNâs schemas, commands, dry-run conventions, artifact checks, and offline behavior. It directs agents to verify syntax against the installed CLI or generated command help instead of inventing fields and flags.
acorn skill does not launch an agent, invoke a model, or grant access to files and services. It produces instructions that a user can load into a compatible agent under that agentâs existing permissions.
Next stop:Â Explore library integration on the Developer trail.
SWHID
In a nutshell
Calculate or verify Software Hash Identifiers for local content with
acorn swhid <PATH>.
Calculate or verify Software Hash Identifiers for local files, directories, and Git objects.
acorn swhid README.md --raw
acorn swhid ./src --kind directory
acorn swhid . --kind revision --reference HEAD
acorn swhid . --kind git-tree --reference HEAD
acorn swhid . --kind release --reference v1.0.0
acorn swhid . --kind snapshot
The default auto kind hashes a file as cnt or traverses a directory as dir. Git kinds use only objects already present in the repository: git-blob, git-tree, revision, release, and snapshot. Releases require annotated tags.
Use --verify to compare the calculated core object with an expected core or qualified SWHID:
acorn swhid README.md --verify swh:1:cnt:ce013625030ba8dba906f756967f9e9ca394464a
Directory identifiers use filesystem permissions and do not follow symlinks. On Unix the executable bit (0o100755 vs 0o100644) participates in the manifest, so toggling it changes the SWHID. Symlinks are stored as 0o120000 entries with their target bytes â the target is not followed and dangling links remain hashable. Special files (FIFOs, sockets, device nodes) are platform-dependent; on platforms where the underlying swhid traversal rejects them, acorn swhid surfaces failed to traverse.
Git calculations require SHA-1 object format; SHA-256 repositories (extensions.objectFormat = sha256) are rejected with an actionable diagnostic (re-initialize without --object-format=sha256). Lightweight tags are rejected for release â create annotated tags with git tag -a <name> -m "message". Missing, dangling, or ambiguous references surface the underlying revparse diagnostic without mutating the repository or working tree.
Calculation is read-only. It does not clone, fetch, materialize Git LFS, recurse into submodules, or hydrate partial clones. A filesystem directory represents current working-tree content; a Git tree represents committed state.
đ Sync
In a nutshell
Route downloaded GGUF models into supported applications with
acorn sync --dry-run.
acorn sync resolves model entries to GGUF files in the local models directory. With no target flags, it includes every application whose command is available: llama-swap, opencode, code, and goose. App-specific flags form an inclusion set, so --opencode --vscode includes both OpenCode and VS Code. Every included target must have its command available unless it was explicitly included alongside --force; --force without app-specific flags does not bypass command detection. Use --assume-models separately to skip model filesystem verification.
Pass --mcp to configure the absolute running ACORN executable as a local stdio server in OpenCode, VS Code, or Goose. MCP-only synchronization needs neither models nor a database. It preserves unrelated configuration, supports --dry-run, and removes only the acorn MCP entry with --prune. --mcp --llama-swap is rejected because llama-swap is a model router.
acorn --no-local-database sync --mcp --opencode --force
acorn --no-local-database sync --mcp --vscode --force --dry-run
acorn --no-local-database sync --mcp --goose --force --prune
Unless overridden, llama-swap configuration is written to ~/.config/llama-swap/config.yaml. OpenCode uses an existing project or user opencode.jsonc/opencode.json configuration when available and otherwise writes ~/.config/opencode/opencode.jsonc. VS Code writes Code/User/chatLanguageModels.json beneath the platform configuration directory. Goose writes ~/.config/goose/config.yaml on macOS/Linux or %APPDATA%\Block\goose\config\config.yaml on Windows. Override those paths with --vscode-config and --goose-config.
MCP synchronization writes OpenCodeâs mcp.acorn entry in the same JSONC document, workspace .vscode/mcp.json for VS Code (override with --vscode-mcp-config), and extensions.acorn in Goose YAML.
VS Code receives a customendpoint provider using the Chat Completions API. Goose receives an active openai provider and the OPENAI_HOST and OPENAI_BASE_PATH settings; because Goose selects one active model, config.goose.defaultModel chooses it and otherwise the first synchronized model is used. Existing unrelated providers and settings are preserved. See the VS Code custom endpoint reference and Goose configuration guide.
config:
vscode:
path: ./chatLanguageModels.json
url: http://localhost:8080/v1/chat/completions
providerName: Local (llama-swap)
maxInputTokens: 28672
maxOutputTokens: 4096
goose:
path: ./goose.yaml
host: http://localhost:8080
basePath: v1/chat/completions
defaultModel: acme/model
Generated llama-swap configuration follows the gold base configuration: health-check, proxy, and macro defaults are added when absent, and model commands enable its offline/tool-use launch profile. Existing root settings and per-model proxy values are preserved. Explicit extraArgs replace matching launch-profile options. Generated filesystem paths use the platformâs native form.
Model lists
Use --model-file to load model IDs from a local path, file:// URI, or HTTP(S) URL. Plain-text lists and JSON/YAML lists of IDs or model details are accepted:
acorn sync --model-file ./models.txt
acorn sync --model-file file:///path/to/models.yaml
acorn sync --model-file https://example.org/models.json
Entries from --model-file are combined with models from --config. Remote model-list documents cannot be loaded with global --offline mode.
Synchronization only includes models whose downloaded GGUF files can be resolved in --models-dir or the configured models directory by default. Unresolved entries are reported and skipped.
Use --assume-models to skip filesystem verification and assume each model is located at <models-dir>/<model-id>. For example, acme/model resolves to <models-dir>/acme/model:
acorn sync --model-file ./models.txt --assume-models
Preview changes
Use --dry-run to print configuration diffs without writing files:
acorn sync --model-file ./models.txt --dry-run
Use --prune to remove stale ACORN-managed models from the selected target configurations.
Next stop:Â See how every model stage connects in Model workflows.
đ„ïž TUI
In a nutshell
Open ACORN's interactive terminal workspace with
acorn tui.
acorn tui
# Equivalent global shortcut
acorn --interactive
The TUI uses the configured local database and respects global database and offline options:
acorn --database-path ./acorn.db --offline tui
Type / on the dashboard to see available commands. /check, /doctor, /gather (also /harvest), and /theme open their screens. /exit leaves the TUI; /quit remains an alias. The dashboard filters this list as you type.
Use command mode instead when scripting or when the installed build does not include TUI support.
Next stop:Â Browse every automation path in the command reference.
Model workflows
ACORN separates model metadata, model files, and inference configuration into three operations. Choose the command based on the state you want to change:
| Command | Changes | Use it when |
|---|---|---|
acorn import model | Resolves and stores Hugging Face GGUF metadata | You want to inspect repositories, discover GGUF fallbacks, or populate ACORNâs model catalog without downloading weights |
acorn download model | Resolves metadata and downloads selected GGUF files | You need model weights on the local machine |
acorn sync | Updates OpenCode, VS Code, Goose, and llama-swap configuration | Model files already exist and you want to reconcile agent or inference configuration |
Import and download accept positional model entries. All three commands can use configured entries and accept --model-file for a local path, file:// URI, or HTTP(S) document containing model IDs or model details.
Import metadata without downloading
Use import model to learn what GGUF files and quantizations are available, record that metadata in ACORNâs database, or find a GGUF fallback for a repository that does not provide one directly:
acorn import model openai/gpt-oss-20b
acorn import model --model-file ./models.json
Import does not transfer model weights. This makes it useful for catalog maintenance and for checking model availability before deciding what to download.
Add --dry-run to resolve and report metadata without writing to the local database. This does not require --sync.
Download model files
Use download model when the desired result is a local GGUF file. Download can constrain selection by quantization, GPU memory, filters, or whitelists:
acorn download model openai/gpt-oss-20b --quantization Q4_K_M
acorn download model --model-file ./models.json --gpu-memory 24GB
The command resolves metadata as part of the download, so a separate import is optional. Import first when you want to inspect or persist metadata independently.
Synchronize inference configuration
Use sync when model files are already present and OpenCode, VS Code, Goose, or llama-swap configuration needs to reflect ACORNâs model list:
acorn sync
acorn sync --model-file ./models.json --opencode
acorn sync --model-file ./models.json --llama-swap
acorn sync --model-file ./models.json --vscode
acorn sync --model-file ./models.json --goose
Standalone sync performs full reconciliation and supports target-path and models-directory overrides. Add --prune when stale ACORN-managed entries should be removed. Use --dry-run to preview configuration diffs without writing files:
acorn sync --dry-run
acorn sync --prune --dry-run
By default, synchronization includes only models whose local GGUF files can be resolved. --force skips that check and assumes each model exists at <models-dir>/<model-id>. This is useful when preparing configuration before files are mounted or copied, but the generated paths are not verified.
Download or import and sync in one step
Both model commands offer inline synchronization for the models resolved by that invocation. Inline sync also adds their identifiers to the ACORN configurationâs models list, preserving existing entries and omitting duplicate identifiers:
# Download weights, then add the downloaded models to supported configurations
acorn download model openai/gpt-oss-20b --sync
# Import metadata, then configure a model that will exist at the assumed path
acorn import model openai/gpt-oss-20b --sync --force
# Preview the configuration update without downloading or writing configuration
acorn download model openai/gpt-oss-20b --sync --dry-run --force
Inline --sync is additive and limited to the current import or download. --dry-run previews both the ACORN configuration update and inference-configuration updates without writing files. Use standalone acorn sync for repeated reconciliation of the complete configured model list, custom target paths, or pruning.
Which command should I use?
- To inspect or catalog model metadata without downloading weights, use
import model. - To place GGUF weights on this machine, use
download model. - To update inference configuration for models that are already present, use
sync. - To download and configure selected models in one invocation, use
download model --sync. - To prepare configuration before model paths exist, add
--force, preferably with--dry-runfirst.
See Import, Download, and Sync for all command-specific options.
Human acceptance test plan
This handbook tests ACORN as a person would use it. It is written for a tester who is comfortable copying commands into PowerShell but does not need to know Rust, JSON schemas, databases, containers, or metadata standards.
The companion Gherkin behavior specification is stored at tests/acceptance/features/acorn_cli.feature. Scenario tags and IDs match this handbook. The feature file has no Cucumber step definitions; use this pageâs copy-paste commands. The intake section also supplies a runnable Python rehearsal for INTAKE-01â09, with separate visual, interactive, and live-service checks.
| Gherkin tag | Meaning |
|---|---|
@baseline | Run during ordinary acceptance testing |
@network | Requires internet access and a third-party service |
@interactive or @manual | Requires a person to observe or stop the command |
@owner | Requires adult/repository-owner supervision and authorization |
@gap | Confirms a currently incomplete interface fails clearly |
@optional | Depends on a build feature or installed program |
@demo | Required before accepting the intake demonstration for a release |
The baseline tests work on disposable copies under target/qa-acceptance/. Optional tests are clearly labeled when they require the internet, Chrome, Git, a container runtime, credentials, or an account-changing action.
What ACORN is for
ACORN manages research activity data (RAD) and the artifacts and workflows around it.
| Capability | Likely use case | Commands |
|---|---|---|
| Validate content | Find malformed metadata, broken links, difficult prose, and incomplete research records | check |
| Normalize content | Fix common values, formatting, contact data, vocabularies, and missing media references | format |
| Add linked data | Produce JSON-LD with standards-based semantic context | link |
| Publish artifacts | Create PDF, PowerPoint, Markdown, YAML, JSON, CFF, and BagIt output | export |
| Convert standards | Crosswalk DataCite, DCAT, Dublin Core, InvenioRDM, and HuWise metadata | export --from ... --to ... |
| Discover identifiers | Find DOI, ORCID, ROR, arXiv, ISBN, RAiD, Handle, and other identifiers in text and documents | gather |
| Resolve and catalog research | Look up identifier metadata and retain discovery/candidate history | gather --resolve |
| Move research content | Download remote buckets or import local/remote content and BagIt archives | download, import |
| Review form submissions | Stage collected JSONL, inspect changes, apply corrections, and graduate metadata | intake |
| Assemble sponsor highlights | Generate a combined local PDF from reviewed project logbooks | report --combine |
| Manage local models | Inspect GGUF metadata, download model weights, and configure inference applications | import model, download model, sync |
| Describe APIs | Turn an OpenAPI document into an ACORN endpoint resource | import spec |
| Identify software | Calculate and verify Software Hash Identifiers for files, directories, and Git objects | swhid |
| Diagnose a machine | Report system, memory, network, GPU, and software readiness | doctor |
| Support agents | Extract ACORNâs embedded agent skill | skill |
| Run interactive/services | Open the TUI or run/create GitLab bots and runners | tui, serve, create |
The CLI also supports JSON, JSONC, YAML, Markdown RAD, CFF, DataCite, DCAT, Dublin Core native JSON, JSON-LD, RDF/XML, Turtle, InvenioRDM, HuWise, RAiD, plain text, PDF, and Word document inputs where appropriate. Global controls cover offline operation, local SQLite or DuckDB storage, watch mode, concurrency, cache lifetime, verbosity, and quiet output.
Rules for the tester
- Open one PowerShell window at the repository root. Keep using that same window so the setup variables remain available.
- Run the setup once. Each later code block is one test step.
- A green
[PASS]is a pass. A red error, thrown[FAIL], missing artifact, crash, hang, or result that contradicts the stated expectation is a fail. - Warnings about writing quality are valid test results unless the step says there should be no warnings.
- Do not run an owner-supervised test without the repository ownerâs help. Those tests can change accounts, create containers, download large files, or expose a service.
- Record the ACORN version, Windows version, test ID, result, and the complete terminal output for every failure.
Suggested result record:
Test ID:
Result: PASS / FAIL / SKIP
ACORN version:
Computer/OS:
What happened:
Expected:
Screenshot or pasted output:
0. Setup
SETUP-01 â Build the exact checked-out source
Skip this step only when testing an installed release. A successful build ends with Finished.
cargo build --package acorn-cli --bin acorn
if ($LASTEXITCODE -ne 0) { throw "[FAIL] ACORN did not build" }
Write-Host "[PASS] ACORN built successfully" -ForegroundColor Green
SETUP-02 â Create a disposable test workspace
This copies fixtures rather than editing the originals. It also creates environment variables used below and isolates normal output beneath target/qa-acceptance.
For a source build:
. .\scripts\qa\Setup-AcornAcceptance.ps1 -AcornPath .\target\debug\acorn.exe
For an installed release, use this instead:
. .\scripts\qa\Setup-AcornAcceptance.ps1 -AcornPath (Get-Command acorn).Source
Expected: the script prints paths for the binary, inputs, outputs, database, and optional browser. Do not close this PowerShell window.
1. Installation and command discovery
CLI-01 â Verify the executable reports a version
$text = & $env:ACORN_BIN --version 2>&1
$code = $LASTEXITCODE
$text
Confirm-ExitCode -Actual $code -Expected 0 -Test "Version command"
if ($text -notmatch '^acorn-cli \d+\.\d+\.\d+') { throw "[FAIL] Version is not in the expected form" }
Expected: output similar to acorn-cli 0.1.76.
CLI-02 â Verify all supported top-level commands are advertised
$help = & $env:ACORN_BIN --help 2>&1 | Out-String
$code = $LASTEXITCODE
$required = 'check','create','doctor','download','export','format','gather','import','intake','link','report','swhid','skill','serve','sync','tui'
$missing = $required | Where-Object { $help -notmatch "(?m)^ $_\s" }
$help
Confirm-ExitCode -Actual $code -Expected 0 -Test "Top-level help"
if ($missing) { throw "[FAIL] Missing commands: $($missing -join ', ')" }
Write-Host "[PASS] All command families are advertised" -ForegroundColor Green
CLI-03 â Verify every command can explain itself
$commands = @(
@('check'), @('create'), @('create','runner'), @('create','bot'),
@('doctor'), @('download'), @('download','model'), @('export'),
@('format'), @('gather'), @('import'), @('import','model'),
@('import','spec'), @('intake'), @('intake','stage'), @('intake','inspect'),
@('intake','apply'), @('intake','run'), @('link'), @('report'), @('swhid'), @('skill'),
@('serve'), @('serve','bot'), @('sync'), @('tui')
)
foreach ($command in $commands) {
& $env:ACORN_BIN @command --help *> $null
if ($LASTEXITCODE -ne 0) { throw "[FAIL] Help failed for: acorn $($command -join ' ')" }
}
Write-Host "[PASS] Every supported command returned help" -ForegroundColor Green
CLI-04 â Verify aliases work
& $env:ACORN_BIN --offline --no-local-database lint "$env:ACORN_QA_INPUT\valid-rad\index.json" --disable-website-checks --skip prose *> $null
$lintCode = $LASTEXITCODE
& $env:ACORN_BIN --no-local-database fmt "$env:ACORN_QA_INPUT\format-rad\index.json" --dry-run --no-color *> $null
$formatCode = $LASTEXITCODE
& $env:ACORN_BIN --offline --no-local-database harvest --text "doi:10.1038/nature12373" --raw *> $null
$gatherCode = $LASTEXITCODE
if (@($lintCode, $formatCode, $gatherCode) | Where-Object { $_ -ne 0 }) { throw "[FAIL] One or more aliases failed" }
Write-Host "[PASS] lint, fmt, and harvest aliases work" -ForegroundColor Green
2. Check research data and documents
These tests use --skip prose so the baseline does not need to download or synchronize the external prose analyzer. Website checks are disabled unless a test explicitly exercises the internet.
CHECK-01 â Check a valid RAD JSON file
& $env:ACORN_BIN --offline --no-local-database check "$env:ACORN_QA_INPUT\valid-rad\index.json" --disable-website-checks --skip prose --all
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Valid RAD JSON check"
Expected: a results table appears and the schema count is zero. A readability warning is acceptable.
CHECK-02 â Detect several errors in malformed RAD
$report = "$env:ACORN_QA_OUTPUT\malformed-check.txt"
& $env:ACORN_BIN --offline --no-local-database check "$env:ACORN_QA_INPUT\malformed-rad.json" --disable-website-checks --skip prose --no-fail *>&1 | Tee-Object -FilePath $report
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "Malformed RAD is reported with --no-fail"
Confirm-Text -Path $report -Pattern "Deserialization error" -Test "Malformed fields were detected"
Expected: ACORN reports more than one deserialization or schema problem rather than stopping after the first one.
CHECK-03 â Check supported RAD encodings and metadata standards
$cases = @(
@('valid-rad\index.jsonc','rads'),
@('rad.yaml','rads'),
@('rad.md','rads'),
@('CITATION.cff','cff'),
@('raid.json','raid'),
@('datacite.json','datacite'),
@('dcat.json','dcat'),
@('invenio-single.json','invenio'),
@('huwise.json','huwise')
)
foreach ($case in $cases) {
$path = if ($case[0] -match '^(datacite|dcat|invenio|huwise)') { "$env:ACORN_QA_INPUT\schema\$($case[0])" } else { "$env:ACORN_QA_INPUT\$($case[0])" }
& $env:ACORN_BIN --offline --no-local-database check $path --standard $case[1] --disable-website-checks --skip prose --no-fail *> $null
if ($LASTEXITCODE -ne 0) { throw "[FAIL] $($case[1]) check failed" }
}
Write-Host "[PASS] JSONC, YAML, Markdown, CFF, RAiD, DataCite, DCAT, InvenioRDM, and HuWise inputs were accepted" -ForegroundColor Green
CHECK-03B â Check Dublin Core RDF syntaxes
$ttl = "$env:ACORN_QA_OUTPUT\dublin-core.ttl"
$jsonld = "$env:ACORN_QA_OUTPUT\dublin-core.jsonld"
$rdf = "$env:ACORN_QA_OUTPUT\dublin-core.rdf"
'@prefix dcterms: <http://purl.org/dc/terms/> . <https://example.org/acceptance> dcterms:title "Acceptance dataset"@en .' | Set-Content -LiteralPath $ttl
'[{"@id":"https://example.org/acceptance","http://purl.org/dc/terms/title":[{"@language":"en","@value":"Acceptance dataset"}]}]' | Set-Content -LiteralPath $jsonld
'<?xml version="1.0"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/"><rdf:Description rdf:about="https://example.org/acceptance"><dcterms:title xml:lang="en">Acceptance dataset</dcterms:title></rdf:Description></rdf:RDF>' | Set-Content -LiteralPath $rdf
foreach ($path in $ttl, $jsonld, $rdf) {
& $env:ACORN_BIN --offline --no-local-database check $path --standard dcmi --disable-website-checks --skip prose --no-fail *> $null
if ($LASTEXITCODE -ne 0) { throw "[FAIL] Dublin Core check failed for $path" }
}
Write-Host "[PASS] Turtle, JSON-LD, and RDF/XML Dublin Core inputs were accepted" -ForegroundColor Green
CHECK-04 â Check text from standard input
"Text supplied through standard input. It has several words and another sentence." |
& $env:ACORN_BIN --offline --no-local-database check --all --skip prose,link,crosswalk,schema,quality
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Standard-input text check"
Expected: the report identifies the temporary source as stdin.txt.
CHECK-05 â Check a PDF as a document
& $env:ACORN_BIN --offline --no-local-database check "$env:ACORN_QA_INPUT\gather\gather.pdf" --standard document --disable-website-checks --skip prose --no-fail
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "PDF document check"
Expected: ACORN extracts text and reports document checks. Font-encoding warnings from PDF extraction are acceptable; a crash is not.
CHECK-06 â Verify terse, skip, and alternate-readability options
foreach ($metric in 'fkgl','ari','cli') {
& $env:ACORN_BIN --offline --no-local-database check "$env:ACORN_QA_INPUT\valid-rad\index.json" --disable-website-checks --skip prose,link --readability-test $metric --terse *> $null
if ($LASTEXITCODE -ne 0) { throw "[FAIL] Readability metric failed: $metric" }
}
Write-Host "[PASS] Terse output, skipped checks, and three readability metrics work" -ForegroundColor Green
CHECK-07 â Reject a remote source in offline mode
& $env:ACORN_BIN --offline --no-local-database check "https://example.org/project.json" --skip prose
$code = $LASTEXITCODE
Confirm-NonzeroExitCode -Actual $code -Test "Offline mode rejects remote check input"
Expected: the error says the remote source cannot be used offline.
CHECK-08 â Check clipboard text and restore the clipboard
$previousClipboard = Get-Clipboard -Raw -ErrorAction SilentlyContinue
try {
Set-Clipboard -Value 'doi:10.1038/nature12373 is mentioned in this clipboard test.'
& $env:ACORN_BIN --offline --no-local-database check --paste --format text --standard text --skip prose,link,crosswalk,schema,quality
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Clipboard text check"
} finally {
Set-Clipboard -Value $previousClipboard
}
3. Format and link RAD
FORMAT-01 â Preview formatting without changing the file
$file = "$env:ACORN_QA_INPUT\format-rad\index.json"
$before = (Get-FileHash -LiteralPath $file -Algorithm SHA256).Hash
& $env:ACORN_BIN --no-local-database format $file --dry-run --no-color
$code = $LASTEXITCODE
$after = (Get-FileHash -LiteralPath $file -Algorithm SHA256).Hash
Confirm-ExitCode -Actual $code -Expected 0 -Test "Format dry run"
if ($before -ne $after) { throw "[FAIL] Dry run changed the file" }
Write-Host "[PASS] Dry run left the source unchanged" -ForegroundColor Green
Expected: a diff shows vocabulary normalization such as rs to rust, but the checksum stays unchanged.
FORMAT-02 â Apply formatting
$file = "$env:ACORN_QA_INPUT\format-rad\index.json"
& $env:ACORN_BIN --no-local-database format $file
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "Format writes normalized RAD"
Confirm-Text -Path $file -Pattern '"rust"' -Test "Technology was normalized"
Confirm-Text -Path $file -Pattern 'Department of Energy' -Test "Sponsor was normalized"
FORMAT-03 â Verify offline policy is explicit
& $env:ACORN_BIN --offline --no-local-database format "$env:ACORN_QA_INPUT\valid-rad\index.json" --dry-run
$code = $LASTEXITCODE
Confirm-NonzeroExitCode -Actual $code -Test "Unsupported offline format mode is rejected clearly"
Expected in the current CLI: a clear message says offline mode is not implemented for format.
FORMAT-04 â Format and compare Dublin Core across syntaxes
$ttl = "$env:ACORN_QA_OUTPUT\dublin-core.ttl"
$jsonld = "$env:ACORN_QA_OUTPUT\dublin-core.jsonld"
& $env:ACORN_BIN --no-local-database format $ttl --standard dcmi --dry-run --no-color *> $null
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Dublin Core format preview"
& $env:ACORN_BIN --no-local-database diff $ttl $jsonld --standard dcmi
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Dublin Core cross-syntax semantic diff"
Expected: formatting succeeds without modifying the Turtle file, and the semantic diff is empty because both files describe the same graph.
LINK-01 â Preview linked-data output without changing files
$file = "$env:ACORN_QA_INPUT\link-rad\index.json"
$before = (Get-FileHash -LiteralPath $file -Algorithm SHA256).Hash
& $env:ACORN_BIN --no-local-database link $file --dry-run
$code = $LASTEXITCODE
$after = (Get-FileHash -LiteralPath $file -Algorithm SHA256).Hash
Confirm-ExitCode -Actual $code -Expected 0 -Test "Link dry run"
if ($before -ne $after) { throw "[FAIL] Link dry run changed the source" }
Write-Host "[PASS] Link preview left the source unchanged" -ForegroundColor Green
LINK-02 â Create JSON-LD
$file = "$env:ACORN_QA_INPUT\link-rad\index.json"
& $env:ACORN_BIN --no-local-database link $file
$code = $LASTEXITCODE
$jsonld = "$env:ACORN_QA_INPUT\link-rad\index.jsonld"
Confirm-ExitCode -Actual $code -Expected 0 -Test "JSON-LD creation"
Confirm-Path -Path $jsonld -Test "JSON-LD file exists"
Confirm-Text -Path $jsonld -Pattern 'schema.org' -Test "JSON-LD contains linked-data context"
4. Gather identifiers
GATHER-01 â Find and normalize identifiers in a text file
$report = "$env:ACORN_QA_OUTPUT\identifiers.raw.txt"
& $env:ACORN_BIN --offline --no-local-database gather "$env:ACORN_QA_INPUT\identifiers.txt" --raw | Tee-Object -FilePath $report
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "Identifier discovery"
Confirm-Text -Path $report -Pattern '10.1038/nature12373' -Test "DOI was found"
Confirm-Text -Path $report -Pattern '0000-0002-1825-0097' -Test "ORCID was found"
Confirm-Text -Path $report -Pattern '2101.00001' -Test "arXiv identifier was found"
GATHER-02 â Produce JSON, YAML, and Markdown reports
foreach ($format in 'json','yaml','markdown') {
$destination = "$env:ACORN_QA_OUTPUT\gather.$format"
& $env:ACORN_BIN --offline --no-local-database gather "$env:ACORN_QA_INPUT\identifiers.txt" --format $format --output $destination
if ($LASTEXITCODE -ne 0) { throw "[FAIL] Gather $format output failed" }
if (-not (Test-Path -LiteralPath $destination)) { throw "[FAIL] Gather did not create $destination" }
}
Write-Host "[PASS] Gather wrote JSON, YAML, and Markdown reports" -ForegroundColor Green
GATHER-03 â Extract identifiers from a PDF
& $env:ACORN_BIN --offline --no-local-database gather "$env:ACORN_QA_INPUT\gather\gather.pdf" --raw > "$env:ACORN_QA_OUTPUT\pdf-identifiers.txt"
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "PDF identifier gathering"
Confirm-Text -Path "$env:ACORN_QA_OUTPUT\pdf-identifiers.txt" -Pattern '10.1145/73560.73576' -Test "A DOI was extracted from the PDF"
GATHER-04 â Respect recursive depth
$tree = "$env:ACORN_QA_INPUT\depth-test"
New-Item -ItemType Directory -Force -Path "$tree\child\grandchild" | Out-Null
'doi:10.1000/direct' | Set-Content "$tree\direct.txt"
'doi:10.1000/child' | Set-Content "$tree\child\child.txt"
'doi:10.1000/grandchild' | Set-Content "$tree\child\grandchild\grandchild.txt"
& $env:ACORN_BIN --offline --no-local-database gather $tree --max-depth 1 --raw > "$env:ACORN_QA_OUTPUT\depth-one.txt"
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "Gather depth limit"
Confirm-Text -Path "$env:ACORN_QA_OUTPUT\depth-one.txt" -Pattern '10.1000/direct' -Test "Direct child was included"
if (Select-String -LiteralPath "$env:ACORN_QA_OUTPUT\depth-one.txt" -Pattern 'grandchild' -Quiet) { throw "[FAIL] Grandchild exceeded max depth" }
Write-Host "[PASS] Deeper descendants were excluded" -ForegroundColor Green
GATHER-05 â Persist discoveries in an isolated SQLite database
& $env:ACORN_BIN --offline --database-backend sqlite --database-path "$env:ACORN_QA_DATABASE" gather --text "doi:10.1038/nature12373" --format json > "$env:ACORN_QA_OUTPUT\database-gather.json"
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "SQLite-backed gather"
Confirm-Path -Path $env:ACORN_QA_DATABASE -Test "SQLite database was created"
5. Export and publish
EXPORT-01 â Export RAD to YAML in a chosen output directory
$destination = "$env:ACORN_QA_OUTPUT\yaml"
New-Item -ItemType Directory -Force -Path $destination | Out-Null
& $env:ACORN_BIN --offline --no-local-database export "$env:ACORN_QA_INPUT\valid-rad\index.json" --format yaml --output $destination
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "YAML export command"
Confirm-Path -Path "$destination\index.yaml" -Test "YAML was written to the requested directory"
Expected: output/yaml/index.yaml exists. If ACORN writes beside the source instead, record a failure because --output was not honored.
EXPORT-02 â Export RAD to Markdown
$destination = "$env:ACORN_QA_OUTPUT\markdown"
New-Item -ItemType Directory -Force -Path $destination | Out-Null
& $env:ACORN_BIN --offline --no-local-database export "$env:ACORN_QA_INPUT\valid-rad\index.json" --format markdown --output $destination
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "Markdown export command"
Confirm-Path -Path "$destination\index.md" -Test "Markdown was written to the requested directory"
Confirm-Text -Path "$destination\index.md" -Pattern 'Valid Project' -Test "Markdown contains the project title"
EXPORT-03 â Create and validate CITATION.cff
$source = "$env:ACORN_QA_INPUT\valid-rad\index.json"
& $env:ACORN_BIN --offline --no-local-database export $source --format cff
$exportCode = $LASTEXITCODE
$cff = "$env:ACORN_QA_INPUT\valid-rad\CITATION.cff"
Confirm-ExitCode -Actual $exportCode -Expected 0 -Test "CFF export"
Confirm-Path -Path $cff -Test "CITATION.cff exists beside the source"
& $env:ACORN_BIN --offline --no-local-database check $cff --disable-website-checks --skip prose --no-fail
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Generated CFF can be checked"
EXPORT-04 â Export JSON Schemas for supported standards
$standards = 'acre','rads','cff','datacite','dcat','dcmi','invenio','huwise','raid'
foreach ($standard in $standards) {
$schema = "$env:ACORN_QA_OUTPUT\$standard.schema.json"
& $env:ACORN_BIN --offline --no-local-database export --schema --standard $standard --format json --raw > $schema
if ($LASTEXITCODE -ne 0) { throw "[FAIL] Schema export failed for $standard" }
if ((Get-Item -LiteralPath $schema).Length -lt 100) { throw "[FAIL] Schema was unexpectedly small for $standard" }
Get-Content -LiteralPath $schema -Raw | ConvertFrom-Json | Out-Null
}
Write-Host "[PASS] Nine supported standards produced valid JSON Schemas" -ForegroundColor Green
Expected: ACRE, RAD, CFF, DataCite, DCAT, Dublin Core, InvenioRDM, HuWise, and RAiD schemas are non-empty JSON.
EXPORT-05 â Crosswalk DataCite to DCAT
$destination = "$env:ACORN_QA_OUTPUT\crosswalk"
New-Item -ItemType Directory -Force -Path $destination | Out-Null
& $env:ACORN_BIN --offline --no-local-database export "$env:ACORN_QA_INPUT\schema\datacite.json" --format json --from datacite --to dcat --output $destination
$code = $LASTEXITCODE
$result = "$destination\datacite.json"
Confirm-ExitCode -Actual $code -Expected 0 -Test "DataCite-to-DCAT crosswalk"
Confirm-Path -Path $result -Test "Crosswalk output exists"
Confirm-Text -Path $result -Pattern 'Example Dataset Title' -Test "Crosswalk retained the title"
EXPORT-05A â Crosswalk DataCite to Dublin Core Turtle
$destination = "$env:ACORN_QA_OUTPUT\crosswalk-dublin-core"
New-Item -ItemType Directory -Force -Path $destination | Out-Null
& $env:ACORN_BIN --offline --no-local-database export "$env:ACORN_QA_INPUT\schema\datacite.json" --format turtle --from datacite --to dcmi --output $destination
$code = $LASTEXITCODE
$result = "$destination\datacite.ttl"
Confirm-ExitCode -Actual $code -Expected 0 -Test "DataCite-to-Dublin-Core crosswalk"
Confirm-Path -Path $result -Test "Dublin Core Turtle exists"
Confirm-Text -Path $result -Pattern 'purl.org/dc/terms' -Test "Turtle uses DCMI terms"
& $env:ACORN_BIN --offline --no-local-database check $result --standard dcmi --disable-website-checks --skip prose --no-fail *> $null
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Crosswalked Dublin Core can be checked"
EXPORT-05B â Exercise every supported crosswalk pairing
$sources = @{
datacite = 'datacite.json'
dcat = 'dcat.json'
invenio = 'invenio-single.json'
huwise = 'huwise.json'
}
$failures = @()
foreach ($from in $sources.Keys) {
foreach ($to in $sources.Keys | Where-Object { $_ -ne $from }) {
$destination = "$env:ACORN_QA_OUTPUT\crosswalk-$from-to-$to"
New-Item -ItemType Directory -Force -Path $destination | Out-Null
& $env:ACORN_BIN --offline --no-local-database export "$env:ACORN_QA_INPUT\schema\$($sources[$from])" --format json --from $from --to $to --output $destination *> $null
if ($LASTEXITCODE -ne 0) { $failures += "$from -> $to" }
}
}
if ($failures) { throw "[FAIL] Crosswalk pairings failed: $($failures -join ', ')" }
Write-Host "[PASS] All 12 crosswalk pairings completed" -ForegroundColor Green
EXPORT-05C â Import Dublin Core into RAD with explicit local context
$source = "$env:ACORN_QA_OUTPUT\crosswalk-dublin-core\datacite.ttl"
$contact = "$env:ACORN_QA_OUTPUT\dublin-core-contact.json"
$destination = "$env:ACORN_QA_OUTPUT\dublin-core-rad"
(Get-Content "$env:ACORN_QA_INPUT\valid-rad\index.json" -Raw | ConvertFrom-Json).contact |
ConvertTo-Json -Depth 20 | Set-Content -LiteralPath $contact
New-Item -ItemType Directory -Force -Path $destination | Out-Null
& $env:ACORN_BIN --offline --no-local-database export $source --format json --from dcmi --to rads --crosswalk-contact $contact --local-identifier dcmi-acceptance --output $destination
$code = $LASTEXITCODE
$result = "$destination\datacite.json"
Confirm-ExitCode -Actual $code -Expected 0 -Test "Dublin Core-to-RAD import"
Confirm-Path -Path $result -Test "Imported RAD exists"
Confirm-Text -Path $result -Pattern 'dcmi-acceptance' -Test "Caller-supplied local identifier was retained"
Expected: the import succeeds only because the tester supplied both a local contact and identifier. Running the same command without either required option must fail before writing output.
EXPORT-06 â Create a PDF fact sheet
Skip if setup printed Browser: not detected.
if (-not $env:ACORN_QA_CHROME) {
Write-Host "[SKIP] PDF export: Chrome or Edge was not detected" -ForegroundColor Yellow
} else {
$destination = "$env:ACORN_QA_OUTPUT\pdf"
& $env:ACORN_BIN --offline --no-local-database export "$env:ACORN_QA_INPUT\highlight\index.json" --format pdf --chrome-path $env:ACORN_QA_CHROME --output $destination
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "PDF export"
$pdf = Get-ChildItem -LiteralPath $destination -Filter *.pdf | Select-Object -First 1
if (-not $pdf -or $pdf.Length -lt 10000) { throw "[FAIL] PDF is missing or unexpectedly small" }
Write-Host "[PASS] PDF exists and is non-empty: $($pdf.FullName)" -ForegroundColor Green
}
Manual visual check: open the PDF and confirm text is readable, images are not stretched, no content is cut off, and any ASPECT chart has legible labels.
EXPORT-07 â Create a PowerPoint from a reference template
$destination = "$env:ACORN_QA_OUTPUT\powerpoint"
& $env:ACORN_BIN --offline --no-local-database export "$env:ACORN_QA_INPUT\highlight\index.json" --format powerpoint --reference "$env:ACORN_QA_INPUT\highlight\reference.pptx" --show-aspect-labels --show-aspect-scores --output $destination
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "PowerPoint export"
$pptx = Get-ChildItem -LiteralPath $destination -Filter *.pptx | Select-Object -First 1
if (-not $pptx -or $pptx.Length -lt 10000) { throw "[FAIL] PowerPoint is missing or unexpectedly small" }
Write-Host "[PASS] PowerPoint exists and is non-empty: $($pptx.FullName)" -ForegroundColor Green
Manual visual check: open the presentation and confirm placeholders were replaced, the image appears, speaker notes are sensible, and PowerPoint does not request a repair.
EXPORT-08 â Create verified BagIt archives
$archives = @(
@('zip','deposit.zip'),
@('7z','deposit.7z'),
@('tar','deposit.tar'),
@('tar.gz','deposit.tar.gz')
)
$failures = @()
foreach ($archiveCase in $archives) {
$archive = "$env:ACORN_QA_OUTPUT\$($archiveCase[1])"
& $env:ACORN_BIN --offline --no-local-database export "$env:ACORN_QA_INPUT\bag-source" --format bag --archive-format $archiveCase[0] --output $archive *> $null
if ($LASTEXITCODE -ne 0 -or -not (Test-Path -LiteralPath $archive)) { $failures += $archiveCase[0] }
}
if ($failures) { throw "[FAIL] BagIt archive formats failed: $($failures -join ', ')" }
Write-Host "[PASS] ZIP, 7z, TAR, and TAR.GZ BagIt exports passed verification" -ForegroundColor Green
Expected: the archive is created and ACORNâs built-in post-export verification passes. A ZIP file left behind after an error is still a failure.
EXPORT-09 â Preview export without writing
$destination = "$env:ACORN_QA_OUTPUT\dry-export"
& $env:ACORN_BIN --offline --no-local-database export "$env:ACORN_QA_INPUT\valid-rad\index.json" --format pdf --output $destination --dry-run
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "Export dry run"
if (Test-Path -LiteralPath $destination) { throw "[FAIL] Export dry run created output" }
Write-Host "[PASS] Export dry run wrote no artifact" -ForegroundColor Green
EXPORT-10 â Combine multiple RAD records into one JSON artifact
$source = "$env:ACORN_QA_INPUT\combine"
$destination = "$env:ACORN_QA_OUTPUT\combined"
New-Item -ItemType Directory -Force -Path $source, $destination | Out-Null
Copy-Item "$env:ACORN_QA_INPUT\valid-rad\index.json" "$source\one.json"
Copy-Item "$env:ACORN_QA_INPUT\highlight\index.json" "$source\two.json"
& $env:ACORN_BIN --offline --no-local-database export $source --format json --combine --output $destination
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "Combined JSON export"
$combined = Get-ChildItem -LiteralPath $destination -Filter *.json | Select-Object -First 1
if (-not $combined) { throw "[FAIL] Combined export did not create one JSON artifact" }
$records = Get-Content -LiteralPath $combined.FullName -Raw | ConvertFrom-Json
if (@($records).Count -lt 2) { throw "[FAIL] Combined artifact has fewer than two records" }
Write-Host "[PASS] Combined artifact contains multiple records" -ForegroundColor Green
6. Import research content and API specifications
IMPORT-01 â Import a local research-content directory
$destination = "$env:ACORN_QA_OUTPUT\imported"
& $env:ACORN_BIN --offline --no-local-database import "$env:ACORN_QA_INPUT\valid-rad" --output $destination
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "Local content import"
Confirm-Path -Path "$destination\index.json" -Test "Imported RAD exists"
IMPORT-02 â Filter and flatten an import
$destination = "$env:ACORN_QA_OUTPUT\flattened"
& $env:ACORN_BIN --offline --no-local-database import "$env:ACORN_QA_INPUT\valid-rad" --filter 'index\.json$' --flatten --output $destination
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "Filtered, flattened import"
Confirm-Path -Path "$destination\index.json" -Test "Selected file was flattened"
if (Test-Path -LiteralPath "$destination\00.png") { throw "[FAIL] Filter allowed an unwanted image" }
Write-Host "[PASS] Filter excluded unrelated files" -ForegroundColor Green
IMPORT-03 â Refuse to overwrite unless --clobber is present
$destination = "$env:ACORN_QA_OUTPUT\clobber-test"
& $env:ACORN_BIN --offline --no-local-database import "$env:ACORN_QA_INPUT\valid-rad" --output $destination *> $null
if ($LASTEXITCODE -ne 0) { throw "[FAIL] Initial import failed" }
& $env:ACORN_BIN --offline --no-local-database import "$env:ACORN_QA_INPUT\valid-rad" --output $destination *> $null
$withoutClobber = $LASTEXITCODE
Confirm-NonzeroExitCode -Actual $withoutClobber -Test "Import protects existing content"
& $env:ACORN_BIN --offline --no-local-database import "$env:ACORN_QA_INPUT\valid-rad" --output $destination --clobber *> $null
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Import clobber replaces selected content"
IMPORT-04 â Generate an endpoint resource from OpenAPI
$preview = "$env:ACORN_QA_OUTPUT\endpoint-preview.json"
& $env:ACORN_BIN --offline --no-local-database import spec "$env:ACORN_QA_INPUT\openapi.yaml" --name qa::api --domain api.example.org --dry-run > $preview
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "OpenAPI dry-run import"
Confirm-Text -Path $preview -Pattern 'list-projects' -Test "Endpoint operation was imported"
$written = "$env:ACORN_QA_OUTPUT\endpoint.json"
& $env:ACORN_BIN --offline --no-local-database import spec "$env:ACORN_QA_INPUT\openapi.yaml" --name qa::api --domain api.example.org --output $written
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "OpenAPI file import"
Confirm-Path -Path $written -Test "Endpoint JSON was written"
IMPORT-05 â Re-import the BagIt archive
Run this only after EXPORT-08 passes.
$archive = "$env:ACORN_QA_OUTPUT\deposit.zip"
if (-not (Test-Path -LiteralPath $archive)) {
Write-Host "[SKIP] BagIt import: EXPORT-08 did not produce an archive" -ForegroundColor Yellow
} else {
$destination = "$env:ACORN_QA_OUTPUT\bag-import"
& $env:ACORN_BIN --offline --no-local-database import $archive --output $destination
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "BagIt archive import and checksum verification"
Confirm-Path -Path "$destination\index.json" -Test "BagIt payload was imported"
}
IMPORT-06 â Read JSON, JSONC, and YAML configuration files
$configs = @(
"$env:ACORN_REPO\tests\fixtures\config\with_local_buckets.json",
"$env:ACORN_REPO\tests\fixtures\config\with_buckets.jsonc",
"$env:ACORN_QA_CONFIG\local.yaml"
)
for ($index = 0; $index -lt $configs.Count; $index++) {
$destination = "$env:ACORN_QA_OUTPUT\configured-$index"
& $env:ACORN_BIN --offline --no-local-database import --config $configs[$index] --output $destination *> $null
if ($LASTEXITCODE -ne 0) { throw "[FAIL] Configuration import failed: $($configs[$index])" }
if (-not (Test-Path -LiteralPath $destination)) { throw "[FAIL] Configuration produced no output" }
}
Write-Host "[PASS] JSON, JSONC, and YAML configurations were accepted" -ForegroundColor Green
7. Software identifiers
SWHID-01 â Hash the same file deterministically
$file = "$env:ACORN_QA_INPUT\identifiers.txt"
$first = (& $env:ACORN_BIN --no-local-database swhid $file --raw | Out-String).Trim()
$firstCode = $LASTEXITCODE
$second = (& $env:ACORN_BIN --no-local-database swhid $file --raw | Out-String).Trim()
$secondCode = $LASTEXITCODE
if ($firstCode -ne 0 -or $secondCode -ne 0) { throw "[FAIL] File SWHID calculation failed" }
if ($first -ne $second -or $first -notmatch '^swh:1:cnt:[0-9a-f]{40}$') { throw "[FAIL] File SWHID was not deterministic or valid" }
Write-Host "[PASS] Deterministic file SWHID: $first" -ForegroundColor Green
SWHID-02 â Verify a calculated identifier
$file = "$env:ACORN_QA_INPUT\identifiers.txt"
$id = (& $env:ACORN_BIN --no-local-database swhid $file --raw | Out-String).Trim()
& $env:ACORN_BIN --no-local-database swhid $file --verify $id
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "SWHID verification"
SWHID-03 â Hash directory and Git objects
& $env:ACORN_BIN --no-local-database swhid "$env:ACORN_QA_INPUT\valid-rad" --kind directory --raw
if ($LASTEXITCODE -ne 0) { throw "[FAIL] Directory SWHID failed" }
$repository = "$env:ACORN_QA_ROOT\swhid-git"
New-Item -ItemType Directory -Force -Path $repository | Out-Null
Copy-Item "$env:ACORN_QA_INPUT\valid-rad\index.json" "$repository\index.json"
Push-Location $repository
try {
git init --quiet
git config user.email 'acorn-qa@example.org'
git config user.name 'ACORN QA'
git add index.json
git commit --quiet -m 'Add RAD fixture'
git tag -a v1.0.0 -m 'Acceptance test release'
$gitCases = @(
@('git-blob','HEAD:index.json'),
@('git-tree','HEAD'),
@('revision','HEAD'),
@('release','v1.0.0')
)
foreach ($case in $gitCases) {
& $env:ACORN_BIN --no-local-database swhid . --kind $case[0] --reference $case[1] --raw
if ($LASTEXITCODE -ne 0) { throw "[FAIL] Git SWHID failed for $($case[0])" }
}
& $env:ACORN_BIN --no-local-database swhid . --kind snapshot --raw
if ($LASTEXITCODE -ne 0) { throw "[FAIL] Git snapshot SWHID failed" }
} finally {
Pop-Location
}
Write-Host "[PASS] Directory, blob, tree, revision, release, and snapshot SWHIDs were calculated" -ForegroundColor Green
8. Diagnostics, model configuration, and agent support
DOCTOR-01 â Run all diagnostics
& $env:ACORN_BIN --no-local-database doctor
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Doctor diagnostics"
Expected: system, memory, network, GPU, and software findings are shown. Missing optional software is a diagnostic result, not necessarily a test failure.
DOCTOR-02 â Produce a machine-readable report
$report = "$env:ACORN_QA_OUTPUT\doctor.json"
& $env:ACORN_BIN --no-local-database doctor --report > $report
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "Doctor JSON report"
Get-Content -LiteralPath $report -Raw | ConvertFrom-Json | Out-Null
Write-Host "[PASS] Doctor report is valid JSON" -ForegroundColor Green
SYNC-01 â Preview VS Code model configuration
$target = "$env:ACORN_QA_OUTPUT\chatLanguageModels.json"
& $env:ACORN_BIN --no-local-database sync --model-file "$env:ACORN_QA_INPUT\models.txt" --assume-models --vscode --force --vscode-config $target --dry-run --no-color
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "VS Code sync preview"
if (Test-Path -LiteralPath $target) { throw "[FAIL] Sync dry run wrote the target file" }
Write-Host "[PASS] Sync preview made no changes" -ForegroundColor Green
SYNC-02 â Write isolated app configurations
$models = "$env:ACORN_QA_INPUT\models.txt"
$targets = @(
@('--vscode','--vscode-config',"$env:ACORN_QA_OUTPUT\vscode.json"),
@('--opencode','--opencode-config',"$env:ACORN_QA_OUTPUT\opencode.jsonc"),
@('--llama-swap','--llama-swap-config',"$env:ACORN_QA_OUTPUT\llama-swap.yaml"),
@('--goose','--goose-config',"$env:ACORN_QA_OUTPUT\goose.yaml")
)
foreach ($target in $targets) {
& $env:ACORN_BIN --no-local-database sync --model-file $models --assume-models --force @target *> $null
if ($LASTEXITCODE -ne 0) { throw "[FAIL] Sync failed for $($target[0])" }
if (-not (Test-Path -LiteralPath $target[2])) { throw "[FAIL] Sync did not write $($target[2])" }
}
Write-Host "[PASS] Four isolated application configurations were written" -ForegroundColor Green
SKILL-01 â Extract ACORNâs agent instructions
This writes one cached skill file and may update the clipboard.
$skillOutput = & $env:ACORN_BIN --no-local-database skill 2>&1 | Out-String
$code = $LASTEXITCODE
$skillOutput
Confirm-ExitCode -Actual $code -Expected 0 -Test "Agent skill extraction"
if ($skillOutput -notmatch 'SKILL\.md') { throw "[FAIL] Skill output did not identify SKILL.md" }
9. Interactive and watch behavior
These are manual because they intentionally keep running until the tester stops them.
WATCH-01 â Re-run a check when a file changes
Run the first block, wait for the initial report, then open another PowerShell window and run the second block. Return to the first window and press q or Ctrl+C after the second report.
First window:
& $env:ACORN_BIN --offline --no-local-database --watch --watch-mode poll --poll-interval 1s check "$env:ACORN_QA_INPUT\valid-rad\index.json" --disable-website-checks --skip prose --no-fail
Second window:
(Get-Item "$env:ACORN_QA_INPUT\valid-rad\index.json").LastWriteTime = Get-Date
Expected: exactly one initial run and at least one new run after the timestamp changes; stopping returns control to the prompt.
TUI-01 â Open and exit the terminal interface
& $env:ACORN_BIN --offline --database-path "$env:ACORN_QA_DATABASE" tui
Expected: a readable interactive screen opens, navigation keys respond, and the displayed quit key exits cleanly. Resize the terminal once and confirm the interface redraws without corruption.
GIT-01 â Select files changed by a Git commit
This creates a tiny disposable Git repository; it does not touch the ACORN repositoryâs history.
$gitTest = "$env:ACORN_QA_ROOT\git-selector"
New-Item -ItemType Directory -Force -Path $gitTest | Out-Null
Copy-Item "$env:ACORN_QA_INPUT\valid-rad\index.json" "$gitTest\index.json"
Push-Location $gitTest
try {
git init --quiet
git config user.email 'acorn-qa@example.org'
git config user.name 'ACORN QA'
git add index.json
git commit --quiet -m 'Add RAD fixture'
(Get-Content index.json -Raw).Replace('Valid Project','Valid Project Updated') | Set-Content index.json
git add index.json
git commit --quiet -m 'Update RAD fixture'
& $env:ACORN_BIN --offline --no-local-database check --commit HEAD --disable-website-checks --skip prose --no-fail
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Git commit selector"
} finally {
Pop-Location
}
Expected: the report includes index.json. A release that changes source selection should repeat this pattern for format --dry-run, link --dry-run, and export --dry-run.
10. Optional connected tests
Run these only on a normal internet connection. They can be slower or depend on third-party uptime.
NET-01 â Check live links and synchronize the prose analyzer
& $env:ACORN_BIN --no-local-database check "$env:ACORN_QA_INPUT\valid-rad\index.json" --all --no-fail
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Connected prose and link checks"
Expected: ACORN runs schema, prose, readability, quality, and website checks. A deliberately invalid fixture URL may be reported as a content problem.
NET-02 â Resolve a DOI citation
& $env:ACORN_BIN --no-local-database gather --text "doi:10.1038/nature12373" --resolve --raw --citation-format apa > "$env:ACORN_QA_OUTPUT\citation.txt"
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "DOI resolution"
Confirm-Text -Path "$env:ACORN_QA_OUTPUT\citation.txt" -Pattern '2013' -Test "Resolved citation contains publication details"
NET-03 â Search DOE CODE
& $env:ACORN_BIN --no-local-database gather --osti projects "ACORN" --lab ORNL --limit 5 --format json > "$env:ACORN_QA_OUTPUT\osti.json"
$code = $LASTEXITCODE
Confirm-ExitCode -Actual $code -Expected 0 -Test "DOE CODE project search"
Get-Content -LiteralPath "$env:ACORN_QA_OUTPUT\osti.json" -Raw | ConvertFrom-Json | Out-Null
Write-Host "[PASS] DOE CODE returned valid JSON" -ForegroundColor Green
NET-04 â Preview model metadata without downloading weights
& $env:ACORN_BIN --no-local-database import model Qwen/Qwen2.5-0.5B-Instruct-GGUF --no-fallback --dry-run
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Hugging Face model metadata preview"
Expected: GGUF filenames, quantizations, revisions, and sizes are reported; no model weight is downloaded.
NET-05 â Preview model download selection
& $env:ACORN_BIN --no-local-database download model Qwen/Qwen2.5-0.5B-Instruct-GGUF --quantization Q4_K_M --local-dir "$env:ACORN_QA_OUTPUT\models" --dry-run --raw
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Model download dry run"
Expected: structured metadata describes the selected files; the models directory remains empty. Remove --dry-run only with owner approval because model files can be large.
NET-06 â Download a filtered remote bucket
& $env:ACORN_BIN --no-local-database download https://github.com/jhwohlgemuth/bucket --filter 'index\.json$' --output "$env:ACORN_QA_OUTPUT\remote-bucket"
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Filtered remote bucket download"
Expected: matching research index files are downloaded without unrelated large content. A third-party repository move or outage should be recorded as SKIP â external dependency, not an ACORN pass.
NET-07 â Preview provider enrichment
& $env:ACORN_BIN --no-local-database format "$env:ACORN_QA_INPUT\valid-rad\index.json" --enrich --provider openalex,citeas --dry-run --no-color
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Metadata enrichment preview"
Expected: existing populated values remain intact and any provider additions appear only in the preview.
NET-08 â Canonicalize and strictly ingest a remote bucket
& $env:ACORN_BIN --database-path "$env:ACORN_QA_DATABASE" download https://github.com/jhwohlgemuth/bucket --filter 'index\.json$' --canonicalize --strict --output "$env:ACORN_QA_OUTPUT\canonical-bucket"
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Canonical, strict bucket ingestion"
Expected: deprecated aliases are rewritten before strict database ingestion. If the external test repository contains no deprecated aliases, the test still verifies that the combined mode completes.
11. Owner-supervised infrastructure tests
Do not give these steps to an unsupervised tester. They need real GitLab credentials and/or a container runtime and may change external state.
INFRA-01 â Confirm create/serve argument validation without changing anything
& $env:ACORN_BIN create runner --help *> $null
$runnerHelp = $LASTEXITCODE
& $env:ACORN_BIN create bot --help *> $null
$createBotHelp = $LASTEXITCODE
& $env:ACORN_BIN serve bot --help *> $null
$serveBotHelp = $LASTEXITCODE
if (@($runnerHelp, $createBotHelp, $serveBotHelp) | Where-Object { $_ -ne 0 }) { throw "[FAIL] Infrastructure help failed" }
Write-Host "[PASS] Runner and bot interfaces are available without side effects" -ForegroundColor Green
INFRA-02 â Create a GitLab runner (owner performs substitutions)
& $env:ACORN_BIN create runner --group '<GITLAB_GROUP_ID>' --name 'acorn-qa-runner' --runtime docker --repo '<GITLAB_DOMAIN>'
Expected: a runner is registered and its container starts. The owner must remove the runner and container after the test.
INFRA-03 â Create and run a detached GitLab bot (owner performs substitutions)
& $env:ACORN_BIN create bot '<GITLAB_PROJECT_ID>' --name 'acorn-qa-bot' --runtime docker --detach --domain '<GITLAB_DOMAIN>'
Expected: the container starts, authenticates, and polls without exposing secrets. The owner must remove the test bot/container afterward.
INFRA-04 â Run the in-process bot service (owner performs substitutions)
& $env:ACORN_BIN serve bot '<GITLAB_PROJECT_ID>' --event-source poll --poll-interval 10
Expected: the service starts, handles a test note event once, and stops cleanly with Ctrl+C.
Webhook and hybrid delivery should be tested only with an approved HTTPS test URL, project, webhook token, and signing token. Never expose a development machine directly to the public internet for this test.
12. Explicitly incomplete interfaces
These tests document intentional gaps. They pass when the CLI rejects the request clearly and non-destructively.
GAP-01 â create mcp reports that it is not implemented
& $env:ACORN_BIN --no-local-database create mcp
Confirm-NonzeroExitCode -Actual $LASTEXITCODE -Test "create mcp reports an implementation gap"
MCP-01 â serve mcp starts the stdio protocol server
@'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"acceptance","version":"1"}}}'@ | & $env:ACORN_BIN --no-local-database serve mcp
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "serve mcp protocol initialization"
DOCTOR-03 â Doctor safe autofix remains bounded
& $env:ACORN_BIN --no-local-database doctor --fix
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Doctor safe autofix"
13. Global behavior and safety
GLOBAL-01 â Verify quiet and verbose modes
$quiet = & $env:ACORN_BIN --offline --no-local-database gather --text "doi:10.1038/nature12373" --quiet 2>&1 | Out-String
$quietCode = $LASTEXITCODE
$verbose = & $env:ACORN_BIN --offline --no-local-database gather --text "doi:10.1038/nature12373" -vv 2>&1 | Out-String
$verboseCode = $LASTEXITCODE
if ($quietCode -ne 0 -or $verboseCode -ne 0) { throw "[FAIL] Quiet or verbose command failed" }
if ($quiet.Length -ge $verbose.Length) { throw "[FAIL] Quiet output was not smaller than verbose output" }
Write-Host "[PASS] Quiet and verbose levels produce appropriately different output" -ForegroundColor Green
GLOBAL-02 â Verify thread-count parsing
& $env:ACORN_BIN --offline --no-local-database --threads 1 gather --text "doi:10.1038/nature12373" --raw *> $null
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Single-thread mode"
GLOBAL-03 â Reject conflicting database flags
& $env:ACORN_BIN --database-path "$env:ACORN_QA_DATABASE" --no-local-database doctor
Confirm-NonzeroExitCode -Actual $LASTEXITCODE -Test "Conflicting database options are rejected"
GLOBAL-04 â Request the optional DuckDB backend in isolation
$duckdb = "$env:ACORN_QA_ROOT\database\acceptance.duckdb"
& $env:ACORN_BIN --offline --database-backend duckdb --database-path $duckdb gather --text "doi:10.1038/nature12373" --format json > "$env:ACORN_QA_OUTPUT\duckdb-gather.json" 2> "$env:ACORN_QA_OUTPUT\duckdb-error.txt"
$code = $LASTEXITCODE
if ($code -eq 0) {
Confirm-Path -Path $duckdb -Test "DuckDB database was created"
} elseif (Select-String -LiteralPath "$env:ACORN_QA_OUTPUT\duckdb-error.txt" -Pattern "not available in this build" -Quiet) {
Write-Host "[PASS] This build clearly reports that optional DuckDB support is unavailable" -ForegroundColor Green
} else {
throw "[FAIL] DuckDB neither worked nor reported the expected feature-gate message"
}
GLOBAL-05 â Reset only the disposable SQLite database
Run after GATHER-05 and before cleanup.
$resolvedDatabase = [System.IO.Path]::GetFullPath($env:ACORN_QA_DATABASE)
$allowedDatabaseRoot = [System.IO.Path]::GetFullPath("$env:ACORN_QA_ROOT\database")
if (-not $resolvedDatabase.StartsWith($allowedDatabaseRoot, [System.StringComparison]::OrdinalIgnoreCase)) {
throw "[FAIL] Refusing to reset a database outside the QA workspace"
}
& $env:ACORN_BIN --offline --database-path $resolvedDatabase --reset-database gather --text "doi:10.1038/nature12373" --format json > "$env:ACORN_QA_OUTPUT\after-reset.json"
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test "Disposable database reset"
Do not test --clear-cache against a normal user profile: it intentionally removes ACORN cache data and downloaded Chromium artifacts. Test --reset-database only against $env:ACORN_QA_DATABASE and only when earlier database tests no longer need their data.
14. Intake demo release gate
These cases cover the current SharePoint workflow: browser download of the collected JSONL, local staging and review, confirmed application, immutable corrections, and a combined PDF. They do not require a premium connector, direct OAuth download, Vergil, Git credentials, or a live cloud write. Run them against the exact binary intended for release. Python 3.9 or later is required only for this acceptance runner; it uses the standard library.
The dated result in tests/acceptance/intake-demo-results.json identifies the tested source commit, executable and runner hashes, platform, local acceptance results, and remaining live check. It is evidence for that build; rerun the rehearsal against the final minor-release executable.
Run from the repository root after SETUP-02. The runner creates a fresh child workspace, refuses existing destinations, copies fictional project metadata, and generates synthetic receipts. Its intake config uses explicit local file URIs; its report config resolves relative project paths with options.folders.root: "file:.". It records version, executable hash, operating system, command output, and every exit status in evidence.json and numbered transcripts. A failed check exits nonzero and retains the evidence. It never edits the source fixtures. Use only the synthetic fixture for the runnerâs automatic --yes and --force approvals.
$intakeRoot = Join-Path $env:ACORN_QA_ROOT 'intake-demo'
python scripts/qa/verify-intake-demo.py --acorn $env:ACORN_BIN --workspace $intakeRoot --chrome $env:ACORN_QA_CHROME
Confirm-ExitCode -Actual $LASTEXITCODE -Expected 0 -Test 'Intake demo automated checks'
If Chrome was not detected, supply its installed executable path, or omit --chrome to use ACORNâs browser discovery. Offline mode will not download a browser. --skip-pdf runs INTAKE-01â08 but records INTAKE-09 as skipped; that is not a passed demo gate. On macOS/Linux, the same runner accepts --acorn target/debug/acorn. Use a new workspace for each rerun.
INTAKE-01 â Stage and inspect three project receipts
The runner stages three synthetic submissions from a local JSONL file and inspects the returned batch ID. Expect three accepted receipts, all three project routes and their proposed changes in the inspection, unchanged source bytes, and unchanged destination indexes. JSONL is an envelope per line, including submission UUID, submitter, project, submission time, and entry; it is not a raw list of LogbookEntry values.
INTAKE-02 â Require approval before applying
The runner first invokes apply with redirected input/output and no --yes. Expect a nonzero exit explaining the terminal requirement and no index changes. It then approves only its reviewed synthetic batch with --yes. Expect one new entry in each project and intact quotes, Unicode, supporting items, and embedded newline text. Human button behavior is checked separately in INTAKE-11.
INTAKE-03 â Replay without duplicate entries
Repeat apply with the original batch ID, then restage the exact original receipts. Expect three replayed receipts, zero newly accepted receipts, and byte-identical indexes after both apply attempts. Keep the downloaded source; applying is not an inbox drain.
INTAKE-04 â Edit an existing submission through a new receipt
Apply a correction in a later batch using the original receipt evidence retained in the workspace. Inspection must identify the original and immediate predecessor. Expect the same logical entry identifier, corrected text, and no additional entry. Restage the complete original-plus-correction history: all four receipts replay and the corrected indexes stay byte-identical. In another fresh workspace, importing the complete history in one batch must produce the same indexes. Original receipts remain unchanged in the downloaded JSONL.
INTAKE-05 â Reject invalid or ambiguous history without partial writes
The runner exercises missing ancestry, a changed owner who is otherwise an authorized member, routing to another registered project, changed report placement, competing successors, changed bytes under an existing UUID, and a malformed envelope. Each has a separate workspace. Expect a rejected batch, a nonzero apply exit, and no changes to any project, including valid rows in the same batch.
INTAKE-06 â Recheck reviewed inputs at apply time
After staging, independently change the source bytes, destination index bytes, or authorized membership. Expect each apply attempt to fail and preserve all indexes exactly as they were immediately before apply. Review and stage a new batch after resolving the cause; do not bypass the digest checks.
INTAKE-07 â Keep the standalone general destination an explicit gap
Stage a mixed batch of valid project highlights plus a report-wide receipt routed to general, with global: true, and no associated project/index. Expect the general row to be rejected, the whole batch to be non-applicable, and no index writes. Preserve every receipt for later review; never silently drop the general row or route it to a project with fabricated contact information.
Current demo boundary: project highlights and their corrections can be demonstrated now. Standalone report-wide intake/reporting remains PA-29 work. Passing this negative case documents the limitation; it does not establish general-update support. Project-backed entries with global: true are a different, already supported report feature. If the planned demonstration includes standalone general updates, this gap blocks that demonstration.
INTAKE-08 â Preview and graduate optional metadata safely
In a separate workspace, ingest a synthetic personnel entry. intake run --dry-run --force must preview one contributor without writing. Applying the reviewed promotion with --force --expected-digest must add that contributor, retain the source entry as archived, and create an exact-byte backup. Reusing the stale digest must fail without further changes. Graduation is optional and separate from producing the sponsor-highlights PDF.
INTAKE-09 â Produce and inspect the combined PDF
The runner uses the corrected three-project indexes, an explicit October 26â27 reporting window, the default report root/output, and --dry-run --combine. No commit selector, publication, callback, or remote inbox update is needed. Expect demo/.acorn/reports/report.pdf and unchanged indexes. The PDF must open successfully; its mere existence is insufficient.
Start-Process (Join-Path $intakeRoot 'demo/.acorn/reports/report.pdf')
Inspect every page. Require a readable title page, all three project sections, and the legend. The watershed section must show TEST ONLY corrected watershed highlight exactly once and must not show its original highlight. The other two original highlights must each appear once. October 3 baseline entries must be absent from this October 26 window. Check text wrapping, quotes/Unicode, bullets, page breaks, colors, and absence of clipped or overlapping content. Record the visual result with the PDF hash from evidence.json; the runner deliberately leaves visualReview as PENDING until a person reviews it.
The actual demo sequence, from a directory with matching local configs, is:
acorn --offline intake stage --batch --config intake.json --source collected.jsonl
acorn --offline intake inspect --config intake.json --batch-id <batch-ID>
acorn --offline intake apply --config intake.json --batch-id <batch-ID>
acorn --offline report --config report.json --from 2026-10-26 --through 2026-10-27 --dry-run --combine
Replace the dates and batch ID for the actual demo. Keep original and correction rows together, or retain previously applied ancestry in the same workspace. The terminalâs Yes/No confirmation is the normal operator path; the automated runner uses explicit approvals only for its fictional data.
INTAKE-10 â Smoke-test the live form-to-download handoff
This is a separate manual, authorized cloud check. Local synthetic results do not prove current tenant access or delivery. Before demonstrating the live form:
- Use a standard-license contributor to open the SharePoint form. Confirm Project highlight is the default. Briefly select Report-wide update (no associated project): project controls should be disabled. Switch back, load projects, and submit a clearly labeled TEST ONLY project highlight. Require visible success/receipt feedback and record its UUID. My submissions should occupy its own row below the banner without overlapping it.
- Confirm the contributor and operator receive Teams confirmations, with no routine submission email. Keep email reserved for the configured milestone workflow.
- Open My submissions; verify the contributor sees only their own history. Edit the test highlight; project and report placement must remain fixed. Save the correction, require visible success feedback, record its new UUID, and verify the Teams confirmation.
- Wait for the collected export to refresh, download
logbook.jsonl, and confirm it contains both immutable receipts with the correct root/predecessor links. A receipt download is not the collected export. Confirm other existing rows were retained; use the retained source snapshot to compare. - Stage only the exact selected project receipts and their complete ancestry into a separate local workspace, inspect, approve, and generate the PDF. Verify the corrected highlight appears once. Preserve unselected/general receipts; never overwrite the collected export with the selected subset.
- Confirm the disabled GitLab branch remains Off. Do not enable it or send milestone emails solely to test a local ACORN release. If milestone delivery itself is in demo scope, test it separately with approved test recipients.
Record timestamps, receipt IDs, evidence of both Teams deliveries, export freshness, and PDF result using role aliases. Do not put credentials, participant addresses, or personal screenshots into shared acceptance records. This case is required for a live end-to-end demo, independent of INTAKE-01â09.
INTAKE-11 â Exercise the confirmation buttons in a real terminal
The runner also leaves an unapplied four-receipt batch in confirmation, including one personnel entry. In the original PowerShell window, inspect it and capture the index hashes:
$confirmationBatch = (Get-Content (Join-Path $intakeRoot 'evidence.json') -Raw | ConvertFrom-Json).confirmationBatch
Push-Location (Join-Path $intakeRoot 'confirmation')
& $env:ACORN_BIN --offline intake inspect --config intake.json --batch-id $confirmationBatch
$before = Get-ChildItem */index.json | Get-FileHash | Select-Object Path, Hash
& $env:ACORN_BIN --offline intake apply --config intake.json --batch-id $confirmationBatch
Run the last command again for each attempt, without --yes and without output redirection:
- Press Enter with No selected. Expect cancellation, nonzero exit, and unchanged indexes.
- Repeat with Escape, then Ctrl+C. Expect cancellation and unchanged indexes each time.
- Repeat, select Yes with Tab/arrows or
y, and confirm. Expect the reviewed changes and no duplicate entries on replay.
After each cancellation, compare hashes with $before (no output means unchanged):
Compare-Object $before (Get-ChildItem */index.json | Get-FileHash | Select-Object Path, Hash) -Property Path, Hash
After approving apply, exercise the personnel candidate using this command, repeating it for each cancellation and then approval:
& $env:ACORN_BIN --offline intake run --index watershed-sensing/index.json --interactive
No skips a candidate; Escape/Ctrl+C or declining the final write must leave the index unchanged and create no new backup. Capture fresh hashes before these attempts. Approve the candidate and final write to verify the retained archived source and exact-byte backup. --force and automated redirected-input rejection do not substitute for this interactive check. Return to the repository when finished:
Pop-Location
15. Completion and cleanup
CLEANUP-01 â Display the artifacts for review
Get-ChildItem -LiteralPath $env:ACORN_QA_ROOT -Recurse | Select-Object FullName, Length
Write-Host "Review failures before cleanup. Workspace: $env:ACORN_QA_ROOT" -ForegroundColor Cyan
CLEANUP-02 â Remove only this disposable run
Run only after screenshots and logs have been saved. This deletion cannot be undone.
$resolved = (Resolve-Path -LiteralPath $env:ACORN_QA_ROOT).Path
$allowedRoot = (Resolve-Path -LiteralPath "$env:ACORN_REPO\target\qa-acceptance").Path
if (-not $resolved.StartsWith($allowedRoot, [System.StringComparison]::OrdinalIgnoreCase)) {
throw "[FAIL] Refusing to delete an unexpected path: $resolved"
}
Remove-Item -LiteralPath $resolved -Recurse -Force
Write-Host "[PASS] Removed disposable acceptance workspace: $resolved" -ForegroundColor Green
Release acceptance recommendation
A release candidate is acceptable when:
- every applicable test in sections 1â8 and 13 passes;
- INTAKE-01â09 pass against the exact release candidate, including PDF content and visual inspection, whenever intake/reporting is in release scope;
- INTAKE-11 passes on an interactive terminal, and INTAKE-10 passes before claiming a live SharePoint-to-report demonstration;
- skipped PDF/live/interactive checks remain visible as outstanding; unsupported standalone general updates and direct SharePoint OAuth download are excluded explicitly or block a demo that requires them;
- PDF and PowerPoint artifacts pass visual inspection on at least one supported workstation;
- watch and TUI behavior pass on an interactive terminal build;
- connected tests pass in an environment authorized for network access;
- infrastructure tests pass only when those capabilities are part of the release scope;
- incomplete interfaces continue to fail clearly until they are implemented;
- no test writes outside the disposable workspace except the explicitly documented skill cache/clipboard and owner-supervised infrastructure actions;
- every failure has the test ID, version, operating system, terminal output, and retained artifact path.
Git branch, commit, merge-request, filter, and ignore selectors share the same source-resolution pipeline across check, format, export, and link. They should receive a short repository-specific smoke test when a release changes that pipeline. Merge-request tests require authenticated GitLab or GitHub context and belong with owner-supervised integration testing.
Local inference and tools
ACORN can publish a conservative tool catalog through two local interfaces:
- a managed Needle sidecar for local inference and opt-in native route previews; and
acorn serve mcp, a standard-input/standard-output Model Context Protocol server for external agents.
Both interfaces are projections of the same registry and invoke the same handlers. A tool being described to a model does not grant extra authority: ACORN still enforces its exposure and execution policy at dispatch time.
Native Needle routing is still experimental. Unscoped --route requests only preview a capability choice. Execution requires an explicit capability and caller-supplied JSON; the current routing evaluation remains below its 95% selection gate.
For direct inference APIs, embedded prompt instructions remain Markdown and the complete caller data object is appended once as canonical ZON. Local Rhai prompt scripts can build the complete prompt body from the merged data instead. Library callers can explicitly choose pretty JSON for troubleshooting. This is model-facing text only: ACP still uses JSON-RPC and OpenAI-compatible endpoints still use JSON request envelopes.
The CLI exposes that boundary through acorn infer run. ACP is the default backend and OpenCode is its default agent; --agent codex selects an installed codex-acp adapter. --backend ollama --model MODEL uses the local Ollama server through its OpenAI-compatible Chat Completions API. ACORN_INFERENCE_BACKEND supplies a default backend and an explicit --backend wins over it. ACORN never falls back between backends or agents. ACP permission requests remain governed by the fixed deny-mutation policy even when a session observer is attached.
Needle sidecar
ACORN integrates the Cactus Compute Needle 3 engine and needle3.cact model as a managed local subprocess. Needle selects tools; ACORN owns asset verification, process cleanup, execution policy, bounded tool dispatch, and result handling.
The integration is pinned to upstream revision b274efcb211a9eef48c9a88da4b43bd569696a39. ACORN uses Needleâs native loopback-only POST /complete API, sets NEEDLE_TELEMETRY=0 and DO_NOT_TRACK=1, and rejects unexpected schemes, non-loopback hosts, missing ports, and oversized responses.
Run inference
acorn infer "Return the running ACORN version"
The prompt can also be read from standard input:
echo "Return the running ACORN version" | acorn infer
The first online run downloads the engine for the current platform, the model, and its Apache-2.0 license. ACORN verifies the published byte length and SHA-256 of every file before execution and caches them outside the repository. Download and verify the bundle without starting inference:
acorn download needle
The command prints the engine path. The adjacent cache directory also contains needle3.cact and LICENSE. Once cached, the bundle works offline:
acorn --offline infer "Return the running ACORN version"
In the legacy inference loop, ACORN executes calls only when Needle returns a successful call response with finite calibrated confidence at or above the configured threshold. Calls are withheld when Needle reports negation, ungrounded arguments, or unusable confidence. The opt-in native route has the additional restrictions below. suppressed_calls remain diagnostic and are never executed.
How tool selection works
ACORN first filters the native capability registry by availability and the callerâs policy. It uses the prompt to make a bounded, deterministic family shortlist, then sends names and descriptions to Needle for one capability choice. The route catalog does not ask Needle to construct canonical arguments. ACORN checks the returned choice against the confidence and grounding rules and returns needs-input unless the caller supplied exact structured JSON. Caller JSON is validated against the canonical capability schema before a preview or one handler execution. A declined call returns a withholding reason without running a handler. The editable diagram source is needle-tool-selection.pikchr.
Native Needle routing is experimental and opt-in. Unscoped --route requests are preview-only. To run a handler, provide an explicit --capability and exact --input-json; use the direct command when accuracy matters. The pinned runner currently selects only 44 of 75 supported calibration capabilities correctly; it has not passed the required 95% gate. Keep the normal confidence threshold and do not use a lower threshold to compensate for wrong capability choices.
acorn infer "Return the running ACORN version" --route
acorn infer "Return the running ACORN version" --route --capability acorn.version --input-json '{}'
acorn infer "Return the running ACORN version" --route --capability acorn.version --input-json '{}' --route-preview
The first command returns a route preview without running a handler. The second can run the explicit capability after validation; the third forces a preview. Mutating routes also require --apply, an explicit --binding, and a --destination that exactly matches the caller JSON. The CLI reference lists the interface.
The explicit route rechecks the selected binding against offline and remote policy before dispatch. It uses caller JSON rather than model-generated arguments, validates that JSON against the canonical capability schema, and requires an exact capability, binding, arguments, and destination grant for mutation. A failed selection or response error produces no handler call or artifact. The routing evaluation distinguishes these synthetic safety checks from the pinned modelâs measured selection accuracy.
Path and URL components can help rank candidates, but cannot determine an exclusive family. The full capability catalog retains unions, discriminator values, and validation constraints. Check inputs retain their source kind, such as {"input":{"kind":"directory","value":"data"}}, through native argument validation and execution.
For native --route, the outcome field reports needs-input, withheld, or a later execution result. The response retains Needleâs original choice; selected and execution are absent when no binding was selected. For legacy acorn infer without --route, withholding is an abstention: ACORN prints the native response, sets withheld, and leaves results empty:
"withheld": { "reason": "confidence", "confidence": 0.1137, "threshold": 0.8 }
The legacy loop accepts --max-rounds. Raise --threshold to require stronger confidence there:
acorn infer "Validate this research activity" \
--threshold 0.9 \
--max-rounds 4
The managed process uses a 20-layer model depth, a 4,096-token output cap, and input-overflow failure. ACORN does not commit or distribute Needle assets in its source repository.
Pinned assets
The common model and license are:
| File | Bytes | SHA-256 |
|---|---|---|
needle3.cact | 35,335,380 | c9d915eca282ed42d1a09b143b592adb4cc6744ffe2d294adf5cfc5548170c38 |
LICENSE | 11,358 | cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 |
Supported engines are:
| Platform | File | Bytes | SHA-256 |
|---|---|---|---|
windows-x86_64 | needle.exe | 1,276,928 | 8dfa55f2a1280f4c7f2b9d7396ca2d3d4580ccc05c3bb3da62101b405323b062 |
windows-arm64 | needle.exe | 1,105,408 | 7211171111709a769bc2e858fd9967635a9571fad23fba57f369703f902ad618 |
linux-x86_64 | needle | 1,246,880 | 5eb163c5ed33bd914c103ef8eba2134c7bb2d97bafafdd69f410a4a3100e8c37 |
linux-arm64 | needle | 1,166,664 | b8d20caa7b8412c5900e05cf23d7a30dd84b7b89357d5408df30246ea9c808a6 |
macos-arm64 | needle | 824,744 | bfcc14c38a7ebf670bf7ade3849b617d268120dc4cc75d3aa12c88bc7c0ba75c |
Export tools.json
Generate the deterministic catalog given to Needle:
acorn export --tools --output ./bundle
This atomically creates ./bundle/tools.json and refuses to overwrite an existing catalog. Use --dry-run to preview the destination. The Needle catalog is capped at 32 KiB and uses compact input projections for large research-activity arguments. ACORN parses those projected JSON strings into the same typed values used by the canonical handlers. Destructive graduation application is excluded from Needle exposure.
Use a local ModelKit
Custom assets are disabled unless --custom-location is present. A Needle 3 bundle has this layout:
needle-bundle/
âââ LICENSE
âââ needle-modelkit.json
âââ needle3.cact
âââ tools.json
âââ needle # needle.exe on Windows
The manifest uses ACORNâs v1.0.0 ModelKit shape and Needle sidecar protocol 2:
{
"manifestVersion": "v1.0.0",
"sourceRevision": "b274efcb211a9eef48c9a88da4b43bd569696a39",
"platform": "linux-x86_64",
"sidecar": {
"kind": "needle",
"protocolVersion": 2
},
"runner": {
"path": "needle",
"size": 1246880,
"sha256": "5eb163c5ed33bd914c103ef8eba2134c7bb2d97bafafdd69f410a4a3100e8c37"
},
"assets": [
{
"name": "license",
"path": "LICENSE",
"size": 11358,
"sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"
},
{
"name": "model",
"path": "needle3.cact",
"size": 35335380,
"sha256": "c9d915eca282ed42d1a09b143b592adb4cc6744ffe2d294adf5cfc5548170c38"
},
{
"name": "tools",
"path": "tools.json",
"size": 1234,
"sha256": "REPLACE_WITH_SHA256"
}
],
"tools": "tools"
}
Use the exact host platform shown in the pinned-assets table. ACORN validates the manifest, protocol, platform, named model and license assets, file sizes, SHA-256 digests, exact tool catalog, and safe relative paths before starting the process. Protocol 1 Needle 2 bundles are rejected with repackaging guidance.
This is a hard cutover: the current release has no Needle 2 selector. Roll back by reinstalling the prior ACORN release and using its pinned Needle 2 bundle. ACORN does not delete the prior releaseâs cache, so that rollback remains available unless an operator removes it.
acorn infer "Return the ACORN version" --custom-location ./needle-bundle
The same directory can be supplied as a file:// URI. An https:// location may point to the manifest itself; ACORN downloads its safe relative files into the verified cache. The session regenerates its tool index from the current engine, model, protocol, and catalog identity, so a stale bundled index cannot change the exposed tools.
Save and publish an OCI ModelKit to Harbor
Install ACORN and ORAS 1.3 or newer. Harbor implements the OCI Distribution API, so ORAS can publish the ModelKit without a Harbor-specific client.
Build and publish in one step
The repository scripts copy and hash the required Needle 3 files, export tools.json, write the manifest, publish the artifact, resolve its immutable digest, and print the complete --custom-location value.
On Linux or macOS:
oras login example.ornl.gov
engine="$(acorn download needle)"
sh scripts/needle/create-oci-artifact.sh \
"$(dirname "$engine")" \
example.ornl.gov/research-enablement/needle:modelkit-2026-09 \
./needle-modelkit
On Windows PowerShell:
oras login example.ornl.gov
$engine = acorn download needle | Select-Object -Last 1
./scripts/needle/create-oci-artifact.ps1 `
-SourceDirectory (Split-Path $engine) `
-Reference example.ornl.gov/research-enablement/needle:modelkit-2026-09 `
-BundleDirectory ./needle-modelkit
Pass PLATFORM as the fourth shell argument or -Platform in PowerShell when packaging for another host. The source directory must contain the matching engine, needle3.cact, and LICENSE. Override ACORN_BIN, ORAS_BIN, or NEEDLE_SOURCE_REVISION for the shell script, or use the corresponding PowerShell parameters.
For a private certificate authority, set ORAS_CA_FILE or pass -CaFile. ORAS_REGISTRY_CONFIG/-RegistryConfig selects a non-default credential file. Development-only HTTP registries require ORAS_PLAIN_HTTP=1 or -PlainHttp; do not use plaintext transport for production credentials.
Save an OCI layout before publishing
Start with the validated directory described in Use a local ModelKit. Run ORAS from inside that directory so the OCI layer titles remain plain file names:
(cd ./needle-modelkit && oras push --oci-layout ../needle-modelkit.oci:local \
--artifact-type application/vnd.acorn.needle.modelkit.v2 \
needle-modelkit.json:application/vnd.acorn.needle.modelkit.manifest.v2+json \
LICENSE:text/plain \
needle3.cact:application/vnd.acorn.needle.model.v3 \
tools.json:application/json \
needle:application/vnd.acorn.needle.runner.v3)
oras resolve --oci-layout ./needle-modelkit.oci:local
The local tag exists only inside the OCI layout. To store the layout as one transferable file, archive its contents and verify that ORAS resolves the same manifest digest:
tar -cf needle-modelkit.oci.tar -C needle-modelkit.oci .
oras resolve --oci-layout ./needle-modelkit.oci.tar:local
Use the materialized ./needle-modelkit directory with a local ACORN command. ACORN does not treat the OCI layout or its tar archive as a local ModelKit directory:
acorn --offline infer "Return the ACORN version" --custom-location ./needle-modelkit
Push a saved layout to Harbor
Authenticate, copy the saved artifact, and resolve the registry reference:
oras login example.ornl.gov
oras cp --from-oci-layout ./needle-modelkit.oci.tar:local example.ornl.gov/research-enablement/needle:modelkit
oras resolve --full-reference example.ornl.gov/research-enablement/needle:modelkit
Use the published bundle with ACORN
Resolve the publication tag before downloading or running the bundle. ACORN and ORAS both accept the resulting immutable repository and digest reference.
Download and run locally
acorn download needle retrieves ACORNâs pinned public bundle. Use ORAS to download a bundle published to a private registry:
reference="$(oras resolve --full-reference example.ornl.gov/research-enablement/needle:modelkit)"
oras pull --output ./needle-modelkit-pulled "${reference}"
acorn --offline infer "Return the ACORN version" \
--custom-location ./needle-modelkit-pulled
ORAS reconstructs needle-modelkit.json, the engine, model, license, and tools.json in the output directory. ACORN validates those files before starting Needle.
Run directly from Harbor
Prefix the resolved reference with oci:// and pass it to --custom-location:
reference="$(oras resolve --full-reference example.ornl.gov/research-enablement/needle:modelkit)"
acorn infer "Return the ACORN version" \
--custom-location "oci://${reference}"
On PowerShell:
$reference = oras resolve --full-reference example.ornl.gov/research-enablement/needle:modelkit
acorn infer "Return the ACORN version" --custom-location "oci://$reference"
ACORN requires the digest reference because tags can move. It uses the registry credentials saved by oras login. A custom-location failure never falls back to the public bundle.
Run from an HTTPS manifest
ACORN can also download a manifest and its relative files from an HTTPS location:
acorn infer "Return the ACORN version" --custom-location https://example.ornl.gov/needle/needle-modelkit.json
The URL must point to needle-modelkit.json. The engine, model, license, and tool catalog must be available at the relative paths declared in that manifest. A Harbor repository URL does not expose this static directory shape; use its digest-pinned oci:// reference instead.
For air-gapped systems, transfer the validated directory through the approved media process and use its local path with --custom-location; global --offline prevents registry and public downloads.
Compare Needle generations
The checked-in harness runs the same held-out JSONL prompts against explicit Needle 2 and Needle 3 assets, with telemetry disabled for both:
python3 scripts/needle/compare-generations.py \
--v2-runner /path/to/needle2 \
--v3-runner /path/to/needle3 \
--v3-model /path/to/needle3.cact \
--tools /path/to/tools.json
It records exact native response/tool/argument matches, effective outcomes after ACORNâs confidence and argument-validation policy, refusals, confidence, native peak RAM, installed bytes, and cold/warm wall time in target/needle-generation-comparison.json. The default exit gates allow no policy-level accuracy regression or policy escapes, cap latency at 1.5 times the Needle 2 baseline and Needle 3 peak memory at 128 MiB, and require zero Needle 3 process failures. Override the numeric limits explicitly when conducting a new evaluation; retain the resulting report with release evidence rather than presenting upstream benchmark claims as ACORN measurements.
The 2026-09-23 macOS ARM64 migration smoke used three prompts with one cold and one warm repetition:
| Generation | Raw exact match | Policy outcome match | Cold / warm mean | Peak RAM | Installed assets |
|---|---|---|---|---|---|
| Needle 2 | 66.67% | 66.67% | 576 / 470 ms | 33.7 MB | 14,610,568 bytes |
| Needle 3 | 33.33% | 100% | 307 / 304 ms | 108.4 MB | 36,171,482 bytes |
Needle 3 proposed calls for the two negative prompts, but ACORN rejected both: one was below the confidence threshold and the other failed typed activity_json validation. The run had zero policy escapes or process failures and passed the documented gates. This is migration smoke evidence, not a general benchmark. This comparison ran on macOS ARM64; release-host results are recorded below as they pass.
On 2026-10-21, Oklahoma validated Linux x86_64 with acorn-cli 0.5.1 from the locally built image sha256:66ca4809a28cb2eadebc866a8886deaa98c5853579a07eee7d2cb62e81ee1119. The cached engine, model, and license matched the pinned byte lengths and SHA-256 values above. Online and cached offline inference returned the running version through the tool-result handoff. One online run took 1.07 seconds wall time and reported 78.0 MB peak RAM. The unsupported weather prompt made no tool call; a proposed logbook-graduation call at 0.2465 confidence was withheld at the 0.8 threshold; an offline HTTPS ModelKit location was rejected before download.
For the cancellation checks, the same image binary ran directly on the Oklahoma host so its process tree could be observed. After Needle reported its loopback server ready, separate SIGTERM and SIGINT runs made ACORN exit with a cancellation error. Each captured Needle child had no descendants and was gone after ACORN exited; each session directory was removed. Normal inference also left no Needle process. This verifies Linux x86_64 cleanup without relying on container teardown.
On 2026-10-29, Dante validated Linux ARM64 with a native acorn-cli 0.5.3 release build from revision 790ef808 on Ubuntu 24.04.5 (aarch64, Docker 29.1.3). acorn download needle fetched the engine, model, and license for Needle revision b274efcb211a9eef48c9a88da4b43bd569696a39; their byte lengths and SHA-256 values matched the pinned Linux ARM64 engine and common assets above. Online and cached offline inference returned 0.5.3 through the tool-result handoff. Native wall times were 0.80 and 0.68 seconds, respectively; Needle reported 73.9 MB peak RAM for both. The engine bound to 127.0.0.1 on an ephemeral port. The unsupported weather prompt executed no tool, and a proposed logbook-graduation call at 0.2311 confidence was withheld at the 0.8 threshold. Offline mode rejected an HTTPS ModelKit location before download.
Native SIGTERM and SIGINT runs were interrupted after Needle reported its loopback server ready. ACORN reported cancellation in both runs; each captured Needle child exited and its session directory was removed. Normal inference also left no Needle child or session directory. This directly verifies Linux ARM64 process cleanup on Dante.
The validate-needle-windows-amd64 GitLab job is a manual release-host smoke for a native Windows x86_64 shell runner tagged windows-x86_64. It consumes the Windows executable from build-release, downloads and verifies the pinned engine, model, and license, exercises online and cached offline version-tool handoff, checks the unsupported and destructive prompts, rejects an offline network location, and records normal process cleanup. Its target/needle-windows-x86_64.json artifact includes the runner, revision, hashes, elapsed times, and peak memory reported by Needle. A passing job alone does not establish cancellation cleanup; observe a native Ctrl+C run and confirm the Needle child and session directory are removed before recording Windows x86_64 as verified here.
MCP relationship
acorn serve mcp exposes the canonical ACORN registry and its full schemas over MCP stdio. Needleâs tools.json retains the same safe tool names, dispatcher, and handlers, while using narrower routing descriptions and compact inference-oriented input schemas where needed. MCP is the interoperability surface for an external host or agent; Needle is the local tool selector. Neither exposes arbitrary shell execution or recursive Needle inference.
Native Needle routing evaluation
Current status
Native Needle routing is experimental. Unscoped --route requests only preview a capability choice; running a handler requires an explicit capability and exact caller JSON. The pinned runner selected 44/75 supported capability names in a fresh November 9 calibration, so automatic selection is excluded from the explicit-dispatch release. The former PAR-15 held-out release gate is retired; a future automatic selector needs a separately versioned evaluation.
| Revised calibration measure (reproduced 2026-11-09) | Result |
|---|---|
| Supported cases | 75 |
| Expected capability retained by shortlist | 74/75 |
| Raw Needle call names matching expected capability | 44/75 |
| Correct previews accepted by the execution gate | 7/75 |
| Forbidden, negated, or ungrounded cases eligible to execute | 0 |
The revised candidate has not been run on the held-out split. An earlier baseline did score all 200 cases, including held-out cases, before the repair work. That baseline is preserved below; its held-out result is not a score for the revised candidate. The PAR-34 safety harness replays all 30 negative corpus rows through synthetic refusals, negation, and grounding flags against a safe terminal handler and observes zero calls or artifacts. Separate tests verify that caller JSON overrides model arguments only after canonical validation, offline and remote policy withholds ineligible bindings, exact mutation grants are required, response errors never run a handler, and mismatched version, schema, or effects reject a binding. Compatible alternative-binding policy is replayed separately; the frozen corpus lacks version/schema declarations for its incompatible-binding examples, so those rows remain marked as missing contract evidence. These tests do not establish what flags the live model would emit.
Initial 200-case baseline
The first real Needle measurement ran all 200 cases in corpus revision 3 on 2026-11-03. It is preserved in results.json (tracked SHA-256 dfc292d99c0e205f75ac3576941a29e758cfde997b3b60f2b0ff12b89eb46a84). The tracked corpus SHA-256 is 86467c8aff2dbeff4033aff67fa590d5a4d9d7943c3a4a42012a3a2d53865379.
The harness started the pinned local Needle runner once per case with the native registry and a deterministic prompt shortlist. It invoked route_once in preview mode and asserted that no handler content or artifacts were produced. It measured capability choice, outcome, catalog size, and elapsed time. It did not execute the corpusâs declared mutations, apply binding selections, or validate output equivalence. The first run used an online-built registry for offline prompts; the harness now builds the registry per case, so the offline rows require remeasurement before acceptance.
| Measure | Calibration | Held-out |
|---|---|---|
| Cases | 100 | 100 |
| Cases with an expected capability | 75 | 75 |
| Expected capability retained by shortlist | 73/75 | 71/75 |
| Raw Needle call names matching expected capability | 1/75 | 2/75 |
| Accepted correct capability previews | 0/75 | 0/75 |
Across all cases, Needle returned 163 tool-failed, 29 withheld, seven needs-input, and one proposed outcome. No native handler ran, by construction of the preview. The median case time was 1,692.5 ms; nearest-rank p95 was 4,740 ms. Serialized shortlists ranged from 5,066 to 21,162 bytes, under the 22-KiB prompt target and 32-KiB hard catalog cap. A focused calibration test retains at least 95% of eligible targets under the corrected per-case offline policy.
A diagnostic replay of READ-002 with only acorn.check in the catalog still returned Needle error code truncated and message tool call truncated: token budget exhausted at 4,221 catalog bytes. A single-capability acorn.doctor replay returned an accepted proposed preview at 266 bytes. This identifies a model-facing schema or output-budget problem in addition to shortlist ranking. The 163 failures were not all individually classified by error code in the first result fixture.
The required gate is 95% correct selection on unambiguous supported cases and zero executions on forbidden, negated, or ungrounded cases. This baseline was far below the selection threshold, and preview mode alone could not prove the negative-case execution gate. PAR-16 and ADP-06/07 release prerequisites remain pending.
PAR-34 calibration replays on 2026-11-04 tested a compact model-facing schema projection with a 6-KiB prompt shortlist. The frozen calibration split still produced only 18/75 raw correct capability names and 1/75 accepted correct previews. Outcomes across 100 cases were 71 withheld, 16 needs-input, 10 tool-failed (all truncated), two invalid-input, and one proposed. The shortlist retained 71/75 expected capabilities; serialized catalogs ranged from 1,517 to 6,143 bytes. The harness used case-specific offline policy and caller-confirmed local check paths, but did not yet apply every declared binding or mutation policy. These results were diagnostic calibration evidence. Single-capability acorn.check with caller-confirmed JSON produced a correct proposed preview at 238 catalog bytes; the larger shortlist reduced its confidence below the 0.8 execution gate. The later PAR-34 safety matrix is described above.
A separate calibration-only two-stage probe used 13 simple Needle family descriptors. Its first stage chose the correct family for 12/75 supported cases. Replacing acorn.route::<family> names with direct acorn.<family> names and narrowing to the lexical candidate families still misclassified the READ-001 metadata check; an explicit family-selection instruction also misclassified it. The probe was removed from production code. This result does not support shipping a second Needle decision with the pinned runner.
The replacement first stage is deterministic: ACORN infers a capability family from the prompt and sends that familyâs eligible tools to Needle. A parser repair also preserves family names in IDs with :: variants. The first exact-family calibration replay retained 73/75 expected capability IDs, produced 36/75 raw correct Needle call names, and accepted 12/75 correct previews. READ-001 improved from a truncated 749-byte three-family catalog to an accepted acorn.check preview with a 238-byte exact-family catalog and 0.9788 confidence. That replay omitted the caller JSON from the model prompt, unlike the CLI route, so it is diagnostic only.
After aligning caller JSON presentation and binding preference with the CLI, a second 100-case calibration replay retained 73/75 expected IDs, produced 39/75 raw correct calls, and accepted 10/75 correct previews. Its outcomes were 44 withheld, 22 needs-input, 14 proposed, 11 tool-failed (all truncated), five invalid-input, and four unavailable. Catalogs ranged from 224 to 6,143 bytes. The remaining shortlist misses were EFFECT-017, which mentions both crosswalk and export, and offline BOUND-025, whose publication binding is unavailable. A subsequent lexical rule gives explicit export requests priority. A single EFFECT-017 replay confirmed that its expected capability is now retained; Needle returned needs-input without selecting a tool. The revised rule has not had a full calibration replay. No held-out scores were used to tune these rules.
Review repairs after these replays preserve canonical union argument shapes, retain tagged check inputs, exclude path components from exclusive family hints, and resolve the corpusâs native binding aliases before applying overrides and preferences. The measurements above predate those repairs; the later calibration measurements below include them.
The repaired canonical catalog replay on 2026-11-05 retained 73/75 labeled calibration targets, but Needle named only 16/75 correctly; 34/100 responses were truncated and no correct preview passed the gate. A separate capability-only routing catalog, which asks Needle to choose a name and requires exact caller JSON for execution, eliminated truncation and raised raw correct names to 41/75. It retained 74/75 targets and accepted two correct previews. An explicit name-only instruction lowered raw correct names to 23/75 and was removed. A small optional source hint improved the current calibration candidate to 44/75 raw correct names and seven accepted correct previews, with 74/75 shortlist retention and no truncated responses; selection catalogs were at most 4,172 bytes. No forbidden, negated, or ungrounded calibration case was eligible to execute without preview mode. These are calibration results; the revised candidate has not been evaluated on held-out because the 95% gate is unmet. The harness records declared binding candidates and replays compatible alternative-binding policy separately from model choice. The corpus does not contain schemas for its incompatible binding examples, so those contracts are reported as missing contract evidence rather than scored as faithful policy replays.
The 95% correct-selection gate is unmet. The pinned Needle runner frequently abstains or chooses the wrong variant even when the expected family is present. A fresh November 9 run reproduced 44/75 correct raw names, seven accepted correct previews, and 74/75 shortlist retention. The preview-only live harness does not prove negative-case nonexecution under a live handler. PAR-34 separately establishes synthetic policy and safe-handler evidence for explicit dispatch; automatic selection stays preview-only.
A calibration-only preview fallback was measured after the capability-only replay. It left Needleâs raw score at 44/75 and raised a combined model-or-rule suggestion to 66/75. It also replaced some correct Needle variants with wrong suggestions. The fallback was removed. Native routing remains opt-in, and unscoped --route requests are preview-only; an explicit capability and caller JSON are required to run a handler. The pinned runner is not qualified as an automatic selector across the near-parity catalog. A future automatic-selector candidate must be frozen before held-out scoring.
Packages
ACORN publishes separate packages for its portable schemas, host services, CLI, and WebAssembly bindings. The Python bindings are maintained in a companion project.
graph LR
CORE["acorn-core</br>portable values"] --> H["acorn-host</br>native adapters"]
DIFF["acorn-diff</br>portable diffs"] --> A
M["acorn-cmd</br>native commands"] --> H
S["acorn-schema</br>portable Rust schemas"] --> ANALYSIS["acorn-analysis</br>portable findings and metrics"]
ANALYSIS --> SERVICE["acorn-service</br>application operations"]
S --> SERVICE
S --> A["acorn-lib</br>native services"]
ANALYSIS --> A
H --> A
M --> A
A --> B["acorn-cli</br>command-line application"]
A -.-> PY["acorn-py</br>companion project"]
SERVICE --> D["acorn-wasm</br>JavaScript package"]
SERVICE --> SERVER["acorn-server</br>JSON-RPC and typed gRPC"]
Use acorn-diff for in-memory diffs, acorn-schema for data models and validation, acorn-analysis for portable findings and readability, and acorn-service for supplied-content application operations. Small native tools can use acorn-cmd and acorn-host. Use acorn-lib for native discovery, persistence, providers, documents, and artifact workflows.
Use an ACORN MCP Bundle to install the target-specific CLI and its static, read-only MCP tool declaration as one validated archive.
Portable diffs
acorn-diff provides deterministic, in-memory diff primitives without depending on other ACORN crates or host services.
Its default std feature supports native applications. Disable default features and enable alloc for portable and WebAssembly-compatible consumers:
[dependencies]
acorn-diff = { version = "0.3.2", default-features = false, features = ["alloc"] }
Use unified_diff for labeled line-oriented output. Import DiffValue and call before.diff(&after) to create an RFC 6902 patch over two serde_json::Value instances. Generated patches use deterministic object-key ordering and the add, remove, and replace operation subset; the Rfc6902 trait exposes validated constructors for all six operation shapes.
ACORN-specific format detection and canonicalization live in acorn::analyzer::diff. Without --method, the acorn diff BEFORE AFTER command compares files in the same metadata standard and can emit unified output or JSON Patch. The commandâs separate --method mode uses the portable acorn_core::similarity::compare facade; it does not change the acorn-diff package API.
Rust schemas
acorn-schema contains ACORNâs portable data model, validation rules, persistent identifiers, and metadata-standard types. It does not require ACORNâs host filesystem, process, database, or network services.
Installation
Add the crate to a Rust project:
cargo add acorn-schema
Schema and validation functions can then be used directly:
#![allow(unused)]
fn main() {
use acorn_schema::validation::rules::{ark, arxiv, doi, isni, orcid, ror};
assert!(ark("ark:/1234/w5678").is_ok());
assert!(arxiv("arXiv:2106.09685").is_ok());
assert!(doi("10.11578/dc.20250604.1").is_ok());
assert!(isni("https://isni.org/isni/0000000492299539").is_ok());
assert!(orcid("https://orcid.org/0000-0002-2057-9115").is_ok());
assert!(ror("01qz5mb56").is_ok());
}
See the acorn-schema API documentation for the complete public surface and Persistent identifier lifecycle for identifier behavior.
The alloc-capable acorn_schema::standard::zon module encodes and decodes the JSON data model without host I/O or an additional runtime dependency. See ZON serialization for the supported profile and file conventions.
The portable acorn_schema::standard::dublin_core module models the current DCMI terms, legacy element namespace, DCMI type vocabulary, and DCAM terms as a normalized RDF graph. Its local codecs cover native graph JSON and YAML, JSON-LD, RDF/XML, and Turtle. See Dublin Core for the data model, safety boundaries, and crosswalk behavior.
Research activity records can carry time-coded developments and project-health assessments in an optional logbook. See the Logbook schema for the entry variants, validation rules, reporting-window behavior, and data flow into reports and canonical metadata.
Local PID validation checks parsed structure and, for ISBNs, ISNIs, ORCIDs, and RORs, the implemented check digit. It does not confirm registration with an external authority.
Computation complexity
Use bigo! to check a Big-O string literal during compilation:
#![allow(unused)]
fn main() {
use acorn_schema::{bigo, computation::ComplexityBound};
let bound = ComplexityBound::Time(bigo!("O(n log n)").into());
}
The same grammar validates complexity strings in research activity JSON. For example, {"case":"worst","bounds":[{"time":"O(n log n)"}],"variables":{"n":"number of records"}} describes a computation bound. Validation checks notation and, when a variables map is supplied, its referenced names; it does not prove the claimed complexity or infer it from measurements.
The #[validate(bigo)] scalar rule uses the same parser for schema fields. Canonical notation supports explicit products, division, rational powers such as P^(1/2), polylog(P), W_out(P), and named-base logarithms such as log_a(P). A complete RAD document reports malformed, undeclared, empty, and repeated time or space bounds at their nested metadata paths with syntax, reference, nonempty, and duplicate codes. Bound JSON Schema limits each expression to 256 characters; runtime parsing and variable checks remain authoritative.
For pairwise analysis, acorn_core::big_o::compare_notation accepts ComparisonInput { left, right, assumptions } and returns ComparisonOutput { left, right, dominance, assumptions }. It infers ordinary symbols as growing and named logarithm bases as fixed-log-base; supplied assumptions override those defaults. The returned map contains the effective assumptions in lexical order. left or right means that side grows strictly faster. equivalent, incomparable, and undetermined are valid analytical results. Malformed expressions, more than 64 supplied assumptions, and assumptions for names absent from both expressions are errors. The lower-level compare_growth API remains available for already parsed expressions and explicit assumptions.
Logbook schema
The logbook records time-coded developments alongside a research activityâs canonical metadata. It supports two kinds of entry: an ActivityEntry describes a development at an instant, while a StatusUpdateEntry assesses project health over a reporting period. Both are represented by the Rust enum LogbookEntry and serialized inside ResearchActivity.logbook.entries.
The exact public type is LogbookEntry; âlogbook entriesâ refers to a Vec<LogbookEntry> rather than a separate LogBookEntries type. Serialized field names use camel case even though the Rust fields use snake case.
Information flow
The main reviewed workflow starts with a submission envelope in JSONL. intake stage, intake inspect, and intake apply admit the envelope and write its normalized entry to the selected research activity. A JSONL line is an immutable submission envelope, not a bare LogbookEntry; direct JSON, YAML, ZON, or Markdown authoring can place the schema value in a RAD without that intake envelope.
After decoding, ACORN validates the selected entry variant, its nested values, and the containing logbook. Reporting resolves inherited ranges, selects entries for the requested interval, and creates a LogbookUpdates projection ordered newest first. The report pipeline renders that projection without requiring metadata graduation. Graduation is an optional, separately reviewed path for supported activity entries: accepted values are copied into canonical metadata while the source entry remains in the logbook, marked archived: true and state: completed.
The editable diagram source is logbook-information-flow.pikchr. See intake for receipt review and correction behavior and report for artifact generation.
Type structure
LogbookEntry is an untagged enum. JSON, YAML, and ZON do not contain a separate entry-type discriminator; deserialization chooses Activity or StatusUpdate from the fields present in the object. Each variant rejects unknown fields. ProjectHealth is different: it is internally tagged by its status field.
The editable diagram source is logbook-entry-structure.pikchr.
Container fields
ResearchActivity.logbook is optional. When present, the Logbook object has these fields:
| Serialized field | Rust type | Requirement |
|---|---|---|
summary | Option<String> | Optional editorial overview; 1â1,000 characters when present. |
range | Option<ReportingWindow> | Optional default reporting window for status updates that omit their own range. |
entries | Vec<LogbookEntry> | Required; 1â1,000 entries. Source order is preserved during serialization. |
Entry identifiers must be unique across both variants in one logbook. A status update must resolve to a bounded period with a lower bound. It can supply its own range, or inherit the top-level logbook.range; an entry-specific range replaces the default rather than merging with it.
ReportingWindow is half-open:
| Serialized field | Rust type | Meaning |
|---|---|---|
left | Option<String> | Inclusive RFC 3339 lower bound. null means full history where the operation permits it. |
right | String | Exclusive RFC 3339 upper bound; it must be later than left when left is present. |
All logbook timestamps must be complete RFC 3339 instants with an explicit offset, such as 2026-10-31T16:45:00Z or 2026-10-31T12:45:00-04:00.
Activity entries
An ActivityEntry captures one development and its provenance.
| Serialized field | Rust type | Requirement |
|---|---|---|
identifier | String | Required kebab-case identifier; 1â100 characters and unique within the logbook. |
projectId | String | Required kebab-case project identifier; 1â100 characters. |
global | bool | Defaults to false; when true, the entry can appear among general updates on the report title page. |
timestamp | String | Required RFC 3339 instant with an explicit offset. |
category | LogbookCategory | Required subject vocabulary value. |
classification | Option<ClassificationLevel> | Optional classification; classified entries must use category: administration. |
eventType | Option<LogbookEventType> | Optional event format; classified entries must use eventType: other. |
state | LogbookState | Required temporal interpretation of the timestamp. |
origin | LogbookEntryOrigin | Defaults to manual. |
discovery | Option<LogbookDiscovery> | Required only when origin is discovered; forbidden for manual entries. |
summary | String | Required description; 1â1,200 characters. |
items | Option<Vec<String>> | Optional 1â20 supporting statements; each is 1â1,000 characters. |
archived | bool | Defaults to false; graduation sets accepted source activities to true. |
LogbookDiscovery contains the enrichment provider, a non-empty provider-native source of at most 2,048 characters, and discoveredAt, an RFC 3339 instant. The provider and source also produce the deterministic identifier used for discovered candidates.
Activity vocabularies
category accepts:
administration,collaboration,data,engagement,funding,infrastructuremethod,other,personnel,publication,research,software
Compatibility aliases normalize conference and tour to engagement, technical to infrastructure, general to other, and code to software.
state accepts completed, in-progress, and upcoming. It describes whether work was complete, underway, or expected at the recorded instant; it is distinct from the research activityâs lifecycle status and from an entryâs archived flag.
eventType accepts conference, exhibition, meeting, other, presentation, tour, training, and workshop.
Status update entries
A StatusUpdateEntry records the most important change for a reporting period, why it matters, and the projectâs overall health.
| Serialized field | Rust type | Requirement |
|---|---|---|
identifier | String | Required kebab-case identifier; 1â100 characters and unique within the logbook. |
projectId | String | Required kebab-case project identifier; 1â100 characters. |
timestamp | String | Required RFC 3339 submission instant with an explicit offset. |
range | Option<ReportingWindow> | Optional entry-specific reporting period; otherwise the top-level logbook range is inherited. |
summary | String | Required most important change or result; 1â1,200 characters. |
significance | String | Required explanation for leadership; 1â1,000 characters. |
health | ProjectHealth | Required tagged health assessment. |
evidence | Option<String> | Optional concrete proof; 1â1,000 characters when present. |
risk | Option<ProjectRisk> | Optional leadership-relevant risk or dependency. |
health.status accepts on-track, ahead-of-plan, at-risk, delayed, paused, and complete. The at-risk, delayed, and paused variants may also carry a non-empty reason of at most 1,000 characters. Awaiting decisions and dependencies belong in risk, not in a new health state.
ProjectRisk has a required kind and a required 1â1,000 character explanation. The kind vocabulary is data, infrastructure, security-accreditation, software-environment, sponsor-prioritization, partner-coordination, funding-contracting, staffing, validation, classified-environment-access, or other.
Example serialized logbook
The following logbook contains one activity and one status update. The status update inherits the top-level reporting window.
{
"summary": "October research and delivery updates.",
"range": {
"left": "2026-10-01T00:00:00Z",
"right": "2026-11-01T00:00:00Z"
},
"entries": [
{
"identifier": "release-validated",
"projectId": "acorn",
"global": true,
"timestamp": "2026-10-21T17:30:00Z",
"category": "software",
"state": "completed",
"origin": "manual",
"summary": "Validated the release on Linux x86-64.",
"items": [
"Verified online and cached offline execution.",
"Confirmed process cleanup after completion."
],
"archived": false
},
{
"identifier": "october-status",
"projectId": "acorn",
"timestamp": "2026-10-31T16:45:00Z",
"summary": "Release validation expanded to another supported host.",
"significance": "The additional evidence reduces deployment uncertainty.",
"health": {
"status": "on-track"
},
"evidence": "The host smoke suite completed without a policy escape.",
"risk": {
"kind": "staffing",
"explanation": "A second reviewer is needed before the next publication window."
}
}
]
}
Ordering and reporting semantics
Storage order and display order intentionally differ:
- Serialization preserves the order of
logbook.entriesin the source record. entries_allparses every timestamp, resolves a missing status-update range fromlogbook.range, and returns cloned entries newest first.updates_sinceincludes entries whose entry timestamp is at or after the inclusive instant, regardless of variant.updates_withinincludes activities whose timestamp falls in[left, right). It includes status updates whose resolved reporting range overlaps the requested half-open window.- A
LogbookUpdatesprojection combines the selected entries with the activity title, subtitle, keywords, principal investigators, sponsors, and the selection bounds used by report rendering.
An invalid timestamp fails selection instead of being silently skipped. A bounded report excludes an activity exactly at the exclusive right instant. Overlap selection lets a status assessment submitted after a period still appear in the report for the period it assesses.
Validation summary
Validation operates at three levels:
- Each variant validates field lengths, timestamps, identifiers, and nested values.
ActivityEntryenforces the origin/provenance pairing and the classification category and event constraints.Logbookenforces unique identifiers and ensures every status update resolves to a reporting window with a lower bound.
The enum delegates Validate to the selected entry variant. The containing ResearchActivity validates the optional logbook as a nested value, so ordinary whole-record validation reports logbook errors with their entry paths.
Markdown representation
The schema types support Markdown conversion. Decoding expects YAML front matter delimited by ---; the typed fields come from that front matter. Rendering produces a human-readable # Logbook document with one heading per entry. Activity entries include state, category, origin, optional classification and event information, summary, and supporting items. Status entries include health, leadership significance, optional health context, evidence, and risk details.
For the complete Rust surface, see the research_activity::logbook API documentation.
Portable analysis
acorn-analysis provides ACORN findings, batches, summaries, validation issue folding, FAIR evaluation, and readability metrics. Its operations consume caller-supplied values and compile with alloc on native and wasm32-unknown-unknown targets.
cargo add acorn-analysis
Filesystem discovery, Vale execution, terminal rendering, fixes, inference, and databases remain native behavior in acorn-lib and its adapters.
Application service
acorn-service exposes three transport-neutral operations over supplied content: Research Activity validation, readability checking, and deterministic repository processing. It also owns the typed JSON-RPC registry used by acorn-server.
cargo add acorn-service
Requests never name local files to open. Repository inputs carry lexical relative paths and content, and processing returns ordered reports and proposed changes without writing a working tree. Use acorn-server when these same operations need authenticated JSON-RPC or typed gRPC transport.
Native commands
acorn-cmd provides ACORNâs dependency-light native command surface without depending on acorn-core, acorn-lib, schemas, or analysis code.
cargo add acorn-cmd --no-default-features
The cmd! and args! macros preserve argument boundaries and accept path and string values without constructing a shell command. CommandSpec provides executable discovery, environment and working-directory configuration, checked output, spawning, and bounded execution:
#![allow(unused)]
fn main() {
use acorn_cmd::{args, CommandSpec};
use std::time::Duration;
let output = CommandSpec::new("git")
.args(args!["status", "--short"])
.env("GIT_TERMINAL_PROMPT", "0")
.checked_output_with_timeout(Duration::from_secs(10))?;
Ok::<(), std::io::Error>(())
}
Managed execution
Version 0.3.3 adds managed execution as the preferred API for cancellation, descendant cleanup, streaming, and bounded capture. Each execution owns a process group on Unix or a Job Object on Windows. The group is terminated and reaped on timeout, cancellation, output failure, panic unwind, and after the process leader exits, so supervised descendants are never detached.
Options are optional. cmd!(exec "git status") and cmd!(exec checked "git status") use ExecutionOptions::new(); add the named opt suffix only when the defaults need customization.
#![allow(unused)]
fn main() {
use acorn_cmd::{cmd, CancellationToken, ExecutionOptions, OutputStream};
use std::{io, time::Duration};
let cancellation = CancellationToken::new();
let options = ExecutionOptions::new()
.with_cancellation(cancellation.clone())
.with_timeout(Duration::from_secs(10))
.with_sink(|stream: OutputStream, bytes: &[u8]| {
eprintln!("{stream:?}: received {} bytes", bytes.len());
Ok::<(), io::Error>(())
});
let result = cmd!(exec checked "git", ["status", "--short"]; opt: &options)?;
assert!(result.status().is_some_and(|status| status.success()));
Ok::<(), acorn_cmd::CommandError>(())
}
Capture retains raw stdout and stderr separately. Defaults keep the newest 1 MiB and 10,000 lines per stream, and report exact dropped-byte and dropped-line counts. Use CaptureLimits::unlimited() only when the caller explicitly accepts unbounded memory.
The existing output, checked_output, timeout variants, and spawn remain available. Output adapters retain unlimited capture for compatibility. spawn still returns an unmanaged direct child, so its caller owns descendant cleanup.
Managed cmd! forms accept the same options and preserve compile-time interpolation:
#![allow(unused)]
fn main() {
use acorn_cmd::{cmd, CaptureLimits, ExecutionOptions};
let options = ExecutionOptions::new().with_capture_limits(CaptureLimits::new(Some(64 * 1024), Some(500)));
let branch = "main";
let result = cmd!(exec "git rev-parse {branch}"; opt: &options)?;
Ok::<(), acorn_cmd::CommandError>(())
}
parse_sh and command_string provide a shared, shell-free grammar for runtime command words and diagnostic rendering. They preserve empty and quoted arguments, but perform no expansion or shell execution.
Shell linting is optional and has no default activation:
cargo add acorn-cmd --no-default-features --features shell-lint
The command-literal parser remains internally isolated in acorn-macros; consumers use it only through acorn-cmdâs public macro surface. Macro expansion uses $crate paths, so renaming the dependency in Cargo.toml remains supported.
Native host adapters
acorn-host exposes concrete native capabilities for small downstream tools. It has no default features, and each capability is additive:
| Feature | Capability |
|---|---|
fs | UTF-8 reads, checksums, executable permissions, file URIs, safe relative paths, platform project-cache namespaces, and temporary directories |
config | Caller-owned JSON, strict JSONC, YAML, and YML deserialization plus ordered path discovery |
http | Async clients, exact authority policy, redirect revalidation, bounded probes, and diagnostic redaction |
download | Bounded streaming, optional checksums, partial cleanup, and no-clobber installation |
source | Local, file-URI, and HTTP source reads plus bounded noninteractive Git probes |
terminal | ANSI styling for labels, which remain available as plain text without this feature |
Select only the features a tool uses:
cargo add acorn-core --no-default-features --features alloc
cargo add acorn-cmd --no-default-features
cargo add acorn-host --no-default-features --features fs,config,http,download,source,terminal
HTTP allow-list entries are exact HOST or HOST:PORT authorities. Empty lists are unrestricted. Original requests and every redirect are checked; credentials, queries, and fragments are removed from diagnostics. HEAD probes use a bounded GET fallback for servers that reject HEAD.
JSONC accepts line and block comments plus trailing commas while retaining JSONâs quoted property names and double-quoted strings. resolve_config_path returns an explicit path unchanged or searches caller-supplied default names in order. project_cache_directory creates and returns a stable SafePath namespace beneath the applicationâs platform cache root; callers that need unique children add them themselves.
Downloads write a sibling partial file, enforce optional size and checksum expectations, clean the partial on failure, and atomically create the destination without replacing an existing file. Workflow policy such as offline mode, required checksums, retry strategy, and executable installation remains with the caller.
The runnable fixture under tests/downstream-host demonstrates a manifest that depends only on acorn-core, acorn-cmd, and acorn-host, including a renamed acorn-cmd dependency.
Rust core library
The ACORN CLI application uses acorn-lib for analysis services, persistence, provider APIs, and artifact generation. Dependency-light command execution and native filesystem, HTTP, download, source, configuration, and terminal primitives are owned by acorn-cmd and acorn-host. Portable schemas, validation, and persistent identifiers are owned by acorn-schema.
AI and agent APIs
The library also provides building blocks for optional AI-enabled applications:
acorn_schema::agentmodels language models, providers, benchmark harnesses, prompt files, and agent-oriented OpenCode configuration.- Embedded prompt templates support summarization, translation, teaching, claim extraction, and gap finding.
PromptHydratorappends complete prompt data as canonical ZON by default;PromptDataFormat::Jsonprovides a deterministic troubleshooting view. The inference adapters forward the hydrated Markdown body without changing their JSON wire protocols.- With the
execfeature,PromptScriptHydratorevaluates a capability-free Rhai script against caller data and returns the complete prompt body. The CLI enables this library feature in its standard build; see the custom prompt examples. acorn::io::api::openaiprovides a client for completions, chat completions, responses, embeddings, model discovery, and related operations using supported OpenAI-style HTTP endpoints and JSON formats. It can call OpenAIâs service or another compatible server, including a local one such as llama-swap; âOpenAI-compatibleâ describes the connection format, not the model provider.
These APIs complement ACORNâs deterministic schema and artifact workflows; applications decide when and how a model is invoked.
Runnable examples
From the workspace root, run these offline examples without an agent or API credentials:
cargo run --example confirm
cargo run --example resolve_vocabulary
cargo run --example semantic_diff
cargo run --example validate_activity
confirm needs an interactive terminal and lets you select Yes or No without changing any files.

No is selected by default (top). Use Left, Right, or Tab to switch buttons, Enter to confirm, or Escape to cancel.
The other examples validate a bundled RAD record and show a field error, resolve research keywords against an embedded controlled vocabulary, and compare two RAD versions after canonicalization. The Rust examples and sample Rhai scripts are all in crates/acorn-cli/examples/.
Installation
Add the library with its default features:
cargo add acorn-lib
Applications that need host analysis or PowerPoint support can enable those features explicitly:1
cargo add acorn-lib --features analysis,powerpoint
Service applications use the dedicated portable contract and server crates:
cargo add acorn-service
cargo add acorn-server
See Protobuf and gRPC for the typed transport contract and security policy. The generic acorn-lib gRPC envelope has been removed.
Applications that need to call configured MCP tools can enable the independent mcp-client feature:
cargo add acorn-lib --no-default-features --features mcp-client
See MCP client for configuration, Rust examples, transport security, and operation-policy behavior. The default library feature only establishes standard-library support; inbound and outbound MCP transports remain explicit capabilities.
Native applications that only need ACORNâs analysis host can omit the full default feature set:
cargo add acorn-lib --no-default-features --features analysis
This feature includes the analyzerâs filesystem, network, document, database, and rendering adapters. It excludes the agentic server and MCP stack, system diagnostics, PowerPoint support, and shell linting. The lower-level analyzer feature remains the portable, allocation-only analysis kernel.
System diagnostics require diagnostics, and the inbound MCP server requires agentic. PowerPoint, chart, DuckDB, shell-lint, outbound MCP, and Polars dataframe interop (dataframe) likewise remain explicit. CSV check output remains part of analysis. This keeps unrelated native dependencies out of the default, analysis-only, and portable graphs.
For the portable data model without host services, use acorn-schema. For a small native integration that does not need analysis, use acorn-cmd and selected acorn-host features directly; acorn-lib does not re-export their APIs.
Darwin development size gate
The workspace optimizes third-party dependencies at level 2 and acorn-lib at level 1 in development and test profiles. This keeps workspace code debuggable while limiting exception metadata from the native dependency graph. Run make check-macos-unwind on Apple Silicon to build the default CLI and its unit-test harness, compare size -m with otool -l, reject the Apple compact-unwind warning, and enforce a 14,680,064-byte __eh_frame limit.
The original debug CLI baseline was approximately 317 MiB with a 21,230,536-byte __eh_frame. On Rust 1.98.1, Cargo 1.98.1, Apple ld 27037.1, and arm64, the accepted incremental measurement is:
| Artifact | __text | __gcc_except_tab | __unwind_info | __eh_frame | File size |
|---|---|---|---|---|---|
| Debug CLI | 66,268,708 | 3,909,640 | 1,970,944 | 10,451,952 | 170,009,176 |
| CLI unit-test harness | 57,944,340 | 3,259,516 | 1,687,880 | 9,026,412 | 147,983,464 |
That run took 54 seconds for the CLI and 5 seconds for the test harness after the feature graph and test dependencies were already built. The gate writes its complete machine-readable summary and raw section reports under target/macos-unwind/.
Immutable updates
The acorn::With derive adds consuming with_* methods for immutable post-construction updates. Use builders for initial construction and with_* methods when deriving a changed value from an existing one:
#![allow(unused)]
fn main() {
use acorn::With;
#[derive(Clone, With)]
struct ExportOptions {
format: String,
#[with(public, some)]
label: Option<String>,
#[with(private)]
strict: bool,
}
let options = ExportOptions {
format: "json".to_string(),
label: None,
strict: false,
};
let strict_yaml = options.with_format("yaml").with_label("archive").with_strict(true);
assert_eq!(strict_yaml.format, "yaml");
assert_eq!(strict_yaml.label.as_deref(), Some("archive"));
assert!(strict_yaml.strict);
}
Generated methods use the structâs visibility unless a field specifies #[with(public)] or #[with(private)]. For a field written as Option<T>, #[with(some)] accepts an inner value and stores it as Some; owned values accept impl Into<T>, while references retain their exact type so dereference coercions still work. A some setter does not accept None or provide a separate clearing method. Combine some with a visibility option as shown above. Use #[with(skip)] when a field needs validation, coordinated updates, or another custom setter.
-
See the Cargo.toml for more details. â©
Export pipeline
ACORNâs HTML and PowerPoint export renderers share one immutable ResearchActivity projection and one replacement contract, so both artifact families stay semantically identical. Every OOXML mutation is fallible, parser-backed, staged, and fuzzed: an externally supplied template either produces a validated artifact or fails before a partial output is committed. Command usage lives in the acorn export CLI reference; this page covers the contract renderers implement.
Projection
ExportContext::project(&ResearchActivity) (in acorn-lib/src/io/export) builds the renderer-independent projection without touching media or rendering markup. It carries the contact, the identifier, the image_source, and the replacements plan. A non-draft activity without sections is a projection error, while sectionless drafts are accepted. ImageSource is either Authored(url), resolved by the host renderer, or DraftFallback, the embedded 1920 x 1280 placeholder used when no image was authored.
Replacement plan
acorn_core::util::interpolation defines the values renderers consume:
| Type | Meaning |
|---|---|
ReplacementValue::Scalar(String) | One raw text value |
ReplacementValue::List(Vec<String>) | Raw values in presentation order |
ReplacementValue::Absent | A known placeholder without content |
ReplacementPlan stores named values in a deterministic BTreeMap. Registered names cover titles, sections, contact, citation, aspect portability, notes, managers, programs, and partners; renderers own escaping so the plan stays markup-agnostic.
#![allow(unused)]
fn main() {
let rendered = plan.replace_scalars("<h1>{{ title }}</h1>");
}
Scalar substitution replaces contiguous {{ name }} placeholders with raw values, removes Absent placeholders, and leaves unknown names and list placeholders intact for the renderer to handle.
Fallible OOXML transforms
The PowerPoint layer (acorn-lib/src/io/powerpoint) rewrites template parts as quick_xml events instead of string interpolation:
interpolate_xmlis paragraph-scoped, joins placeholders split across multiplea:truns, fans a list placeholder out one paragraph per item, and rejects paragraphs that name two different lists.add_slide_to_presentation_xmlappends an<p:sldId>entry and validates thep:sldIdLstend event, so unmatched tags error instead of returning malformed slides.update_relationship_targetrewrites targets through the parsed relationship model and rejects an absent current target.ensure_png_content_typedeclares PNG media in[Content_Types].xmland is idempotent.replace_aspect_placeholders_with_pictureswaps each{{ aspect }}shape for an ASPECT rose-chart picture at the same bounds and preserves unrelated shapes.validate_xml_well_formedrevalidates every successful transform output.
Each function is a total Result with part-qualified errors citing the failed file.
Staged publication
The acorn export --format powerpoint handler in acorn-cli extracts the reference template (a sibling reference.pptx by default, -r to override) into a private staging tree, then applies slide, media, relationship, content-type, and ASPECT chart mutations. New media is materialized under ppt/media/ from the same contextâs image choice, and an authored but unreadable image is a hard error before publication. Every staged part is revalidated (validate_ooxml_files) before the finished package replaces the destination, leaving the previous output intact when a late media failure occurs.
Fuzzing
fuzz/fuzz_targets/powerpoint.rs drives every transform with structured and raw input under cargo-fuzz, capped at 64 KiB per input. Run make fuzz FUZZ_TARGET=powerpoint, make fuzz-repro FUZZ_TARGET=powerpoint FUZZ_CRASH=path, or make fuzz-smoke for a bounded smoke pass over all targets. Between runs it asserts the invariants renderers rely on: successful mutations stay well formed, unrelated events and attributes are preserved, requested replacements are applied and removed, and the content-type transform is idempotent. tests/fixtures/export/reproducible.json is the deterministic end-to-end fixture whose generated presentations import without repair in LibreOffice, Chrome, and macOS QuickLook.
Protobuf and gRPC
acorn-server exposes the canonical acorn-service operations through an explicit Protobuf contract. The unversioned acorn.service.AcornService contains only three typed RPCs:
ValidateResearchActivityCheckReadabilityProcessRepository
There is no generic JSON-value invocation envelope, batch RPC, notification RPC, or version RPC. acorn.version remains informational package metadata in JSON-RPC and MCP only.
The committed contract is crates/acorn-server/proto/acorn/service/service.proto. Cargo generates Rust client and server bindings during the build. acorn_server::grpc::GrpcClient wraps those bindings with canonical acorn-service request and response types, bearer metadata, deadlines, endpoint policy, and message bounds. acorn_server::client::JsonRpcClient provides the equivalent typed calls plus generic calls, notifications, and ordered mixed batches.
Run the server
Set a dedicated bearer token and start both loopback listeners:
export ACORN_SERVICE_TOKEN='replace-with-a-secret'
cargo run -p acorn-server
JSON-RPC listens on 127.0.0.1:8001; gRPC listens on 127.0.0.1:50051. Either listener can be disabled explicitly. Bind, message-size, timeout, shutdown, mutation, and TLS settings use CLI-over-environment-over-default precedence; see acorn-server --help.
Application calls require authorization: Bearer âŠ. Non-loopback listeners require a certificate and private key. The default request/message and output limit is 1 MiB, and the default application timeout and shutdown grace are 30 seconds.
Protobuf checks
make protolint
cargo test -p acorn-server
Buf keeps normal field, enum, RPC message, and breaking checks. The configuration narrowly permits the intentionally unversioned package and AcornService name because this pre-release contract does not introduce protocol negotiation or a version namespace.
MCP client
The non-default mcp-client feature lets acorn-lib initialize configured MCP servers, discover approved tools, and invoke them through child-process or Streamable HTTP transports. The ACORN CLI enables this feature for acorn mcp.
cargo add acorn-lib --no-default-features --features mcp-client
cargo add serde_json
Application configuration owns every server transport, environment-variable reference, tool allowlist, declared effect, timeout, and output limit. The top-level mcp map names servers, each serverâs allowed map names tools, timeout is measured in seconds, and max_output uses a unit-bearing memory value such as 256KB. Callers select only a configured server alias, tool name, and JSON-object arguments.
An MCP-only build exposes the mcp projection of ApplicationConfiguration at the same path and ignores unrelated top-level fields while deserializing. Enabling analysis exposes the complete application configuration without changing the client constructor.
#![allow(unused)]
fn main() {
use acorn::error::ApiResult;
use acorn::io::api::operation::InvocationContext;
use acorn::io::config::ApplicationConfiguration;
use acorn::io::mcp::client::McpClient;
use serde_json::json;
async fn call_from_application(configuration: &ApplicationConfiguration) -> ApiResult<()> {
let client = McpClient::try_from(configuration)?;
let result = client
.call_tool(
"research-tools",
"resolve_identifier",
json!({"identifier": "https://doi.org/10.1000/example"}),
&InvocationContext::default(),
)
.await?;
if result.is_error == Some(true) {
// The MCP exchange succeeded and the remote tool reported an error.
}
Ok(())
}
}
Embedders that already own server configuration do not need to construct an ApplicationConfiguration. The client also accepts a borrowed BTreeMap<String, McpServerConfiguration> directly:
#![allow(unused)]
fn main() {
use acorn::error::ApiResult;
use acorn::io::mcp::client::McpClient;
use acorn::io::mcp::config::McpServerConfiguration;
use std::collections::BTreeMap;
fn direct_client() -> ApiResult<McpClient> {
let servers: BTreeMap<String, McpServerConfiguration> =
serde_json::from_value(serde_json::json!({
"research-tools": {
"allowed": {
"resolve_identifier": {
"effects": ["network-read"],
"max_output": "256KB",
"timeout": 30
}
},
"transport": {
"type": "streamable-http",
"url": "https://research.example.org/mcp"
}
}
}))?;
McpClient::try_from(&servers)
}
}
McpClientBackend is the static-dispatch contract for applications that accept the concrete client or another backend without a trait object. Its associated types preserve each backendâs context, tool, result, error, cancellation, and future types:
#![allow(unused)]
fn main() {
use acorn::io::mcp::client::McpClientBackend;
async fn discover<B>(
backend: &B,
server: &str,
context: &B::Context,
) -> Result<Vec<B::Tool>, B::Error>
where
B: McpClientBackend,
{
backend.list_tools(server, context, None).await
}
}
The inherent methods omit cancellation by default. To stop an operation when a caller-owned future resolves, use list_tools_with_cancellation or call_tool_with_cancellation:
#![allow(unused)]
fn main() {
use acorn::error::ApiResult;
use acorn::io::api::operation::InvocationContext;
use acorn::io::mcp::client::McpClient;
use core::future::Future;
async fn cancellable_call(
client: &McpClient,
cancelled: impl Future<Output = ()> + Send,
) -> ApiResult<()> {
let result = client
.call_tool_with_cancellation(
"research-tools",
"resolve_identifier",
serde_json::json!({"identifier": "https://doi.org/10.1000/example"}),
&InvocationContext::default(),
cancelled,
)
.await?;
if result.is_error == Some(true) {
// The MCP exchange succeeded and the remote tool reported an error.
}
Ok(())
}
}
Cancellation covers initialization, discovery, and tool calls. Before the future resolves, the client bounds protocol shutdown and reaps a child-process transport, killing it if graceful exit does not finish in time. Streamable HTTP requests are dropped during the same bounded cleanup path, and the immutable client remains reusable for later operations.
list_tools returns only tools that are configured, currently advertised, and authorized by the supplied invocation context. call_tool preserves the complete typed rmcp::model::CallToolResult; a tool-level isError value remains a successful MCP exchange and is not converted into a transport error. Inspect CallToolResult.is_error separately from handling the outer Result.
The client and ACORNâs JSON-RPC operation registry share the same transport-neutral effects policy. Credentials and process effects are unavailable; inference requires explicit inference authorization; mutations require mutation authorization; and network reads are denied offline. Streamable HTTP itself is unavailable offline. The effective result limit is the smaller of the tool configuration and caller context limits.
Sessions are intentionally one operation long. Initialization, paginated catalog discovery, requests, cancellation, output bounds, and shutdown all have fixed limits. Configuration stores environment-variable names, never resolved bearer tokens or child values. Child processes run without a shell or inherited environment, and remote HTTP requires TLS except on loopback.
The client is not a general MCP proxy. Register an ACORN operation handler explicitly when an application should call a remote tool; enabling mcp-client does not add remote tools to any inbound catalog or transport.
Rhai Exec
Constrained Rhai extensions and capability-brokered local workflow hooks for ACORN.
ABI
- Header:
// @acorn-exec-v0.2.0must be the first non-empty line and occur once. - Entry:
fn evaluate(context)with exactly one parameter. - Engine:
Engine::new_raw(),eval/imports disabled, bounded operations and wall time, fresh scope and capability broker per invocation.
Local automation
acorn exec automation is a separate, local-only runner for repository-maintained scripts. It is not a workflow hook: it does not use the hook ABI, manifests, deployment authorization, or capability broker. Its run(program, arguments) function executes a command with an explicit argv list, so only run reviewed scripts from a trusted checkout.
Build with exec, then run the Rhai counterparts without changing the existing shell or PowerShell CI entry points:
cargo run -p acorn-cli --features exec -- exec automation scripts/check-host-dependencies.rhai
cargo run -p acorn-cli --features exec -- exec automation scripts/check-portable-dependencies.rhai
cargo run -p acorn-cli --features exec -- exec automation scripts/needle/create-oci-artifact.rhai ./needle3 registry.example.org/research/needle:modelkit
The local runner provides explicit helpers for command execution, file reads and writes, copying, SHA-256 and size calculation, JSON serialization, platform detection, and selected environment variables. It remains unavailable unless the exec feature is enabled.
Result
#{ findings: [ #{ rule_id: "my-rule", severity: "error", message: "msg", locator: "optional" } ] }
Extensions return the shared, validated analyzer Finding type in an ExecutionResult<T> envelope. The ABI version matches the ACORN package version. check, validate, and link hooks cannot return a document. A manifest-authorized format or enrich hook may return a structured document proposal:
context.proposed.title = "Normalized title";
#{ findings: [], output: #{ document: context.proposed } }
The host deserializes this proposal into the workflowâs concrete document type and runs its validators before applying anything.
Complete example
This capability-free quality gate rejects research activities that are still marked as drafts. Save the script as .acorn/draft-policy.rhai:
// @acorn-exec-v0.2.0
fn evaluate(context) {
if context.input.meta.draft {
#{ findings: [#{
rule_id: "draft-project",
severity: "warning",
message: "Project metadata is still marked as draft",
locator: "meta.draft"
}] }
} else {
#{ findings: [] }
}
}
Register it in .acorn.json:
{
"scripts": [
{ "id": "draft-policy", "path": "draft-policy", "hooks": ["check"] }
]
}
Run the configured check against a research activity:
acorn check ./activity.json --config ./.acorn.json
An activity with meta.draft set to true produces the draft-project finding at meta.draft; setting it to false passes this gate. Because this script only inspects the structured input and returns findings, it needs no manifest or capabilities.
Configuration
Top-level scripts in .acorn.json:
{
"scripts": [
{ "id": "project-quality", "path": "project-quality", "hooks": ["check", "format"] },
{ "path": "/opt/acorn/shared.rhai", "absolute": true, "hooks": ["check"] }
]
}
Relative paths anchored to <project-root>/.acorn/, .rhai suffix optional, no glob or parent traversal, exactly one file must exist.
Absolute paths require absolute: true, are local-only, and emit security warnings with canonical path and digest.
Script manifests
scriptManifest accepts either a deployment-manifest path or a manifest object directly. A path is a safe relative name beneath the platform ACORN configuration directoryâs manifests/ directory:
{
"scriptManifest": "research-hooks.json",
"scripts": [
{ "id": "project-quality", "path": "project-quality", "hooks": ["check", "format"] }
]
}
The deployment file contains one digest-pinned authorization per script:
{
"version": "1.0.0",
"scripts": [
{
"id": "project-quality",
"version": "0.2.0",
"entry": "evaluate",
"digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"hooks": ["check", "format"],
"capabilities": {
"mutation": true,
"read": {
"roots": { "project": "/srv/research" },
"maxBytes": 1048576,
"maxFiles": 16
},
"write": {
"roots": { "output": "/srv/research/generated" },
"maxBytes": 1048576,
"maxFiles": 16
},
"network": {
"hosts": ["api.example.org"],
"maxRequests": 2,
"maxResponseBytes": 65536,
"timeout": 5000
}
},
"limits": {
"maxCalls": 32,
"maxOperations": 500000,
"maxRuntime": 10000
}
}
]
}
The same object may be placed directly in application configuration:
{
"scriptManifest": {
"version": "1.0.0",
"scripts": [
{
"id": "project-quality",
"version": "0.2.0",
"digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"hooks": ["check"],
"capabilities": {}
}
]
},
"scripts": [
{ "id": "project-quality", "path": "project-quality", "hooks": ["check"] }
]
}
An inline manifest that grants any effect is trusted only when the application configuration was explicitly selected with --config. Configuration discovery can still enable capability-free quality gates, but cannot establish effectful trust. Deployment paths are canonicalized beneath the manifest directory and group/world-writable manifests are rejected on Unix.
Capabilities
Only declared host functions are registered:
exists(root, path)andread_text(root, path)use named read roots.write_text(root, path, content)creates a host-owned file proposal beneath a named write root; it never writes during script evaluation and is unavailable tocheckandvalidatehooks.http_get(url)accepts exact allowlisted HTTPS authorities. Offline mode, credentials, fragments, redirects, private/local/link-local destinations, oversized responses, excessive requests, and timeouts are rejected.
Paths must be relative and traversal-free. Root handles are opened for each invocation, destination ancestors and targets cannot be symlinks, and aggregate file, byte, call, operation, request, and runtime limits cannot exceed host ceilings. Process execution, credentials, and inference are not grantable.
Build with the exec feature and pass configuration explicitly when needed:
acorn check ./metadata --config ./.acorn.json
acorn format ./metadata --config ./.acorn.json
acorn format ./metadata --enrich --config ./.acorn.json
acorn link ./metadata --config ./.acorn.json
Configured execution is local-CLI only. TUI, repository snapshots, JSON-RPC, MCP, webhooks, and GitLab automation cannot run project scripts. Absolute scripts are an explicitly warned, non-portable local trust exception.
Every matching script is opened into one bounded snapshot, identified by digest, and compiled before the first evaluation. The context contains hook, path, index, input, and proposed; input and proposed are independent structured copies without host handles. Error findings or execution failures prevent planned writes, while lower-severity findings use analyzer rendering.
check gates join native findings. A validate hook runs as part of acorn check when schema checks are enabled and is omitted by --skip schema. format and optional enrich gates run after the complete proposal is prepared. link gates evaluate every planned companion artifact before any artifact is written.
Hook order, document order, and configured script order are deterministic. All source, linked-document, and script-proposed file changes are staged and synced before commit; a later commit failure restores earlier files. Audit records contain script ID and digest, hook, input identity, manifest provenance, granted and used effects, duration, and proposal digests without file or network contents.
Inference
MimeType::infer checks binary signatures first, then performs a bounded Rhai probe for UTF-8 source with the ABI marker and one evaluate(context) entry point. Path-based inference continues to recognize an explicit .rhai extension. Inference never executes source.
Help
Run acorn exec --help and acorn exec <COMMAND> --help for current usage information.
acorn exec manifest check ./research-hooks.json
acorn exec hook check ./project-quality.rhai --manifest ./research-hooks.json --hook format --input ./activity.json
The hook check command evaluates and reports proposals without applying them. A manifest argument that is not an existing file is resolved as a deployment-manifest name.
đ Python bindings
acorn-py is an independently maintained companion project that provides Python bindings for ACORNâs published Rust libraries.
The Python package has its own source, issue tracker, documentation, CI, release process, and version lifecycle. Its version does not need to match the version of this ACORN workspace.
Report Python binding and packaging issues in the standalone acorn-py issue tracker. Report issues in the underlying Rust APIs in the ACORN issue tracker.
WebAssembly development
The acorn-wasm crate exposes ACORNâs portable validation, Big-O comparison, identifier, diff, FAIR, crosswalk, and readability APIs to JavaScript. It operates entirely on supplied in-memory values and does not use filesystems, processes, databases, or networks.
Installation
Install the Rust toolchain and add the WASM target:
rustup target add wasm32-unknown-unknown
Install wasm-pack, clone the ACORN repository, then build and test the package from its root:
cargo install wasm-pack --locked
make build-wasm
The generated web package is written to target/acorn-wasm/pkg. A runnable WebMCP demo is staged in target/acorn-wasm/webmcp. Maintainers can check the complete native and WASM portability matrix, generated package, JavaScript-facing tests, and host-dependency deny policy with:
make check-portable
The lower-level compile checks are:
cargo check -p acorn-analysis --no-default-features --features alloc --target wasm32-unknown-unknown
cargo check -p acorn-service --no-default-features --features alloc --target wasm32-unknown-unknown
cargo check -p acorn-wasm --target wasm32-unknown-unknown
Rust projects that compile to WASM can select the portable Rust surfaces directly:
cargo add acorn-analysis --no-default-features --features alloc
cargo add acorn-service --no-default-features --features alloc
JavaScript API
Import the generated web module and initialize it before calling the bindings:
import init, {
assessFairMetadata,
checkReadability,
compareBigO,
compareBigOList,
crosswalkMetadata,
crosswalkMetadataAs,
diffContent,
discoverPersistentIdentifiers,
inspectPersistentIdentifier,
validateBigOList,
validateMetadataStandard,
validateResearchActivity,
} from "./target/acorn-wasm/pkg/acorn.js";
await init();
const validation = validateResearchActivity(JSON.stringify(researchActivity));
const standard = validateMetadataStandard("A plain document.", "text", "text");
const identifiers = discoverPersistentIdentifiers("See DOI 10.1000/182 and RRID:SCR_003512.");
const identifier = inspectPersistentIdentifier("https://doi.org/10.1000/182");
const difference = diffContent('{"title":"Before"}', '{"title":"After"}', "json-patch");
const fair = assessFairMetadata('{"title":"Example","doi":"10.1000/182"}', "datacite", "memory://example");
const readability = checkReadability("Supplied text to assess.", "fkgl");
const comparison = compareBigO({ left: "O(n^2)", right: "O(n log n)" });
const comparisons = compareBigOList([{ left: "O(n^2)", right: "O(n log n)" }]);
const bounds = validateBigOList(["O(n log n)", "O(n - m)"]);
validateResearchActivity returns { valid, value, diagnostics }. Parse and validation diagnostics retain their original order and include their kind, path, message, and validation details when available.
compareBigO takes one object with left, right, and optional assumptions. It returns the original expressions, dominance, and the effective assumptions map. Ordinary symbols default to growing, named logarithm bases to fixed-log-base, and explicit assumptions override those defaults. left and right mean strictly faster growth on that side; equivalent, incomparable, and undetermined are valid results. validateBigOList and compareBigOList accept up to 64 ordered items. The former collects expression-validation results; the latter preserves pair order and identifies the first malformed pair by index. Each expression is limited to 256 ASCII bytes and a comparison accepts at most 64 explicit assumptions.
inspectPersistentIdentifier classifies, validates, and normalizes one supplied ARK, arXiv, DOI, Handle, ISBN, ISNI, ORCID, patent, RAiD, ROR, RRID, or SWHID. Supply the optional second argument to validate against a specific lowercase kind. Without it, a bare value valid as both an ISNI and ORCID returns an ambiguous result with both candidates rather than guessing.
discoverPersistentIdentifiers finds the same supported identifier kinds in supplied text, excludes generic URLs, normalizes and deduplicates the results, and returns at most 100 entries with a total count and truncation flag.
validateMetadataStandard accepts content, a standard, and a format. Portable standards are Citation File Format, CKAN, DataCite, Dublin Core, document text, InvenioRDM, Kitfile, ModelKit, RAiD, Research Activity Data, and plain text. Formats are cff, json, jsonc, json-ld, markdown, rdf-xml, text, turtle, yaml, and zon; each standard still rejects formats its codec does not support. Dublin Core accepts native graph JSON or YAML, JSON-LD, RDF/XML, and Turtle.
diffContent returns either a three-line-context unified text diff or a deterministic RFC 6902 JSON Patch. JSON Patch mode requires valid JSON on both sides.
assessFairMetadata evaluates JSON metadata against all 41 RDA FAIR Data Maturity Model indicators and returns the ordered findings plus per-principle and total counts. It uses only evidence present in the supplied value and does not resolve evidence URIs.
crosswalkMetadata returns pretty JSON plus loss warnings for portable typed conversions between RAD, DataCite, RAiD, and Dublin Core. The supported Dublin Core paths are RAD â Dublin Core, DataCite â Dublin Core, Dublin Core â RAD, and Dublin Core syntax-to-syntax conversion. Dublin Core and RAiD imports into RAD require a caller-supplied ContactPoint JSON seed because those standards cannot represent all required local contact data; both accept an optional local identifier.
Use crosswalkMetadataAs(content, inputFormat, source, target, outputFormat, contact?, localIdentifier?) when the Dublin Core target should be json, json-ld, rdf-xml, turtle, or yaml. Other browser crosswalk targets currently require JSON output.
checkReadability accepts the canonical metrics ari, cli, fkgl, fres, gfi, lix, and smog. It returns the ordered checks and the category summary produced from those checks. An optional URI may be supplied as the third argument.
WebMCP browser tools
The generated package includes an opt-in adapter for the experimental browser WebMCP API. Importing it has no side effects: the application must initialize WASM, create the adapter with the generated bindings, and explicitly install its tools.
import init, {
assessFairMetadata,
checkReadability,
compareBigO,
crosswalkMetadata,
diffContent,
discoverPersistentIdentifiers,
inspectPersistentIdentifier,
validateMetadataStandard,
validateResearchActivity,
} from "./pkg/acorn.js";
import { createAcornWebMcpAdapter } from "./pkg/webmcp.js";
await init();
const adapter = createAcornWebMcpAdapter({
assessFairMetadata,
checkReadability,
compareBigO,
crosswalkMetadata,
diffContent,
discoverPersistentIdentifiers,
inspectPersistentIdentifier,
validateMetadataStandard,
validateResearchActivity,
});
const installation = adapter.install(document.modelContext);
console.log(await installation.ready);
// Call installation.dispose() when the page no longer provides the tools.
The adapter registers nine read-only tools:
| Tool | Input | Result |
|---|---|---|
acorn_assess_fair_metadata | { json: string, standard: MetadataStandard, resource?: string } | All 41 ordered RDA FAIR findings plus profile counts |
acorn_check_readability | `{ text: string, metric: âariâ | âcliâ |
acorn_compare_big_o | { left: string, right: string, assumptions?: Record<string, SymbolGrowth> } | Dominance and effective assumptions for two Big-O expressions |
acorn_crosswalk_metadata | { content, format, source, target, contact?, localIdentifier? } | Pretty JSON target content and typed data-loss warnings for supported RAD, DataCite, RAiD, and Dublin Core conversions |
acorn_diff_content | `{ before: string, after: string, mode: âjson-patchâ | âunifiedâ }` |
acorn_discover_persistent_identifiers | { text: string } | Up to 100 normalized, deduplicated supported identifiers plus count and truncation state |
acorn_inspect_persistent_identifier | `{ value: string, kind?: âarkâ | âarxivâ |
acorn_validate_metadata_standard | { content: string, format: MetadataFormat, standard: MetadataStandard } | Validity plus ordered diagnostics for eleven portable standards |
acorn_validate_research_activity | { json: string } | Validity plus ordered diagnostics; parsed research data is never echoed |
All schemas reject unknown fields. The adapter limits JSON and metadata documents to 256 KiB, each Big-O expression and assumption name to 256 UTF-8 bytes, each Big-O comparison to 64 assumptions, each diff side to 128 KiB, prose and discovery text to 16 KiB, identifier and resource labels to 2 KiB, output to 256 KiB, discovered identifiers to 100, and returned diagnostics to the first 100. It permits only one active invocation per adapter and returns structured, bounded errors for invalid input, cancellation, contention, or execution failures. ACORN runs all operations locally. Identifier operations and FAIR assessment do not resolve or fetch metadata. The adapter makes no network requests and does not persist supplied content, but a browser agent may send tool inputs and outputs to its configured model provider.
Cancellation is checked before and after each operation. The current WASM bindings are synchronous, so cancellation cannot interrupt a calculation already running on the browserâs main thread. On Chrome 156.0.8078.80 on macOS on 2026-11-09, the nine-tool native smoke recorded maximum warm times of 15.50 ms across 20 identifier calls at 2 KiB, 3.50 ms across 20 validation calls at 256 KiB, and 12.10 ms across 20 readability calls at 16 KiB.
WebMCP is experimental and browser support is limited. In Chrome, enable the WebMCP testing flag before opening the demo. Unsupported browsers can still use all nine tabbed manual controls.
| Browser | Configuration | Verified behavior |
|---|---|---|
| Chrome 154.0.8037.98 on macOS | chrome://flags/#enable-webmcp-testing enabled | Passed native registration, discovery, schema and annotation inspection, execution, cancellation, manual parity, Permissions Policy denial, bounds, timing, and cleanup on 2026-10-08 |
| Chrome 156.0.8078.80 on macOS | chrome://flags/#enable-webmcp-testing enabled | Nine-tool native smoke passed registration, discovery, schemas, annotations, execution, serialization, manual parity, Permissions Policy denial, bounds, timing, and cleanup on 2026-11-09 |
Chrome without the testing flag and browsers without document.modelContext | None | Manual WASM controls remain available; no tools are registered |
Chrome 154 exposes discovered schemas as serialized JSON and requires JSON-string arguments for in-page executeTool() calls. The smoke supports that implementation as well as the object arguments used by Chrome 155 and the current draft. This compatibility handling is only needed by in-page agents and tests; tool registration and browser-agent invocation use the adapterâs normal structured inputs. The tools Permissions Policy defaults to same-origin access, and the adapter does not opt into cross-origin exposure.
Build and serve the demo from the repository root:
make build-wasm
python3 -m http.server 8000 --directory target/acorn-wasm
Then open http://localhost:8000/webmcp/. Add ?smoke to run the native browser smoke checks. No model credentials are required. Call installation.dispose() when the page no longer owns the registered tools.
Portable Rust functionality
The WASM build exposes Rust APIs that operate on supplied in-memory values. It currently includes:
| Capability | Available functionality |
|---|---|
| Research metadata | ResearchActivity and its supporting metadata, section, linked-data, and media types |
| Metadata standards | Serde-compatible CFF, DataCite, DCAT, Dublin Core, Huwise, Invenio, and text models; Dublin Core graph codecs for JSON-LD, RDF/XML, and Turtle; in-memory schema crosswalk contracts and conversions |
| Persistent identifiers | ARK, arXiv, DOI, Handle, ISBN, ISNI, ORCID, patent, RAiD, ROR, RRID, and SWHID parsing, recognition, normalization, component access, and checksum validation where the identifier defines one |
| Validation | Research schema validation plus helpers for identifiers, dates and timestamps, URLs, semantic versions, geographic coordinates and polygons, language and country codes, phone numbers, and media extensions |
| Big-O analysis | Bounded notation parsing, complete-RAD complexity validation, and pairwise comparison under inferred or explicit growth assumptions |
| Hardware metadata | Architecture, accelerator, processor, memory, sensor, topology, vendor, and computing-resource models |
| Portable domain APIs | Location, Repository, Scheme, Release, AcornError, and AcornResult |
| Portable utilities | MIME and file-extension detection, ZON encoding/decoding, Crockford Base32, constant-time byte comparison, glob matching, regex-to-glob conversion, frontmatter splitting, semantic versions, byte formatting, and string normalization |
| Reference data | Compile-time vocabularies used by portable schema and validation code |
| Analyzer kernel | Check, error, Vale output, readability, and scoring models plus calculations over supplied text through the separate analyzer feature |
Schema types implement their normal Serde, JSON Schema, and validation traits in this configuration. Callers provide the strings, bytes, or already-deserialized values; ACORN does not fetch or read them in the WASM build.
For example, a Rust component compiled to WASM can use ACORNâs identifier validation directly:
#![allow(unused)]
fn main() {
use acorn_schema::validation::rules::{arxiv, doi, isni, orcid, ror};
assert!(doi("10.11578/dc.20250604.1").is_ok());
assert!(arxiv("arXiv:2106.09685").is_ok());
assert!(isni("https://isni.org/isni/0000000492299539").is_ok());
assert!(orcid("https://orcid.org/0000-0002-2057-9115").is_ok());
assert!(ror("https://ror.org/01qz5mb56").is_ok());
}
Boundaries
The current wasm feature selects allocation-capable APIs without enabling ACORNâs native filesystem, process, terminal presentation, database, or network services. The separate analyzer feature adds only the portable analyzer kernel. CI compiles both paths and rejects host-only dependencies from the analyzer graph.
The package does not provide:
- browser HTTP or storage adapters
- native file or URL reads and writes
- analyzer host execution, document conversion, database, process, download, or doctor services
- std-only agent definitions and embedded agent assets
Portable crates remain independent of browser-specific dependencies; the WebMCP adapter and browser demo live only in acorn-wasm.
macOS sandbox warnings
Restricted macOS environments may report that xcrun could not create a cache file while locating MacOSX.sdk. This is a host toolchain warning rather than a WASM compilation failure. If Cargo prints Finished and the command exits successfully, the portability check passed.
MCP Bundles
ACORN packages its local stdio Model Context Protocol server as a target-specific .mcpb archive. The bundle contains manifest.json and one server/acorn or server/acorn.exe executable. The manifest follows MCPB 0.3, pinned to upstream revision 70fe3b34cd6dff1b3bba046638edc72a6467a4fb, and declares the same safe online read-only tools as acorn serve mcp.
Create a local bundle with acorn create mcp. Use --binary and --platform darwin|linux|win32 for a release or cross-compiled executable. --dry-run prints the manifest, inventory, and destination without writing. --kitfile ./Kitfile creates the bundle first and then idempotently upserts an authoring mcpServers entry named acorn using a relative path; resolved OCI layer identity is never written to authoring YAML.
Direct clients can run acorn serve mcp or use acorn sync --mcp. Synchronization configures the absolute executable path and does not install a bundle. A client that supports MCPB installation owns extraction and approval.
The default server is read-only. Global --offline removes tools that may contact external systems. Persistent mutation requires serve mcp --allow-mutation and an enabled local database. Bundles do not execute during creation, inspection, ModelKit packaging, or download; inspect their source and SHA-256 before installation.
Big-O agent workflow
Call acorn.validate_research_activity_data with a complete Research Activity object as its activity argument. The compatibility name acorn.check_research_activity_data has the same contract. A valid document returns { "valid": true, "errors": [] }; invalid time or space complexity metadata returns { "valid": false, "errors": [...] } as a successful validation result. Repair every Big-O syntax or variable finding at its reported aspect.computation path before comparing expressions. An incomplete activity object or malformed tool argument is a tool error.
Then call the read-only acorn.compare_big_o tool with two expressions from the validated document:
{
"left": "O(n^2)",
"right": "O(n log n)",
"assumptions": { "n": "growing" }
}
The result contains the original left and right, "dominance": "left", and the effective assumptions map. left and right mean strictly faster growth on that side; equivalent, incomparable, and undetermined are successful analytical outcomes. Ordinary symbols default to growing, named logarithm bases default to fixed-log-base, and explicit assumptions override those defaults. Accepted values are growing, fixed-positive, fixed-log-base, and shrinking-positive. Invalid notation, unknown assumption names, or more than 64 assumptions are request errors. ACORN checks notation and relative growth under those assumptions; it does not establish that an authorâs bound describes the algorithm.
Official release bundles target x86_64-unknown-linux-musl and x86_64-pc-windows-gnu, each with a SHA-256 sidecar and validation by @anthropic-ai/mcpb@2.1.2. Local macOS packaging is possible only by supplying a supported target binary contract; ACORN does not publish or claim a signed macOS MCPB release.
Citations
A selection of academic papers and resources that have influenced the development of ACORN
[1] E. Njor, M. A. Hasanpour, J. Madsen, and X. Fafoutis, âA Holistic Review of the TinyML Stack for Predictive Maintenance,â IEEE Access, vol. 12, pp. 184861-184882, 2024, doi: 10.1109/ACCESS.2024.3512860.
[2] Y. Yang et al., âA Survey of AI Agent Protocols,â Apr. 26, 2025, arXiv: arXiv:2504.16736. doi: 10.48550/arXiv.2504.16736.
[3] B. Liu et al., âAdvances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systems,â Mar. 31, 2025, arXiv: arXiv:2504.01990. doi: 10.48550/arXiv.2504.01990.
[4] âAI Blindspot: A Discovery Process for preventing, detecting, and mitigating bias in AI systems.â Accessed: Jan. 24, 2023. [Online]. Available: https://aiblindspot.media.mit.edu/
[5] V. Gadepally et al., âAI Enabling Technologies: A Survey,â May 08, 2019, arXiv: arXiv:1905.03592. doi: 10.48550/arXiv.1905.03592.
[6] A. Jain, S. Sharma, and S. Duggal, âComparative Study of Various Process Model in Software Development,â 2013. Accessed: Jan. 24, 2023. [Online]. Available: semanticscholar.org
[7] Q. Hua et al., âContext Engineering 2.0: The Context of Context Engineering,â Oct. 30, 2025, arXiv: arXiv:2510.26493. doi: 10.48550/arXiv.2510.26493.
[8] N. D. Lawrence, âData Readiness Levels,â May 05, 2017, arXiv: arXiv:1705.02245. doi: 10.48550/arXiv.1705.02245.
[9] A. Fuller, Z. Fan, C. Day, and C. Barlow, âDigital Twin: Enabling Technologies, Challenges and Open Research,â IEEE Access, vol. 8, pp. 108952-108971, 2020, doi: 10.1109/ACCESS.2020.2998358.
[10] J. Gou, B. Yu, S. J. Maybank, and D. Tao, âKnowledge Distillation: A Survey,â Int J Comput Vis, vol. 129, no. 6, pp. 1789-1819, June 2021, doi: 10.1007/s11263-021-01453-z.
[11] D. Kreuzberger, N. KĂŒhl, and S. Hirschl, âMachine Learning Operations (MLOps): Overview, Definition, and Architecture,â May 14, 2022, arXiv: arXiv:2205.02302. doi: 10.48550/arXiv.2205.02302.
[12] M. Mitchell et al., âModel Cards for Model Reporting,â in Proceedings of the Conference on Fairness, Accountability, and Transparency, Jan. 2019, pp. 220-229. doi: 10.1145/3287560.3287596.
[13] E. Blasch, J. Sung, and T. Nguyen, âMultisource AI Scorecard Table for System Evaluation,â Feb. 07, 2021, arXiv: arXiv:2102.03985. doi: 10.48550/arXiv.2102.03985.
[14] F. Yu, H. Zhang, and B. Wang, âNatural Language Reasoning, A Survey,â Mar. 26, 2023, arXiv: arXiv:2303.14725. doi: 10.48550/arXiv.2303.14725.
[15] S. Zhao, Y. Yang, Z. Wang, Z. He, L. K. Qiu, and L. Qiu, âRetrieval Augmented Generation (RAG) and Beyond: A Comprehensive Survey on How to Make your LLMs use External Data More Wisely,â Sept. 23, 2024, arXiv: arXiv:2409.14924. Accessed: Oct. 02, 2024. [Online]. Available: arxiv.org
[16] Y. K. Liu, S. K. Ong, and A. Y. C. Nee, âState-of-the-art survey on digital twin implementations,â Adv. Manuf., vol. 10, no. 1, pp. 1-23, Mar. 2022, doi: 10.1007/s40436-021-00375-w.
[17] Center for Security and Emerging Technology and B. Buchanan, âThe AI Triad and What It Means for National Security Strategy,â Center for Security and Emerging Technology, Aug. 2020. doi: 10.51593/20200021.
[18] J. M. Bradshaw, R. R. Hoffman, D. D. Woods, and M. Johnson, âThe Seven Deadly Myths of âAutonomous Systems,ââ IEEE Intelligent Systems, vol. 28, no. 3, pp. 54-61, May 2013, doi: 10.1109/MIS.2013.70.
[19] M. R. Endsley, âToward a Theory of Situation Awareness in Dynamic Systems. Human Factors Journal 37(1), 32-64,â ResearchGate, Aug. 2025, doi: 10.1518/001872095779049543.
[20] M. Kleppmann, A. Wiggins, P. van Hardenberg, and M. McGranaghan, âLocal-First Software: You Own Your Data, in spite of the Cloud,â in Proceedings of the 2019 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software, Oct. 2019, pp. 154-178. doi: 10.1145/3359591.3359737. [Online]. Available: inkandswitch.com/essay/local-first
[21] S. Ango, âFile over app,â July 01, 2023. Accessed: Aug. 18, 2026. [Online]. Available: stephango.com/file-over-app