Download README.md from tailot/codex-python: direct link, hf CLI and curl.
- Browser
- Download file 39.6 kB
-
https://huggingface.co/datasets/tailot/codex-python/resolve/main/README.md
- Command line
-
hf download hf://datasets/tailot/codex-python/README.md
-
curl -L -o README.md https://huggingface.co/datasets/tailot/codex-python/resolve/main/README.md
language:
- en
tags:
- code
- program-synthesis
- multi-agent-systems
- software-engineering
- static-analysis
- testing
- formal-verification
- python
pretty_name: 'LingoLOGOS codex-python: a Python programming layer over the codex kernel'
size_categories:
- n<1K
LingoLOGOS codex-python topology
An external Python programming package and six-node topology built on top of the LingoLOGOS
codex kernel, a kernel this folder neither modifies nor carries. This dataset is that folder
published as it stands: the package under lingologos_python/, the six node folders with their grammar,
ontology and seed envelope, the one executable the six roles share, the two fixtures under
fixtures/ (a small package, and the pattern laboratory the catalog is measured on), the generated
cases under patterns/, the tests, the gate runner and the publisher, and this card in place of the
folder README. The kernel is a separate dataset at
https://huggingface.co/datasets/tailot/lingologos-codex, and the section
"What this bundle needs from the codex kernel" below says how the two find each other.
It provides everything needed to inspect, edit, test, and transactionally commit changes in a
Python repository through the codex assurance rules (VERIFIED, SINGLE_PROVER, UNKNOWN).
python -B tools/run_gates.py
GATES: CONFIRMED (14 gates: 14 CONFIRMED, 0 REJECTED, 0 ABSTAIN)
The gate runner is where this bundle states its numbers out loud: 14 gates, 196 tests across 16 files,
18 files under nodes/, and a kernel it does not carry. tools/publish_dataset.py re-derives every
one of those numbers from the tree it is standing in and stops the upload when the card and the code
beside it disagrees.
The report names the tree it describes. results/gates.json embeds a digest of every byte of the bundle
except the reports folder itself, and the publisher refuses to upload a tree that the report does not
describe byte for byte; tests/test_self_lint.py holds the report sitting in this folder to that bar.
The runner takes that digest before the first gate and asks it again before writing: a tree that moved
while the gates ran gets no report, and the report says how many seconds each gate took. The report
also names the kernel it resolved, as one digest of every kernel byte: the behaviour promised here is
tied to one revision of the codex kernel, and that kernel still does not sit in this folder.
What the card asks to be trusted is checkable from the tree: the numbers in the sentence above are
re-derived by the gate runner, by tests/test_self_lint.py, and by the publisher, which stops the
upload when the card and the code beside it disagree; the transcripts below are what the printed
commands printed against this tree; every refusal names one code from a registry the gates check
against the code that raises it; and the exit codes are collected in a table under Running that a
test probes against the real commands. What the card does not claim: the kernel, which this folder
neither carries nor modifies; a benchmark, the corpus being generated from the rules against one
fixture that is stated as its denominator; and facts the host will not answer, which the lock record
writes as a dash rather than a guess.
Contents
lingologos_python/_codex_bridge.py: finds the kernel without copying it: an already importablelingologos_codex, thenLINGOLOGOS_CODEX_ROOT, then a siblingcodex/ordatasets/codex/among the ancestors.lingologos_python/adapter.py:PythonLanguageAdapterandStrictPythonLanguageAdapterimplementing the five-methodlingologos_codex.adapter_contract.LanguageAdaptercontract.lingologos_python/ast_graph.py: AST symbol, method, inheritance, relative/absolute import, and call graph extraction (discover_python_files,extract_python_graph,importers_of,reexported_names,hardlinked_file,build_reverse_index,importers_from_index). The reverse index answers, for a whole tree at once, which files import each module:deleteasks it before removing a file, and thegraphcommand prints it. A file whose bytes are not UTF-8 text is named as a file and given no symbols, rather than decoded into inventions. An aliasedfrom x import y as zkeeps its edge to the submodulex.yeven though the name is renamed, and a dotted relative import crosses the same number of packages in the graph as in the source.discover_python_filesprunes a symlinked or junctioned directory instead of walking into it, andis_linked_pathanswers for both kinds of link on every platform, andhardlinked_fileanswers for a file whose bytes sit under two names in the tree. A package that re-exports through its__init__is read as a table from name to file, so a change behind the re-export still selects the test that only named the package.lingologos_python/test_selector.py: import-aware Python test selection (select_python_tests). A changedconftest.pyselects every test under its folder, because a conftest carries fixtures no import edge shows.lingologos_python/gates.py: bytecode-freeast.parse+ in-memorycompilegate, optional static checkers (mypy,ruff,pyright,flake8) that returnABSTAINwhen missing, andpytest/unittesttest runner with failed-target parsing. The unittest fallback runs importable module names rather than paths, and a runner that collected zero tests abstains instead of confirming or rejecting.lingologos_python/rules.py: eight shape rules over a named function. Each rule reads the function through its syntax tree, refuses with a named reason code when the shape is not the one it claims, and returns the edit texts when it is (RULES,RULE_IDS,open_target).lingologos_python/patterns.py: the catalog above the rules. A card states the shape it claims, why that shape is worth changing, what must hold before the rule runs, what test locks the change, and the reason codes it answers with when it refuses (PATTERNS,pattern_card,scan_pattern,plan_pattern).lingologos_python/reasons.py: the single registry of every reason code this bundle answers with (REASON_CODES), with the rule codes collected fromrulesso the registry cannot fall behind the rules that raise them and theself_lintgate refusing to confirm when the registry and the card below disagree.lingologos_python/session.py:PythonWorkspaceSessionfor safe staged verification and atomic disk commits vialingologos_codex.fsadapter(verify,edit_file,create_file,delete_file,apply_pattern,run_retry_loop, andrun_topology_subprocesses). A proposer that accepts a third argument is handed aRetryContextwith the attempts so far, their traces, their reasons, and the patch signatures the loop detector compares, which read the fate of a patch and not its words; a two-argument proposer keeps its signature. A commit re-reads what is on disk and refuses withPATCH_NOT_APPLIEDwhen the workspace moved while the six nodes were running. A write the disk refuses part way is undone from the in-memory originals, so a run never reports a change it did not land. A delete names the surviving files that import the module being removed, and goes through the kernel's delete transaction rather than an unlink of the session's own. A symlink or a Windows junction anywhere in the workspace makes the session refuse withLINKED_PATH_IN_WORKSPACE, naming the linked path: the staging copy refuses it,verifyrefuses before any node runs, and every commit re-asks the question before it writes, so a link that appeared while the six nodes were running is refused too, not landed through. A hardlinked pair, two names carrying the same disk bytes, is refused the same three ways withHARDLINKED_PATH_IN_WORKSPACE, because a staged copy would silently break what the workspace holds as one file. In subprocess mode each node has a budget (one hundred and twenty seconds by default) and an exhausted node is killed together with the gates it had started, because a budget that leaks the node's own children is not a budget;--total-timeout SECcaps the sum of the six waits. A run that exhausts either budget answers UNKNOWN with the reasonNODE_TIMEOUT. One tree is judged by one run at a time: every verb takes an exclusive lock at the workspace root before it reads anything and releases it in a finally even when the run was refused. The lock record names its holder three times over: the process number, the birth time that process had when the lock was taken, and a token that only that acquisition knows. A live number whose birth time does not match is not the holder the lock recorded, so a recycled process id cannot keep a tree locked past the death of its run; a leftover lock is claimed by renaming it first, so two runs racing over one corpse leave exactly one holder; and release deletes the lock only while the token in it is the one this run wrote, so a run never unlinks a lock another run took over. A live holder is answered REFUSED with the reasonSESSION_LOCKED, and one whose owner cannot be read is never stolen. A run that meets a live holder can wait instead:--lock-wait SECbudgets that wait, and a wait that runs out answers the same refusal it would have answered at once.lingologos_python/cli.py:lingologos_pythonCLI (verify,edit,create,delete,symbols,select-tests,patterns list|show|scan|apply,graph,lock-status,check-adapter). The session verbs take--configfor a JSON file holding the same knobs,--protectfor policy paths,--print-diffto show the pair beside the verdict, and--auditto append one JSON line per run to a ledger.fixtures/pattern_lab/: a small package with one function planted in the shape of each card and one planted to be refused, used by the tests and by the coverage counts.patterns/pattern_cases.jsonl,patterns/coverage.json: the generated case corpus (one accepted and one refused case per card) and the coverage statement, whose denominator is that fixture.tools/:build_patterns.pygenerates the corpus and--checkre-derives it;run_gates.pyis the gate runner of the numbers above;measure_coverage.pytraces how much of the package the suite enters;publish_dataset.pyturns this README into the dataset card and refuses to upload a tree that contradicts it.topology.json,agents/python_agent.py,nodes/<role>/: external six-node topology using thecodexkernel as its base. The six executables it names are written relative todatasets/, so in a standalone copy that leading name is simply the folder you are standing in.codex.python.json: declarativeCommandLanguageAdaptertemplate for Python projects.
The pattern catalog
Ten cards, one per shape this bundle can actually carry out:
| Card | Shape it claims | Family |
|---|---|---|
annotate-literal-defaults |
a default that is a string, number or None literal and states no type |
typing |
mutable-default-to-none |
a [] or {} default, which is one object shared by every call |
mutation |
chain-to-registry |
an if/elif chain dispatching on one name, ending in a refusal |
shape |
open-to-context-manager |
a file handle opened in a function body and closed by hand | resources |
bare-assert-to-explicit-raise |
a bare assert as the guard of a function, which vanishes under -O |
contracts |
bare-except-to-narrow-exception |
an except: that names no class, so it also catches the exits of the interpreter |
contracts |
none-comparison-to-identity |
a test against None written with == or !=, which asks agreement and not identity |
shape |
empty-len-to-truthiness |
an emptiness test that counts the collection with len and compares to zero |
shape |
drop-unused-imports |
a module level import whose bound name the module never reads again | shape |
init-missing-super |
an __init__ of a subclass that never reaches its base through super() |
contracts |
A card is not a prompt: it names a syntax-tree shape, and lingologos_python/rules.py refuses anything
that is not that shape. chain-to-registry refuses a chain whose branches take different kinds of
arguments (BRANCH_SHAPE_MISMATCH), open-to-context-manager refuses a handle that escapes the function
it opened (HANDLE_ESCAPE), mutable-default-to-none refuses a default that already carries an
annotation (ANNOTATED_MUTABLE_DEFAULT), bare-except-to-narrow-exception refuses a bare handler that
re-raises what it caught (BARE_EXCEPT_RE_RAISES), none-comparison-to-identity refuses a test against
None inside a chained comparison (NONE_COMPARISON_IS_CHAINED), empty-len-to-truthiness refuses
a count of something that is not a plain name (LEN_TARGET_IS_NOT_A_NAME), drop-unused-imports
refuses a star import in the file and a name the module exports (STAR_IMPORT_IN_FILE,
NAME_LISTED_IN_ALL) and answers NO_UNUSED_IMPORT when the import it was asked to drop is read
again in the module, and init-missing-super refuses a class whose bases it cannot read and a
constructor that already calls its base (SUPER_BASES_UNREADABLE, SUPER_CALL_ALREADY_FIRST),
answering NO_INIT_METHOD and INIT_TAKES_MORE_THAN_SELF when the named method is not the
constructor the card claims. A refusal is an answer, not
a failure: it names the reason code and writes nothing. Each card also lists the refusals the plan around
a rule shares: a target that is not
there (MISSING_TARGET_FILE), a class or method target that is not what it claims (NO_SUCH_CLASS,
NOT_A_MODULE_CLASS, NOT_A_METHOD), an import removal that cannot cut cleanly through the file
(PACKAGE_FILE_TARGET, IMPORTS_NOT_CONTIGUOUS), a test file that cannot carry the lock (NO_TEST_FILE,
CRLF_TARGET, INVALID_COMPANION_PATH), an assert
whose message is built at call time (NON_LITERAL_ASSERT_MESSAGE), and anchors that collide (ANCHOR_OVERLAP).
Five of the ten cards read a coroutine as readily as a plain function: their rules read the syntax
tree, and their lock tests either read the function's signature and source or drive it through an
explicit asyncio.run, so each of the five carries an async pair in the published corpus. The three
cards whose published lock calls the rewritten function straight out, with no loop anywhere, stay
honest the other way and refuse a coroutine with ASYNC_TARGET, saying on the card that they carry
no pair that would prove a lock waits for one.
Every change this bundle makes is a pair. The rule returns two edits, the change in the source file
and a lock test appended to the test file paired with it, and apply_pattern puts both in one
transaction: the pair commits together, or nothing is written. If the disk refuses that transaction
part way, the session restores both files from the originals it kept in memory and reports the named
refusal, and committed is true only after each written file has been read back and matched against
the verified text. The lock test is what makes the
second run honest. Run chain-to-registry on src/registry.py::render and the lock asserts that
the mapping is there, that each kind reaches its handler, that the chain is gone, and that the
refusal still refuses; take only the lock test and leave the source alone, and the test suite fails.
The pattern_pair_honesty gate runs exactly that experiment for every card: it writes only the test
side of the pair into a copy of the laboratory and reruns its suite, and it fails the gates if any
such copy still passes.
Five of the ten cards, the two newest among them, write their lock as a reading rather than a call:
the test opens the function with inspect and asserts on the text the rewrite leaves behind and the
text it removes, so the lock still fails while the old shape stands, but it answers about the source
and not about a behavior.
The thirty pairs are what the bundle ships, not the only check the rules face: tests/test_rules_fuzz.py
sweeps, with a fixed seed, shapes the corpus never visits: randomly assembled modules carrying mutations
(tabs, CRLF, non-ASCII, a class wrapper, a tail no parser accepts), companion tests missing or silent,
names that are not in the file. For every candidate and every rule the answer must be one of two things:
a hit whose anchors are ASCII LF text, apply, and leave the file parsing, or a refusal naming one of the
codes below. A crash, or a name the registry does not hold, fails the sweep.
The same sweep shape guards the session itself. tests/test_session_fuzz.py runs a fixed-seed plan of
planned operations: real edits and creates that commit, traversal paths, protected paths, missing files,
ghost cards, empty patches, and a planted live lock in the middle. The invariant is that nothing on disk
moves unless the answer committed, and that every REFUSED and every UNKNOWN names a code the registry
holds. That sweep found a real gap on its first run: the six-node pipeline answers with the kernel's own
vocabulary, and six of its words were not yet in the registry. tests/test_reasons.py now checks the
registry against the kernel's decision module itself, so the alphabet cannot fall behind the kernel
again.
The pair then goes through the six nodes of the kernel as any other change does: the proposing roles
claim it, gate_checker runs the syntax gate and the selected tests, adversary reproduces the
result by another path, and the arbiter returns VERIFIED with assurance 3 only when both trusted
roles agree. --dry-run runs all of that against a copy and leaves the workspace byte for byte as it
was. A card that refuses never reaches the nodes, and a path policy that blocks the lock test blocks
the source edit with it.
This is a catalog of patterns this bundle has carried out and can re-derive, not a claim that it can
change Python in general. patterns/coverage.json says what has been shown and names its denominator:
the ten cards over the eleven source files and thirty-three module level functions of
fixtures/pattern_lab/, not over Python and not over any corpus of real repositories. The bundle
also measures itself from the inside: tools/measure_coverage.py runs the suite under a trace
profile and counts how many of the package's own functions the tests enter, 169 of 179 at the time
of this card, and tests/test_coverage.py holds that count above a floor of ninety percent and
refuses to state it at all while the traced suite is failing.
The corpus is generated, like the kernel's own:
python -B tools/build_patterns.py --check
PATTERNS: CONFIRMED (30 rows over 10 cards, 33 module level functions in the fixture)
Each row is a work case in the schema lingologos_codex/casecorpus.py defines, so the kernel can check
the shape of a claim about a Python file without reading a byte of Python: case_id, the language tag,
the family, the intent tags, the edits, the verdict the run must reach, and for a refusal the reason code.
patterns/ is a generated folder, so edit tools/build_patterns.py and let --check say so.
Working the fixture from the command line
The commands below were run against fixtures/pattern_lab/ as published, and what follows is what
came back. The first one answers before anything is asked to change:
$ python -B -m lingologos_python symbols --workspace fixtures/pattern_lab --limit 5
files=22 symbols=78 edges=59
0.0385 src/registry.py::render
0.0342 src/tokens.py::count_words
0.0273 src/guards.py::open_ticket
0.0236 src/widgets.py::Box
0.0234 src/registry.py::format_short
The ranking is PageRank over the call and import graph, and the three highest ranked functions here are three of the shapes the ten cards claim: the dispatcher, the annotatable default, the bare guard. To know which tests a change is answerable to:
$ python -B -m lingologos_python select-tests --workspace fixtures/pattern_lab --files src/registry.py
tests/test_registry.py
The import edges alone, printed as the reverse index the delete verb consults: for every module, which files would stop importing it if it went.
$ python -B -m lingologos_python graph --workspace fixtures/pattern_lab
files=22 import_edges=11
src/asyncops.py <- tests/test_asyncops.py
src/baskets.py <- tests/test_baskets.py
src/guards.py <- tests/test_guards.py
src/labels.py <- tests/test_labels.py
src/legacy.py <- tests/test_legacy.py
src/notes.py <- tests/test_notes.py
src/registry.py <- tests/test_registry.py
src/retries.py <- tests/test_retries.py
src/slugify.py <- tests/test_slugify.py
src/tokens.py <- tests/test_tokens.py
src/widgets.py <- tests/test_widgets.py
Before a run that would take the workspace lock, the same tree can be asked who holds it, and the answer costs no session:
$ python -B -m lingologos_python lock-status --workspace fixtures/pattern_lab
free: no lock file named .lingologos-session.lock in this workspace
Exit is zero when the lock is free or absent and one when a live holder, or a lock whose owner cannot be read, sits there.
A card states its terms before you use it. This transcript is abridged to the lines a decision turns on, and the two long lines are wrapped here for width:
$ python -B -m lingologos_python patterns show --pattern open-to-context-manager
open-to-context-manager
family resources
shape a module level function that opens a file into a name and closes that name itself
why a close that is not tied to the scope is skipped by the one path that raises on the way
out, and the reader has to trace every exit to believe the handle is closed.
needs
- the name is used only inside that function and never stored or returned
- a coroutine target is refused with ASYNC_TARGET: this card carries no coroutine pair that
would prove its lock test waits for one
lock the source opens inside a with block and never calls close, and a file written in a
temporary directory is read back through the rewritten function
refuses ALREADY_SCOPED, NO_BARE_OPEN, HANDLE_ESCAPE, NOT_A_MODULE_FUNCTION, ASYNC_TARGET
needs assurance >= 3 to commit
To find out whether a workspace really holds the shape, rather than guessing:
$ python -B -m lingologos_python patterns scan --workspace fixtures/pattern_lab \
--pattern chain-to-registry
chain-to-registry: 1 hit(s) in this workspace
src/registry.py::render
src/registry.py dispatch registry of 'render'
tests/test_registry.py lock test 'test_render_dispatches_through_a_registry' appended after 'test_render_rejects_an_unknown_kind'
why: the branch for 'short' returns format_short
why: the branch for 'long' returns format_long
why: the branch for 'json' returns format_json
The hit names the function, and under it the two edits the card would apply: the chain of if and elif
that becomes a mapping of handlers, and the lock test appended to tests/test_registry.py. --json
prints the same answer as data, with the search and replace text of every edit beside it.
render_pair, in the same file, is not listed: its chain is not in the shape the card claims, and a
card that does not claim a shape does not touch it. Ask the same question of a card that reads
coroutines, and the same laboratory answers twice:
$ python -B -m lingologos_python patterns scan --workspace fixtures/pattern_lab \
--pattern mutable-default-to-none
mutable-default-to-none: 2 hit(s) in this workspace
src/asyncops.py::gather
src/asyncops.py shared default of 'gather'
tests/test_asyncops.py lock test 'test_gather_has_no_shared_default' appended after 'test_item_count_counts_items'
why: the default of 'tags' is a value every call would share
src/slugify.py::add_tag
src/slugify.py shared default of 'add_tag'
tests/test_slugify.py lock test 'test_add_tag_has_no_shared_default' appended after 'test_join_parts_uses_its_tuple_default'
why: the default of 'tags' is a value every call would share
The first hit is an async def: five of the ten cards read a coroutine as well as a plain function,
and the laboratory carries a coroutine in the shape of each of them so the published counts show it.
The pair, verified and not committed:
$ python -B -m lingologos_python patterns apply --workspace fixtures/pattern_lab \
--pattern chain-to-registry --target src/registry.py::render --dry-run
VERIFIED (assurance 3, committed=False) OK_DUAL_CONFIRMATION: confirmed by adversary, gate_checker
The same apply, asked to show the pair before any node runs, abridged here to the source hunk of its two diffs:
$ python -B -m lingologos_python patterns apply --workspace fixtures/pattern_lab \
--pattern chain-to-registry --target src/registry.py::render --dry-run --print-diff
--- a/src/registry.py
+++ b/src/registry.py
@@ -1,9 +1,6 @@
def render(kind, item):
- if kind == "short":
- return format_short(item)
- elif kind == "long":
- return format_long(item)
- elif kind == "json":
- return format_json(item)
- else:
+ handlers = {"short": format_short, "long": format_long, "json": format_json}
+ handled = handlers.get(kind)
+ if handled is None:
raise ValueError("unsupported kind")
+ return handled(item)
The hunk below it adds the twenty-three lines of the lock test to tests/test_registry.py.
--print-diff prints beside the verdicts of every verb that writes, and what it prints is the pair
the run plans, not a report of what it wrote.
The same command without --dry-run writes both files in one transaction. Ask for the function whose
shape is wrong and the answer is a refusal with a reason, an exit code of 1, and a workspace that did
not move by a byte:
$ python -B -m lingologos_python patterns apply --workspace fixtures/pattern_lab \
--pattern chain-to-registry --target src/registry.py::render_pair --dry-run
REFUSED (assurance 0, committed=False) BRANCH_SHAPE_MISMATCH: the chain in 'render_pair' tests more
than one name against text literals, its branches do not take the same arguments, or its last branch
does not raise
nothing was written; the card named this reason before any node ran
A change of your own goes through the same six nodes, as a search and replace you wrote:
python -B -m lingologos_python edit --workspace repo --file src/x.py \
--search "def load(path):" --replace "def load(path: Path) -> dict:" --dry-run
and so does create --file ... --content-file ..., and delete --file ... removes a file through the
same six-node gate: its exit code is zero only once the file is really gone, and --dry-run verifies
the removal without touching the disk. verify --file ... reports a verdict for a file without asking
for a change. With --strict-tools the run demands mypy and ruff: a gate that cannot run abstains,
and the session answers UNKNOWN with the reason GATE_ABSTAIN instead of reporting a check that never
happened. --subprocesses runs the six nodes as separate processes instead of in this one, and the
five session verbs all take the same budget flags: --node-timeout SEC sets each node's budget and
--total-timeout SEC caps the sum of the six waits, each node then getting the smaller of its budget
and the time the total still allows; a run that exhausts one is answered NODE_TIMEOUT, not awaited
forever. Node budgets belong to subprocess mode: a run in this process is awaited without one. Every
run, in whichever mode, also budgets each runner command it launches, the test gate and any static
checker, through --gate-timeout SEC, one hundred and twenty seconds by default: a runner that outruns
it is killed and answered with the named abstain GATE_ABSTAIN, because a hung test run is not a
passing test run. The gate budget reaches the kernel through one environment variable per process: a
process therefore carries one session's gate budget at a time, and two sessions open in the same process
would overwrite each other's last written value.
The knobs a session runs with are the flags, and the same knobs can sit in one JSON file: --config FILE carries strict_tools, subprocesses, allow_single_prover, node_timeout, total_timeout,
gate_timeout, lock_wait, and protect; a flag on the command line outranks the file, and a key
the list does not hold, or a value of the wrong kind, stops the run before a node is asked anything.
--protect src/x.py adds to the protected paths the policy carries, and a write naming one is
answered PROTECTED_PATH with no node consulted. --lock-wait SEC says how many seconds a run may
wait for a live holder before it answers SESSION_LOCKED; the default of zero answers at once,
because a caller that did not ask to wait gets the refusal it asked for. --print-diff prints the
unified diff of the pair a write is about to attempt. --audit FILE appends one JSON line per run,
whatever the answer was: command, workspace, verdict, reason, and whether anything was committed,
so what the tools refused on a tree leaves a record that does not live in a terminal scrollback.
check-adapter says whether the Python adapter holds the contract of the kernel, and exits non-zero
when it does not. run_retry_loop runs the kernel's stall detection between attempts: a second attempt
that applies a patch on the same target with the same patch status is answered CHECKER_ABSTAIN,
because the kernel reads it as an identical-failure loop rather than as learning; a retry that wants to
be read as a move has to change the fate of the patch, not only its text. --allow-single-prover
commits at assurance 2 on all five verbs that write, and a
card that states its own bar keeps it. edit takes each side of its pair from a file as readily as
from the command line, through --search-file and --replace-file, so a multi-line pair survives a
shell. --version prints the envelope this bundle speaks.
tests/test_cli.py runs the documented commands as separate processes and asserts their exit codes and
their answers, because a documented command that crashes breaks a promise even when every library call
beside it is correct.
Reason codes
Every refusal names one code, and the set is a registry rather than a legend written for the card:
lingologos_python/reasons.py collects it, and the self_lint gate refuses to confirm when the
registry and this list disagree, or when a name the Contents promises in parentheses is one no module
of the package defines.
- Refusals the session raises itself:
PATH_POLICY,PATCH_NOT_APPLIED,NODE_TIMEOUT,LINKED_PATH_IN_WORKSPACE,HARDLINKED_PATH_IN_WORKSPACE,SESSION_LOCKED. - Verdicts the codex kernel brings back:
GATE_REJECTED,GATE_ABSTAIN,GATE_MISSING,CHECKER_REJECTED,CHECKER_ABSTAIN,NOT_APPLIED,PROTECTED_PATH,NO_INDEPENDENT_CONFIRMATION. - The refusal the catalog layer adds above the rules:
AMBIGUOUS_TARGET. - Preflight and shape refusals of the rules:
MISSING_TARGET_FILE,NO_SUCH_FUNCTION,NOT_A_MODULE_FUNCTION,NOT_PARSEABLE,NOT_ASCII_TARGET,TAB_INDENTED_TARGET,CRLF_TARGET,NO_TEST_FILE,NO_TEST_ANCHOR,AMBIGUOUS_TEST_ANCHOR,ALREADY_ANNOTATED,NOT_A_MUTABLE_DEFAULT,ANNOTATED_MUTABLE_DEFAULT,GUARD_ALREADY_PRESENT,NO_DISPATCH_CHAIN,BRANCH_SHAPE_MISMATCH,ALREADY_SCOPED,NO_BARE_OPEN,HANDLE_ESCAPE,NOT_THE_FIRST_STATEMENT,ASYNC_TARGET,NON_LITERAL_ASSERT_MESSAGE,INVALID_COMPANION_PATH,ANCHOR_OVERLAP,NO_BARE_EXCEPT,BARE_EXCEPT_RE_RAISES,EXCEPT_HANDLER_UNREADABLE,NO_NONE_COMPARISON,NONE_COMPARISON_IS_CHAINED,NO_EMPTY_LEN_CHECK,LEN_TARGET_IS_NOT_A_NAME,NO_SUCH_CLASS,NOT_A_MODULE_CLASS,NOT_A_METHOD,NO_INIT_METHOD,INIT_TAKES_MORE_THAN_SELF,SUPER_CALL_ALREADY_FIRST,SUPER_BASES_UNREADABLE,NO_UNUSED_IMPORT,STAR_IMPORT_IN_FILE,NAME_LISTED_IN_ALL,PACKAGE_FILE_TARGET,IMPORTS_NOT_CONTIGUOUS.
Running
From the folder of this dataset, with LINGOLOGOS_CODEX_ROOT pointing at the folder of the kernel
dataset:
python -B -m pytest -p no:cacheprovider tests -q
python -B tools/run_gates.py
python -B -m lingologos_python check-adapter --workspace fixtures/sample_pkg
python -B -m lingologos_python verify --workspace fixtures/sample_pkg --file src/mathops.py
python -B -m lingologos_python patterns list
python -B -m lingologos_python patterns show --pattern chain-to-registry
python -B -m lingologos_python patterns scan --workspace fixtures/pattern_lab \
--pattern chain-to-registry
python -B -m lingologos_python patterns apply --workspace fixtures/pattern_lab \
--pattern chain-to-registry --target src/registry.py::render --dry-run
python -B -m lingologos_python graph --workspace fixtures/pattern_lab
python -B -m lingologos_python lock-status --workspace fixtures/pattern_lab
patterns apply without --dry-run commits, and only on a verdict the kernel accepts: it commits
when the assurance reaches the higher of the session floor and the card's own floor, and reports a
refusal with the reason code of the rule that stopped it. The exit code follows the write, not the
verdict: edit, create and patterns apply exit 0 only when the change landed on disk, or when a
--dry-run was accepted. fixtures/pattern_lab/ is a copy candidate:
the commands above either read it or verify against a copy, and the tests copy it to a temporary folder
before writing, so the folder as published keeps the exact shape the coverage numbers were counted on.
Exit codes
| command | 0 | 1 | 2 |
|---|---|---|---|
verify |
a verdict the session accepts, nothing written | REFUSED or UNKNOWN |
bad flag, unreadable or unknown-key config |
edit, create, delete, patterns apply |
the change landed, or a --dry-run was accepted |
refused, unverified, or a lock held past the wait budget | bad flag, unreadable or unknown-key config |
patterns list, patterns show, patterns scan |
the answer printed | -- | unknown card, missing flag |
symbols, select-tests |
the answer printed | -- | bad flag |
graph, lock-status |
the answer printed; a free lock is an answer | workspace missing; a live or unreadable lock | bad flag |
check-adapter |
the adapter holds the kernel contract | the contract is violated | bad flag |
tests/test_cli.py parses this table off the card and probes the printed commands against it: a
cell that promises an exit code the real command does not answer, or a command line the table
forgot, fails the suite.
What this revision renamed
The two letter prefix is gone. The package is lingologos_python, where an earlier published revision
had lgpython; the kernel it resolves is lingologos_codex, where that revision had lgcodex; the
environment handle the bridge reads is LINGOLOGOS_CODEX_ROOT, where it was LGCODEX_ROOT; and the
command line is python -B -m lingologos_python, the same name the console script of pyproject.toml
carries. What did not move: the five adapter methods, the envelope kind string, the entry point group
lingologos.codex.adapters, the work case schema version, and the sixteen rows of
patterns/pattern_cases.jsonl that the previous revision published, which this revision carried over byte
for byte, in one group per card, adding one pair for each of its two new cards and an async pair for each of the five cards
whose rule reads a coroutine as well as a plain function. The six seed
envelopes under nodes/ do carry the adapter under its new dotted path, because naming a module that no
longer exists would make those files disagree with the code beside them. The dataset keeps its name,
tailot/codex-python.
What this bundle needs from the codex kernel
lingologos_python imports lingologos_codex, and lingologos_python/_codex_bridge.py resolves that
import in one step: an already importable lingologos_codex, then the folder named by
LINGOLOGOS_CODEX_ROOT, then a sibling codex/ or a datasets/codex/ among the ancestors of the
package. Downloaded from here the two orders are the same folder, and the resolution is:
pip install -r requirements.txt
git clone https://huggingface.co/datasets/tailot/lingologos-codex
LINGOLOGOS_CODEX_ROOT=/path/to/lingologos-codex python -B -m pytest -p no:cacheprovider tests -q
Nothing in this bundle downloads anything at run time: the kernel is a second download you make once, and the tests fail with a named reason when it is missing rather than passing without it. The kernel never imports this folder, so the dependency has exactly one direction, and one copy of the kernel can serve any number of workspaces.
The sixteen pattern cases
patterns/pattern_cases.jsonl holds 16 rows, one accepted and one refused for each of the eight cards
of the catalog: case_id, language, family, intent_tags, the edits the rule returned (the
source edit and the test that locks it), the verdict the run must reach, and for a refusal the
reason_code the rule answered with. A row is a work case in the schema the kernel dataset defines in
lingologos_codex/casecorpus.py, so its shape is checkable without a Python file in sight.
tools/build_patterns.py derives the rows by running each rule over fixtures/pattern_lab/, and
--check re-derives them and compares the bytes: a row is never edited by hand. The same tool writes
patterns/coverage.json, which states what the sixteen rows cover and names its own denominator, the
fixture. Sixteen rows are eight cards carried end to end, not a benchmark: the fixture is small and was
written for this bundle, and nothing here counts coverage of real repositories.
Rights
The dataset is published by the author of LingoLOGOS under the same account, tailot. The source tree
is the codex-python/ folder of https://github.com/tailot/LingoLOGOS, where the project states its own
terms. Neither that repository root nor this folder carries a LICENSE file, so no license is claimed
here beyond what the publisher states on the repository and on this dataset page; ask there before
reusing the code. The fixture package under fixtures/sample_pkg/ and the pattern laboratory under
fixtures/pattern_lab/ were written for this dataset and are not taken from a third-party project.
Citation
@misc{lingologos_codex_python,
title = {LingoLOGOS codex-python: a Python programming layer over the codex kernel},
author = {{LingoLOGOS}},
year = {2026},
howpublished = {\url{https://huggingface.co/datasets/tailot/codex-python}},
}