agentic-os
Build persistent multi-agent systems without external databases, using file-based memory and scheduled tasks.
AFaffaan-m/ECC315k4,381 new stars in the last 7 days
Tradecraft, each account's library of knowledge sites: a page store the agent writes with raw SQL that every statement keys by owner and resource, a read path that never writes, page text that is always untrusted, site logins that reach only their own host and their owner's own runs, one catalog policy, model calls that carry their purpose and are never retried, and settings that live only in the generated spec. Trigger: editing agentic/tradecraft/, webapp/src/lib/tradecraft/, webapp/src/app/api/users/[id]/tradecraft-resources/ or tradecraft-settings/, webapp/src/app/api/projects/[id]/tradecraft/, webapp/src/app/api/internal/agent/tradecraft/, webapp/src/components/settings/tradecraft/ or TradecraftResourcesAccordion.tsx; adding a Tradecraft setting, table or column.
How the feature works is in docs/readmes/README.TRADECRAFT.md;
this skill holds only the rules a change must keep. Authorization of the routes themselves is the
rbac-authz skill; a new agent tool is agentic-tool-integration.
STATEMENTS in agentic/tradecraft/store.py,
library/search_sql.py, the conversion's own
STATEMENTS in convert.py and COVERAGE_SQL in
library/coverage.py. Each statement takes user_id
and the resource id (or the run catalog's resource ids), and reads entries, sections and the tree
joined to the resource row's live generation: no caller names a generation except the job writing
its own. A read by CVE id of a CVE archive's index (archive_entries in search_sql.py) is keyed
the same way and leaves out an entry the person blocked. A statement that cannot be keyed by one owner goes in its module's UNKEYED_STATEMENTS
with its reason (today store.py's install total and expired-lease scan, convert.py's
sweep_users); a new place for SQL is a new place every reviewer must know. On the webapp, a resource is read only by
its id and the path's account (loadOwnResource in
resourceAccess.ts). Failed before:
522b9f7e (an administrator read another account's page text and map), 85616179 (one search
read two generations across its statements).agentic/tradecraft/library/reader.py, read_now.py,
check_url.py and preview.py store nothing: Check URL imports neither the store nor a model builder, the preview
neither the store nor a database driver. There is no page cache, and the code-search test fails on its names
(tests/tradecraft_no_cache_names_test.sh). Failed
before: 1.x cached pages by URL in one volume for every account (removed in d0506809).wrap_untrusted in library/types.py),
and never let a model's answer through unchecked: the librarian's page IDs, excerpts and why lines
are checked in librarian/validate.py. Library
now's trusted lines and notices are fixed text: the steps it searches for (model- or person-written)
and its rows sit inside the envelope, with no page text (library/hints.py);
a reading tool's refusal, outside the envelope, names a page by its ID or a resource by its slug,
never a title, a heading or a URL (the URL follows in an envelope of its own, reader.with_url: a
site's link with spaces carries a sentence), and a CVE archive's refusal of a page ID names the ID
(library/reader.py). Failed
before: aab51561 (the librarian's plan prompt and why lines carried unchecked text), 1b0657be (a
target-planted CVE id in a hint's trusted lines), 18b7fdcb (Library now's step, with its hidden
characters, in the block's trusted header), 0c030034 (a read's refusal quoted a map title and a
page's headings outside the envelope).fetch.use_login and send it only as same_host_headers in
ingest/fetch.py; while one is bound, the browser is
refused. A login resource enters a run's catalog only when isOwnerRun holds
(catalog.ts), and its pages are read only within its
live map. A login is used and changed only through the act-as refusals of
actAs.ts, and no answer carries a secret value
(masking.ts). A URL moved to another host keeps its
login only when the person types it again (tradecraftLoginSecretReentry in
secretEndpointRebind.ts, from the patch's
"set" parts). Failed before: ce84a975 (a login read
accepted dropped entries as the map), 497c00da (a catalog asked with no person, and a login in the 1.x run payload),
a login that followed an edited URL to any host.fetch_raw of a page,
index or listing passes its max_bytes (a page's fetch.PAGE_MAX_BYTES, an index's
constants.sitemapMaxBytes), a truncated index is not parsed, and a parsed structure is walked
within the map limit, not its declared size. Failed before: a ~300-byte mkdocs.yml of YAML
aliases named a million nav entries (a billion in ~400 bytes) before _dedupe capped them, and a
CVE archive's file was read up to the 100 MB transport ceiling. Held by
test_tradecraft_ingest_builders.py and
test_tradecraft_cve_patterns.py.section_path reads only a page of the resource (_in_resource in
library/reader.py: its start page, its live map, its
1.x map); a run's token is _Read.token_for(url), which is fetch.repo_token (the same owner and
repository, no dot segment) and is None outside V2Catalog.owner_run; the catalog carries a
resource's override only in its owner's run (catalog.ts).
A new read path takes its token from token_for, never the raw value. Failed before: 1.x through
7.8.0 read any URL a section_path named, with the project owner's token, in every run on the
project. Held by test_tradecraft_read_scope.py.index_cve in ingest/builders.py makes no call
without the job's token (cve_index_needs_token; build_cve's repository and root calls, which
confirm the type, are made either way): an unauthenticated address gets 60 GitHub API
calls an hour, and an index takes about one per year folder. fetch.github_headers adds the token
only to https URLs on GitHub's hosts. Keep the listing bounded (one call per year folder and per
folder a pattern names before {year}, every listing answer, the root's included, within
CVE_LISTING_MAX_BYTES (constants.sitemapMaxBytes), at most
cve_index_cap() entries, the 20,000 map ceiling every type shares) and a blocked file never
requested, matched on the archive's own URL for it (library/cve.py).
Held by test_tradecraft_cve_index.py.overlay.offered_catalog()
(overlay.py); rules 6 and 7 come only from
hints.library_rule through with_step_naming_rule (prompts/base.py),
so a run without Library now reads as it does with no library; the block goes at the end of the
think call's one system message (hints.with_note), never in a second one, which a
single-system-message chat template answers with a 400 that ends the run. Held by
test_tradecraft_library_now_prompt.py.catalog.ts. The run catalog
and the chat's counter badge both read activeResourcesFor; a second rule anywhere else makes
them disagree. On the agent, a run reads its catalog only through runtime.bound_catalog(),
never get_setting, whose fallback outside the run's task is whichever project loaded last.lockOwnResource / lockOwnResourceGeneration first, the lock the
agent's swap takes. Failed before: 00530153 (a curation acted on a generation a refresh had just
replaced).tradecraft_ingest purpose and the librarian tradecraft_librarian, both built from the
owner's providers (models.py); an Agent in the Loop model is
refused before any request. A call the daily budget refuses fails the job so the previous version stays
live. Failed before: 97967db9 (a budget-cut refresh replaced a good map).node webapp/scripts/gen-tradecraft-spec.mjs copies it (and vocab.json) to the agent,
which clamps every value again (settings.py).
tests/tradecraft_no_new_env_test.sh fails on a new
key.onDelete: Cascade from the user and the resource (or project), an entry in DOWNGRADE_TABLES /
DOWNGRADE_COLUMNS of rbac-upgrade-preview.mjs,
and, when the agent reads or writes it, its names in
schema_columns.py. Failed before: three tables added
with no DOWNGRADE_TABLES entry left the upgrade-preview test red.net.py and time through clock.py. They are the package's only
boundaries (test_tradecraft_fetcher_contract.py
holds it), so every test can swap both.| Change | File |
|---|---|
| A pipeline stage | agentic/tradecraft/ingest/<stage>.py, wired in agentic/tradecraft/ingest/pipeline.py and contract.JOB_STAGES |
| A body crossing webapp ↔ agent | agentic/tradecraft/contract.py and webapp/src/lib/tradecraft/agentContract.ts, plus a fixture in agentic/tests/fixtures/tradecraft_contract/ |
| A page-store statement | STATEMENTS in agentic/tradecraft/store.py; a search one in agentic/tradecraft/library/search_sql.py |
| What a run may read | webapp/src/lib/tradecraft/catalog.ts |
| What a non-owner sees of a project's resources | webapp/src/lib/tradecraft/projectView.ts |
| Library now: its steps, its fit, its block and rule 6 | agentic/tradecraft/library/profile.py, agentic/tradecraft/library/hints.py; rule 7 is STEP_NAMING_RULE in agentic/prompts/base.py |
| A CVE archive's index | index_cve in agentic/tradecraft/ingest/builders.py; its refresh rules in agentic/tradecraft/ingest/pipeline.py; its reads in agentic/tradecraft/library/search.py and agentic/tradecraft/library/reader.py |
| A setting | webapp/src/lib/tradecraft/settingsSpec.json, then the generator |
node webapp/scripts/gen-tradecraft-spec.mjs --check # the agent's spec and vocabulary copies
./agentic/run_tests.sh tests/test_tradecraft_store.py # keyed statements; any agent file the same way
bash tests/tradecraft_no_cache_names_test.sh && bash tests/tradecraft_no_new_env_test.sh
TC_PG_DB=tc_mine tooling/scripts/tradecraft_pg_testdb.sh agent tests/test_tradecraft_store_integration.py
The Postgres files need the disposable database of tooling/scripts/tradecraft_pg_testdb.sh
(README.TESTING.md, "Tradecraft").
Build persistent multi-agent systems without external databases, using file-based memory and scheduled tasks.
AFaffaan-m/ECC315k4,381 new stars in the last 7 days
GAgarrytan/gstack143k598 new stars in the last 7 days
ADaddyosmani/agent-skills122k1,667 new stars in the last 7 days
THthedotmack/claude-mem121k1,626 new stars in the last 7 days
THthedotmack/claude-mem121k1,626 new stars in the last 7 days
THthedotmack/claude-mem121k1,626 new stars in the last 7 days