Add OMOS starter architecture and OT conversion API#29
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ae45908d1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }; | ||
|
|
||
| export const buildTimestampRecord = (inputUtcIso) => { | ||
| const timestampUtc = new Date(inputUtcIso); |
There was a problem hiding this comment.
Reject timezone-less UTC timestamps in OT conversion
buildTimestampRecord accepts any date string and parses it with new Date(inputUtcIso), which treats values like 2025-03-18T00:00:00 as local time instead of UTC. That makes the same API request produce different OT results across server timezones (and can incorrectly throw “predates OT epoch” in positive-offset regions), so the conversion is not deterministic as designed. Require an explicit Z/offset or parse/normalize strictly as UTC before calling utcToOt.
Useful? React with 👍 / 👎.
| @@ -0,0 +1,4 @@ | |||
| export const validateOtInput = ({ year, dayOfYear }) => { | |||
| if (!Number.isInteger(year) || year < 0) throw new Error('Invalid year'); | |||
| if (!Number.isInteger(dayOfYear) || dayOfYear < 1) throw new Error('Invalid dayOfYear'); | |||
There was a problem hiding this comment.
Bound OT dayOfYear during input validation
validateOtInput only enforces dayOfYear >= 1 and never checks the upper limit for the specified year, so impossible values (for example dayOfYear: 999) are treated as valid. Any caller using this validator as a gate can accept invalid OT timestamps and fail later when conversion logic rejects them, so this validator should enforce the same 365/366-day constraints as otToUtc.
Useful? React with 👍 / 👎.
Motivation
omos-core,onegodian-time,onegodian-agent) so the repo structure maps to the institutional architecture.Description
/api/omoswith endpointsPOST /classify,POST /align,POST /timestamp/convert, andPOST /decision/runwired into the main router (src/routes/api/omosRoutes.js,src/routes/index.js).src/services/omos/identityService.js), alignment checks with a system prompt loader (alignment/system-prompt.txtandsrc/services/omos/alignmentService.js), algorithmic decision pipeline (src/services/omos/algorithmService.js), and OTS‑V5 time conversions plus record builder (src/services/omos/timeService.js).src/controllers/omosController.js) that expose service behavior as JSON APIs and updated documentation (README.md,docs/omos/repo-architecture.md) to list the new endpoints and architecture mapping.omos-core/,onegodian-time/,onegodian-agent/) including anopenapi.yaml, kernel decision stub, OT engine bridge, and agent template, plus integration tests (test/omos.test.js).Testing
npm testwhich passed all tests (6tests,0failures).npm run checkwhich completed without errors.npm run validate:enforcementwhich returnedEnforcement validation checks passed.Codex Task