AGENTS.md instructions for /home/clive/PycharmProjects/Orac
Follow standard Python conventions unless otherwise specified.
Module structure:
A module docstring MUST appear at the very top of the file describing its purpose.
Immediately following the module docstring, include comment-based metadata headers:
Author: Clive Bostock
Date:
Description:
Command-line scripts:
Use argparse for command-line parameters.
Code quality:
Include Google-style docstrings for all new public modules, classes, and functions.
When modifying existing public code, add missing docstrings where it is reasonable to do so within the scope of the change.
Use type hints where appropriate.
Favour readable, production-usable code with sensible error handling.
General:
Prefer clarity over cleverness.
Avoid unnecessary complexity.
For any created programs / executable scripts include provenance.
If pre-existing code does not already have these, ask for confirmation before adding.
Template:
› Please examine the codex-sdk.zip and determine whether we could adapt/implement this within the repo. The contained SDK does require a prescribed repo structure, but maybe we
could its topology to suit the use case here. The idea is that we have a routing AGENTS.md file, at the root of the repo. The links therein, are mainly conditional, to
avoid
context bloat. These include 2 types of link: links to subsidiary AGENT.md files, these are used to describe in generic terms, the repo substructure that mthey govern. All
AGENTS.md files are repo agnostic. The next idea is that we use AGENT_CONTEXT.md files to describe repo specific characteristics/topology. For example the schema / namespace
mappings within the database. A template is provided that outlines the structure for the database oriented details. In our case this would only be used to describe orac_core, orace_api, orac_code, orac_apx_pub, orac schenas.
Assistant
I’ll inspect the repo instructions and the zip contents first, then map what the SDK expects against Orac’s existing structure. After that I’ll report whether it’s adaptable and what changes would be needed, without modifying files unless the evidence points to a small safe probe.
Assistant
I found codex-sdk.zip at the repo root and a very dirty worktree, so I’ll treat this as read-only analysis and avoid touching existing changes. I’m also loading the project’s required guardrails plus the maintainer-investigation skill since this is an architecture/adoption assessment.
Assistant
The SDK is documentation-heavy rather than a runtime package: root routing instructions, guardrails, skill docs, and product/db / nonprod/db agent context templates. I’m going to compare those routing concepts with Orac’s current root instructions and database layout.
Assistant
Using maintainer-briefing for a read-only architecture/adoption assessment.
High-Confidence Findings
Yes, the SDK can be adapted, but I would not copy its prescribed product/ / nonprod/ topology into Orac wholesale.
The useful idea is the routing model: root AGENTS.md as a conditional loader, generic nested AGENTS.md files for subtrees, and repo-specific AGENT_CONTEXT.md files beside them.
Orac already has the important concepts in AGENTS.md, but it mixes routing with Orac-specific facts.
The SDK’s database model maps closely to Orac’s current schema layering: orac_core -> orac_api -> orac_code -> orac_apx_pub, with orac_plugin also documented in 20-database-standards.md.
Orac’s database DDL is actually under resources/db/schema, not product/db.
There is currently no AGENT_CONTEXT.md anywhere in the repo.
The SDK uses AGENTS.md, not singular AGENT.md.
Tentative Inferences
Best fit is to adapt the SDK topology to Orac paths, not adapt Orac to the SDK paths.
The first useful implementation would be:
keep root AGENTS.md as the global router
add resources/db/schema/AGENTS.md as the generic database subtree guidance
add resources/db/schema/AGENT_CONTEXT.md with Orac-specific schema mappings
The orac schema appears to be a legacy/compatibility synonym schema, based on files under resources/db/schema/orac/synonym.
orac_ha is present in the working tree and Docker bundle order, but your request says the context should only cover orac_core, orac_api, orac_code, orac_apx_pub, and orac. That omission should be explicit if intentional.
Main Entry Points
User
The orac schema is meant for internal orac database connections, by the core Orac Python stack. The idea is that relevant grants are made to the orac schema, such that it can access business logic in the orac_code schema. I'm not sure whether this POLP has been implemented yet. The ora_ha is destined to be implemented via a plugin and should not be referenced, other than to say that it should only be considered, if explicitly requested. The orac_plugin schema, is the go-between schema, for Orac and plugins, where a plugin requires to create it's own schema. The idea is that the plugin will grant access to entrypoints in it's schema, to the plugin_schema, which will allow Orac access to necessary database resident APIs in the plugin schema. Pleae confirm that this makes sense, presuming it makes sense.
Assistant
Yes, that makes sense. I would describe the intended topology like this:
text
orac_core owns Orac data structures
orac_api exposes controlled table/API access to orac_core
orac_code owns Orac business logic and orchestration
orac internal runtime connection schema for the core Python stack
orac_apx_pub APEX/client-facing access schema
orac_plugin broker/access schema used by Orac to call approved plugin DB APIs
<plugin_schema> plugin-owned private database objects and API entrypoints
The important distinction is that orac is not a legacy compatibility schema in architectural terms; it is the internal application/runtime schema for the core Orac Python stack. It should receive only the grants it needs, normally to approved orac_code packages/views and possibly selected orac_api surfaces where explicitly justified. It should not own core business logic, and it should not get direct access to orac_core tables.
Your plugin model also fits POLP:
text
orac_code / Orac runtime
|
v
orac_plugin
|
v
<plugin_schema approved entrypoints>
That keeps plugin-private storage inside each plugin schema, while orac_plugin acts as the controlled bridge. The plugin grants only its reviewed database-resident APIs/views to orac_plugin; Orac does not get broad access to plugin tables.
For orac_ha, I agree: it should not be part of the normal Orac database context except as an explicit note that Home Assistant database assets are plugin-bound/future-plugin-bound and must only be considered when the task explicitly asks for them.
The one thing to verify later is whether the current grants actually implement this. Based on the files already seen, orac_apx_pub grants are visible, but I did not confirm whether orac currently has the intended grants to orac_code, or whether it is still relying on compatibility synonyms to orac_api.
User
So, we can implement the SDK?
Assistant
Yes. We can implement the SDK pattern in Orac, but as an adapted topology rather than copying the SDK structure verbatim.
Recommended scope:
Keep root AGENTS.md as the conditional router.
Add resources/db/schema/AGENTS.md using the SDK’s generic database guidance, adjusted from product/db to Orac’s actual resources/db/schema layout.
Add resources/db/schema/AGENT_CONTEXT.md with Orac-specific mappings:
orac_core: data ownership
orac_api: API views, TAPIs, API triggers
orac_code: business logic/orchestration
orac: internal Python runtime connection schema
orac_apx_pub: APEX/client access schema
orac_plugin: controlled bridge to plugin-owned schema entrypoints
orac_ha: explicitly out of normal scope unless requested
Update root AGENTS.md to route DB work to resources/db/schema/AGENTS.md.
Optionally add similar subtree routing later for src/, plugins/, web/, and bin/.
I would do this as a small documentation-only patch first, especially because the working tree is currently dirty. That gives us the context-bloat reduction and schema-topology clarity without moving repo directories or changing runtime behavior.
User
For all intents and purposes, the repo is now clean.
Assistant
I’ll treat that as approval to make the documentation-topology change. I’m going to verify the worktree, read the git workflow guardrail because this creates files, then add the adapted SDK routing files without changing runtime code.
Assistant
The tracked tree is clean, but there are still untracked local artifacts: .entire/, .gemini/, codex-sdk.zip, and plugin_remainder.md. I’ll leave those alone and only add the routing/context docs. The SDK’s 70-git-workflow.md is not present in this repo, so there is no local git workflow guardrail to load.
Assistant
I have enough context now. I’m adding a database subtree router that mirrors the SDK approach but names Orac’s real schema path, and a live context file that captures the schema roles you clarified, including the orac_ha exclusion.
Assistant
The files are in place. I’ll do a quick consistency pass now: check the diff, confirm there are no accidental references to the SDK’s product/db, and verify the new routing files are visible in git status.
Assistant
Implemented the adapted SDK routing pattern as documentation-only changes.
Changed:
AGENTS.md now routes resources/db/schema work through the local database agent instructions and context.
Added resources/db/schema/AGENTS.md with generic Orac database subtree guidance.
Added resources/db/schema/AGENT_CONTEXT.md with the Orac-specific schema topology:
orac_core, orac_api, orac_code, orac, orac_apx_pub, orac_plugin, and explicit orac_ha exclusion unless requested.
We likely need to adapt the topology to allow for the split between APEX apps and the web based apps. We will need mention of these somewhere in AGENT_CONTEXT.md files.
Assistant
I’ll add this as a documentation topology refinement. First I’m checking the web app layout and the APEX locations so the context names the real paths rather than inventing a generic split.
Assistant
The repo has one tracked web app surface at web/orac-display and APEX exports under resources/db/schema/orac_core/orac_apps plus orac_ws. I’ll update the database context for APEX, then add a separate web-app context so agents do not conflate browser apps with APEX/database assets.
Assistant
I’m making the app split explicit in two places: database context for APEX exports, and a new web context for Vite/React browser surfaces. Root routing will point web work at that context.
User
The orac_ws perhaps deserves a mention, alongside the APEX apps.
Assistant
orac_ws is already mentioned in the new database context, but I agree it deserves equal treatment with orac_apps rather than looking like a side note. I’ll tighten that section so workspace exports and app exports are both first-class APEX database asset categories.
Assistant
Done. I made the split explicit and gave orac_ws equal standing with orac_apps.
Added/updated:
Root AGENTS.md now routes database and web work separately.
resources/db/schema/AGENT_CONTEXT.md now distinguishes:
orac_ws: APEX workspace export assets
orac_apps: APEX application export assets
web: browser/runtime applications
Added web/AGENTS.md and web/AGENT_CONTEXT.md for the web app side, currently documenting web/orac-display.
git diff --check passes.
User
Has the fill list of agent-guardrails docs been added from the ZIP file?
Assistant
I’ll compare the ZIP’s docs/agent-guardrails contents against the repo’s current guardrails so we can answer this precisely.
Assistant
No. The full ZIP guardrail set has not been added.
Current repo has:
00-project-principles.md
10-architecture-boundaries.md
20-database-standards.md
25-plsql-standards.md
30-python-standards.md
50-plugin-standards.md
60-security-and-risk.md
70-context-management.md
table-abbreviations.csv
Missing from the ZIP’s guardrail set:
27-liquibase-annotations.md
30-python-engineering-foundations.md
31-python-standards.md
35-frontend-nextjs-standards.md
40-bash-scripting.md
70-git-workflow.md
the whole docs/agent-guardrails/frontend-nextjs/ reference tree
Also note: the repo has 30-python-standards.md, while the SDK splits Python guidance into 30-python-engineering-foundations.md and 31-python-standards.md. So this should be merged/adapted deliberately rather than blindly copied over.
User
Remove the existing 30-python-standards.md abd replace with 30-python-engineering-foundations.md and 31-python-standards.md.
Assistant
I’m mapping the current Python guardrail file against the SDK split so I can replace it cleanly rather than leave stale references behind. After that I’ll update the root router and any internal links that still point at the old filename.
Assistant
I’m replacing the old Python guardrail with the SDK split now. I need one more pass over the remaining sections so I can avoid truncating the new docs halfway through.
User
Actually - merge them instead.
Assistant
The direction has flipped back to a single Python guardrail file, so I’m collapsing the split instead of leaving two documents around. I’ll fold the engineering-foundations material into 30-python-standards.md, remove the two new files, and restore the root references to the single file.
Assistant
I’ve got the merge shape: one Python guardrail file with the foundation guidance inserted ahead of the coding rules, and the split files removed. I’m applying that now and restoring the root router to the single filename.
Assistant
The merge patch partially failed because the split files aren’t present in the working tree the way the patch expected. I’m checking the actual file state and then I’ll apply the consolidation with the right paths in one pass.
Assistant
I’ve confirmed the split files were never actually present, so there’s nothing to delete. The only real change now is to fold the engineering-foundations material into the existing Python standards file and keep the rest of the repo pointed at that single document.
Assistant
The merge is in the single existing Python guardrail now. I’m doing a final search for stale links and a diff check so the repo ends up with one Python standards doc, not a half-split tree.
Assistant
Merged back into one file.
docs/agent-guardrails/30-python-standards.md now includes the engineering-foundations material at the top, before the existing Python coding standards.
AGENTS.md still points Python work at that single file.
I checked for stale references to 30-python-engineering-foundations.md and 31-python-standards.md; none remain.
git diff --check passed.
User
Other than the 30-python-engineering-foundations.md, there are still agent-guardrails markdown documents missing in the repo, that exist in the zip. Also existing matches should be updated from the ZIP.
Assistant
I’m comparing the ZIP’s guardrail set against the repo’s current copies so I can sync the shared docs and add the missing ones in one pass. The local Python merge stays as-is unless the ZIP has a direct match that needs to be folded in.
Assistant
I’m checking which existing guardrails actually drift from the ZIP versus which are already aligned. That lets me sync the real deltas without blindly overwriting everything.
Assistant
I’ve confirmed the repo has only the smaller core guardrail set plus the hand-edited Python merge. The ZIP has several missing docs and a few existing files that are not aligned with it, so I’m checking the remaining big ones before I patch anything else.
Assistant
I’ve got a clean way to sync this: extract the ZIP’s docs/agent-guardrails tree wholesale, while excluding the split Python files so the merged 30-python-standards.md stays intact. That will refresh the matching docs and create the missing ones in one mechanical pass.
User
Leave the Python guardrail out of this.
Assistant
I’ve kept the Python guardrail out of the ZIP sync. I’m just verifying the non-Python guardrails now so I can report what was refreshed and what was added without touching 30-python-standards.md again.
Assistant
30-python-standards.md was left out of this ZIP sync.
resources/docker/oracle/setup/035-orac-schema_and_apps.sh: install ordering for schema bundles.
Proposed resources/db/schema/AGENT_CONTEXT.md: Orac-specific mapping, for example:
schema domain: orac
core schema: orac_core
API schema: orac_api
code schema: orac_code
APEX/access schema: orac_apx_pub
compatibility schema: orac
plugin access schema: document as orac_plugin only if in scope
Important Control And Data Flows
The SDK wants generic AGENTS guidance to say “read adjacent context before database work.”
For Orac, that would prevent agents from inferring ownership from folder names alone.
It would also reduce context bloat by moving repo-specific schema facts out of broad guardrails and into one local context file.
Fragile Or High-Risk Areas
A wholesale SDK copy would break links because Orac has docs/agent-guardrails/30-python-standards.md, while the SDK splits this into 30-python-engineering-foundations.md and 31-python-standards.md.
The SDK adds guardrails such as 27-liquibase-annotations.md, 40-bash-scripting.md, and 70-git-workflow.md; useful, but adopting them requires link and policy reconciliation.
Current 20-database-standards.md starts with “Here is a cleaner...” and a code fence, so it looks like pasted generated content rather than a clean Markdown document. That should be cleaned if this routing system is formalized.
The repo is currently very dirty, so implementation should be a separate, small change set.
Questions Still Open
Should orac_ha be included in the database AGENT_CONTEXT.md, or deliberately excluded for now?
Should orac_plugin be documented in the same context, given the current guardrails mention it?
Do you want the SDK’s stronger git/bash/liquibase guardrails imported, or only the routing/context pattern?
Bottom line: implement the topology, not the SDK directory structure. The clean first step would be a focused patch adding resources/db/schema/AGENTS.md and resources/db/schema/AGENT_CONTEXT.md, then lightly updating root AGENTS.md to route database work there.