Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Action-state bugs, inaccurate function contracts, altered project attribution, and removed compliance gates must be resolved.
10 open findings
Prevent cancelled operations from becoming completed · New Preserve existing NOTICE identity and attribution · New Constrain scrap_rate to the [0, 1] range · New Restrict reassignment to queued operations · New Reject negative defect counts · New Align capacity function return type with its dictionary result · New Align readiness function return type with its dictionary result · New Align order_yield return type with its dictionary result · New Import lint before exporting it via all · New Type-check Vitest integration configuration and tests · New
What changed in this PR
Introduces the Ontogeny operational-ontology platform, its React console and manufacturing example, while vendoring HugeGraph AI components for future integration.
Changes:
- Adds Ontogeny’s governed ontology, action, policy, agent, projection, and evolution layers.
- Adds the web console, extensions, example domain, tests, and bilingual documentation.
- Vendors HugeGraph AI under
third_party/with provenance and smoke checks.
| File | Description |
|---|---|
server/ontogeny/** |
Core platform services and public package APIs. |
extensions/** |
Ollama, HugeGraph, and built-in agent adapters. |
domains/product-manufacturing/** |
Manufacturing ontology, actions, policies, functions, and agents. |
web/src/** |
React console entry points, components, and agent styling. |
web/*.json, web/*.ts, web/index.html |
Frontend build, type-check, and integration-test configuration. |
web/README.md, web/.gitignore, web/.oxlintrc.json |
Frontend guidance and tooling configuration. |
docs/en/**, docs/zh/** |
Bilingual quick-start documentation. |
third_party/** |
Vendored HugeGraph AI source, tests, deployment assets, and documentation. |
THIRD_PARTY.md |
Vendored-source provenance and synchronization policy. |
NOTICE, LICENSE |
Root licensing and attribution changes. |
.github/workflows/third-party-smoke.yml |
Vendored-tree presence and coupling checks. |
.github/workflows/check-dependencies.yml |
Removes dependency and license checks. |
.github/workflows/sync.yml, .github/workflows/labeler.yml, .github/workflows/auto-pr-comment.yml |
Removes existing repository automation. |
.github/pull.yml, .github/labeler.yml, .github/ISSUE_TEMPLATE/config.yml |
Removes repository maintenance configuration. |
.pre-commit-config.yaml, .gitattributes |
Removes local validation and release-export rules. |
.dockerignore |
Defines the Ontogeny container build context. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- complete-operation refuses CANCELLED operations; assign-operation is QUEUED-only; record-inspection rejects negative defect counts; add-bom-line constrains scrap_rate to [0,1] (null defaults to 0) - new contract test covers all four hardened rules end to end - core/__init__ imports lint before exporting it via __all__ - tsconfig.node covers vitest.integration.config + tests-integration; the e2e helper's json typing fixed accordingly - upstream NOTICE merged into the root NOTICE (attribution verbatim), vendored copy removed; THIRD_PARTY.md curation record updated Function returns stay declared as string: the DSL type vocabulary has no union/object shape, and the three functions return success/failure unions that a struct declaration would misrepresent
bitflicker64
left a comment
There was a problem hiding this comment.
Blocking: yes. Summary: This lands Ontogeny at the repository root and moves the existing hugegraph-ai modules into third_party/, but the net diff against main also deletes the repository's own .asf.yaml, license-header config and every CI workflow for the modules it ships, replaces the NOTICE identity, and regresses the 1.8.0 release metadata. In the new platform, the default Docker/compose/daemon deployments give unauthenticated admin access (implicit dev-auth plus a fixed admin password), and several policy and masking paths fail open: anonymous principals match unscoped permits, resource clauses are ignored, marked values leak through filter/sort, the execute response and idempotent replay, and function invoke has no auth. The evolve loop's auto-rollback always raises and promotion ignores rejected status. The outbox, SQLite watermark sync, DDL and the HugeGraph 1.5 dialect each lose data or fail in normal use. The earlier Copilot threads on the domain YAMLs, core/__init__.py and tsconfig.node.json are fixed at this head. The NOTICE thread was resolved, but its point still applies, and a fresh comment explains why. The PR also currently conflicts with main (#372, #382, #384 landed after the merge base). Evidence: read the full change list at 50103fa (947 files: 380 added, 542 pure renames into third_party/, 20 deleted, 5 modified) and the diffs of every modified and deleted root file. Read all hand-written Python under server/, extensions/ and the workflows, Dockerfile, compose and daemon files in five parallel passes, plus the web API client, auth and action pages. Each finding was traced through its call path at this head, and several were reproduced with small scripts (policy decide, filter/sort leak, watermark skip, DDL keyword, declarative ${VAR}, engine loop). Skipped as vendored or generated: the 542 renamed third_party/ files (identical to 7729a1e), uv.lock, web/package-lock.json, images and fonts, and the docs screenshots.
bitflicker64
left a comment
There was a problem hiding this comment.
Blocking: yes. Summary: The 33 inline comments from the earlier review of this head (50103fa) still apply, since the code they point at is unchanged, and none has an author reply yet. This pass adds six findings that review did not cover. A marked value leaks through any expression-derived property built from it, and Cedar forbid statements are dropped without error. Any signed-in driver can delete another session's decided approvals, a sandboxed function that prints always fails with a 500, demoting the last administrator stops the next restart, and unauthenticated queries and traversals are unbounded. Evidence: read the full change list (947 files: 380 added, 542 pure renames into third_party/, 20 deleted, 5 modified) and the existing review threads. Reviewed the hand-written Python under server/ontogeny/: sandbox and child, policy engine, query engine, action runtime, agent broker and routes, auth service and routes, outbox, domain zip import, declarative functions and the expression language. Also grepped web/src for HTML-injection sinks, and all of them escape their input. Reproduced four findings at this head in the PR's own uv sync --frozen environment: the derived-property leak (validate() passes and the mask returns the raw value), parse_policy_set dropping forbid, FunctionSandbox.run raising JSONDecodeError for a function that prints, and ensure_admin raising after the last admin is demoted. Latest-head CI is green, and the PR currently conflicts with main. Skipped as vendored or generated: the 542 third_party/ renames, uv.lock, web/package-lock.json, fonts, images and doc screenshots. Most of web/src (about 30k lines) was only sampled.
5f55c3b to
fb23096
Compare
Dependency ReviewThe following issues were found:
|
There was a problem hiding this comment.
license-eye has checked 926 files.
| Valid | Invalid | Ignored | Fixed |
|---|---|---|---|
| 808 | 8 | 110 | 0 |
Click to see the invalid file list
- ontogeny/.dockerignore
- ontogeny/deploy/Dockerfile
- ontogeny/domains/product-manufacturing/policies/default.cedar
- ontogeny/domains/product-manufacturing/policies/production.cedar
- ontogeny/domains/product-manufacturing/seed/01_source.sql
- ontogeny/web/public/icons.svg
- ontogeny/web/src/assets/robot.svg
- ontogeny/web/src/assets/vite.svg
Use this command to fix any missing license headers
```bash
docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix
</details>
There was a problem hiding this comment.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
imbajin
left a comment
There was a problem hiding this comment.
Independent static review of version 2bd9668: .github/codeql-config.yml:18–31 uses paths-ignore for five Python implementation files, including the main service, API and authentication service. .github/workflows/codeql.yml:38–39 loads this configuration for Python analysis.
This excludes whole files from analysis, not only the path-traversal query. The comment claiming other security queries still analyze these file contents is therefore incorrect. A later green run would not demonstrate equivalent coverage.
Please retain these files in scanning and address or model confirmed false positives narrowly, rather than excluding whole files; align the explanatory comment with the actual scope. This is a public scan-coverage finding, not a reproduced vulnerability or an exploitability claim. No overall score is assigned.
Sources:
hugegraph-ai/.github/codeql-config.yml
Lines 18 to 31 in 2bd9668
hugegraph-ai/.github/workflows/codeql.yml
Lines 34 to 40 in 2bd9668
|
@imbajin You are right — Fixed in ef15706: removed |
bitflicker64
left a comment
There was a problem hiding this comment.
Blocking: yes. Summary: Six earlier findings still apply at e3b98ec (dev-auth on in the shipped --demo deployments, the published bootstrap admin password, marked values leaking through filters and non-snake_case properties, the unlimited 0 session budget, and the unlisted Orbitron font), and this pass adds 22 more. The outbox is never dispatched in a running server, commented-out permits still grant, and several sync, projection, builder and evolve paths lose or corrupt data.
The earlier review comments below still apply at e3b98ec; this head does not fix them.
- Important: The console bundles a subset of the Orbitron font under SIL OFL 1.1, but the root
LICENSE(whose only change is the http-to-https rewrite) andTHIRD_PARTY.mddo not mention it. ASF policy treats OFL as Category B, so a bundled copy must be listed inLICENSEwith a pointer to its license text. This file also declaresReserved Font Name: "Orbitron", and OFL clause 3 bars a modified version, which a subset is, from using that name.web/src/index.css:27loads it asorbitron-900-subset.woff2. Please list the font inLICENSE, and either ship it unmodified or rename the subset. (#380 (comment)) - Critical:
serve --demoturns on dev-auth unless the operator setONTOGENY_DEV_AUTH, and every shipped deployment runs--demoon a public interface.deploy/Dockerfile:52runsontogeny serve --demo ... --host 0.0.0.0,daemon.sh:89does the same withHOST=0.0.0.0, andcompose.yamlpublishes port 8000. None of them setONTOGENY_DEV_AUTH.cli.py:253copies this env intoos.environ,config.py:79reads it, andapi/deps.py:91-99then accepts any JSON inX-Ontogeny-Principalas the principal.require_adminonly checksprincipal.get("is_admin"). Socurl -H 'X-Ontogeny-Principal: {"id":"x","is_admin":true}'gets an unauthenticated caller all of/api/v1/admin/*, Python function source edits (code run by the platform) and evolve promote on a defaultdocker compose up. Please never enable dev-auth implicitly, never honouris_adminfrom the dev header, and keep the defaultFalse. (#380 (comment)) - Important: Filter and sort accept marked properties, so a caller without the marking can recover masked values exactly.
build_filterand the sort path (line 186) only refuse_-prefixed columns.QueryService.aggregatedenies a markedfieldbecause "avg/min/max answer to arbitrary precision", but itsfiltand the/queryfilter and sort reach these lines unchecked. On the demo domain, an anonymousPOST /api/v1/objects/material/querywith{"field":"unit_cost","op":"gt","value":N}changes which ids come back, andsort=[["unit_cost","desc"]]returns the true order, whileunit_costitself shows__masked__. A binary search onNrecovers the value. Please reject any filter or sort field whose marking the principal does not hold, inQueryService.queryandaggregate, before building the statement. (#380 (comment)) - Important: Rows come back keyed by column name, but masking and sync key by property name, so a property whose name is not already snake_case is never masked.
compiled.col()issnake(prop), androw_to_propsreturns the column keys.PolicyEngine.maskchecksprops.get(prop)with the property name, which isNoneforunitCost(columnunitcost) orunit-cost(columnunit_cost), so the marked value is returned unmasked under the column key. The sync insert and update paths (lines 225 and 233) lookpropsup by column name while sync builds it by property name, so values for those properties are written as NULL. No validator restricts property names to snake_case. Please either enforce snake_case property names in the validator, or map column names back to property names here and usecol()consistently insync_upsert. (#380 (comment)) - Critical: The bootstrap administrator gets a fixed, published password when
ONTOGENY_ADMIN_PASSWORDis unset:password = os.environ.get("ONTOGENY_ADMIN_PASSWORD") or "ontogeny@2026". The log line below repeats it, anddaemon.sh:32exports the same value as its default.ensure_admin()runs on everyinitialize(), so every fresh Docker, compose or daemon install hasadmin/ontogeny@2026withis_admin=True. That account can edit Python function source (PUT /api/v1/functions/{name}/source), which the route's own docstring calls arbitrary code execution on the platform.daemon.sh:17,19also ship private-network addresses (10.70.11.36:63302,10.22.32.25:18080) as defaults. Please refuse to start without a configured password (or generate a random one and print it once), and drop the internal IP defaults. (#380 (comment)) - Important: A session-creation budget override can only widen the plugin's limits.
_limitreturnsmax(int(v), 0)with0 = unlimited, soPOST /agent/sessionswithbudget={"steps":0,"wall_ms":0,"writes_per_session":0}from any signed-in driver gets an unlimited session, even though the validator rejectssteps <= 0in the plugin itself. Withapproval.writes: autothat means unlimited writes with no human in the loop. Please clamp overrides tomin(plugin_value, override)and reserve0 = unlimitedfor admins. (#380 (comment))
bitflicker64
left a comment
There was a problem hiding this comment.
Blocking: yes. Summary: Six earlier comments still apply at 382d725, including the Orbitron font that is still missing from LICENSE, and this pass adds eight findings in the document review flow, derivation batching, domain table ownership and the sandbox child. A superseded task or a removed document version can still be confirmed, and a large derivation batch overflows the new 256 KiB frame cap while holding outbox delivery.
The earlier review comments below still apply at 382d725; this head does not fix them.
- Important: HugeGraph builds PRIMARY_KEY vertex ids with
LongEncoding.encodeNumberfor numeric keys and escapes:,!,>and`in string keys, sof"{src_lid}:{s}"here and invertex_idnames vertices that do not exist for integer keys or such strings. Encode ids the waySplicingIdGeneratordoes and add a test with an integer key. (#380 (comment)) - Important: deletes run after the PolicySet sidecars are written, so a save that deletes and re-creates the same PolicySet (the console sends this after renaming
ptoqand back) unlinks thep.cedarit just wrote and publishespwith no statements. Applydeletesbefore writing any sidecar or YAML file. (#380 (comment)) - Important:
MountSource.kindand the console acceptmysql, butStoreSpec.typehas nomysql, so a MySQL mount writes astores/<name>.yamlthat fails to load, and every later publish of the package fails. AddmysqltoStoreSpec.typewithaiomysqlin an extra, or drop it from the API and console. (#380 (comment)) - Important:
/evalsetsstatus = "evaluated"on any proposal, so a rejected or superseded proposal becomes promotable again after an eval. Return 409 unless the proposal isproposedorevaluated. (#380 (comment)) - Important:
need()keeps the first type registered for a property name, so two projected objects that share a property name with different types get one HugeGraph key type, and HugeGraph rejects every vertex of the other object. Reject the conflict in the validator, or namespace property keys per label. (#380 (comment)) - Important: The console bundles a subset of the Orbitron font under SIL OFL 1.1, but the root
LICENSE(whose only change is the http-to-https rewrite) andTHIRD_PARTY.mddo not mention it. ASF policy treats OFL as Category B, so a bundled copy must be listed inLICENSEwith a pointer to its license text. This file also declaresReserved Font Name: "Orbitron", and OFL clause 3 bars a modified version, which a subset is, from using that name.web/src/index.css:27loads it asorbitron-900-subset.woff2. Please list the font inLICENSE, and either ship it unmodified or rename the subset. (#380 (comment))
- Add the ontology runtime, DSL and web console. - Include the example domain, extensions and backend tests. - Add deployment configuration and module CI. - Apply ASF license headers throughout the module.
The root ruff workflow runs format+check on the whole tree; the module now passes both under the root config (select E,F,W,I,C,N,UP,B,SIM,T20,RUF): - 121 files reformatted; ~140 findings fixed by hand or autofix (isort ordering, contextlib.suppress, raise-from chains, ClassVar, context-closure binding in bench tooling, exception-name suffixes, alias hygiene in tests) - root per-file-ignores extended in the repository's existing style: B008 for the FastAPI shell (Depends/Field defaults), T20 for tests and console tools, N815 for the DSL's camelCase wire fields, E501 for prompt/string literals where wrapping would change the text, SIM117 for nested MCP client contexts - core/__init__ resource re-exports declared in __all__ Full suite 582 passed
- Keep the module guide and bilingual documentation connected. - Restore the screenshots for the consolidated product flows. - Keep contributor-only review notes out of tracked documentation.
- Protect credentials, policy decisions and marked fields. - Enforce function permissions, agent budgets and action replay scope. - Guard evaluation, delivery ordering and synchronization. - Preserve deployment references and exercise boundary checks in tests.
- Gate derived markings at publish time and fail closed for resource clauses. - Check columns for collisions and mask action responses. - Refresh English screenshots and consolidate the related README cleanup. - Keep ASF headers on deployment files.
- Apply repository lint rules across the runtime and tests. - Align license scanning with domain fixtures. - Update dependency constraints and frontend lock entries. - Keep package and admin paths within their configured roots.
- Confine package and builder paths with canonical checks. - Tighten bootstrap credential and sandbox file handling. - Validate filesystem boundaries in security and identity tests. - Keep integration checks aligned with the runtime.
- Protect bootstrap credentials, agent sessions, and guarded reads. - Apply approvals, field markings, and builder validation before writes. - Persist generated IDs and guard live writes during evaluation.
- Preserve typed snapshots, watermarks, and ordered action effects. - Manage independent outbox acknowledgements and delivery lifecycle. - Strengthen deployment defaults, projection behavior, and PostgreSQL coverage.
- Commit schemas before publishing runtime snapshots. - Enforce typed keys, scoped idempotency, and administrator invariants. - Preserve sandbox frames, derived values, and query result ordering.
- Add the extraction, review, provenance, and task runtime. - Expose document workflow and ontology taxonomy APIs. - Introduce the chip-lifecycle demo, fixtures, and module guides.
- Expose document tasks and extraction review in the web console. - Display ontology resource kinds and document provenance. - Cover the workflows with console and integration tests.
- Link Ontogeny guides from the repository documentation. - Wire Ontogeny into selective CI and validate Python version floors. - Record the registry ownership rules for DSL kinds.
- Address runtime and document ingestion review findings. - Index pending outbox deliveries for efficient retry. - Scope newly discovered document identities by store.
- Scope evidence to matching extraction targets and mappings. - Apply deny decisions while retaining document provenance. - Retract withdrawn relationships and preserve those outside the extraction scope.
- Handle incomplete historical results and validate runtime targets. - Make evaluation replay and teardown handle partial state. - Add regression coverage for the reviewed failure paths.
- Require evaluation evidence before accepting evolution candidates. - Distinguish empty and coverage-only results from valid evaluations. - Cover acceptance, scope, and evaluation edge cases. Co-authored-by: imbajin <jin@apache.org>
- Batch table updates, document assertion writes, and related object lookups. - Limit relationship reads to the current page and traversal anchors. - Resolve typed relationship aliases while preserving declared string keys. Co-authored-by: imbajin <jin@apache.org>
- Apply document selectors and cache reads within the selected corpus. - Retire verified deletions while preserving stable document identities. - Signal subscription overflow so clients can resume from a fresh snapshot. - Document the affected scan and stream behavior. Co-authored-by: z <3042372703@qq.com> Co-authored-by: imbajin <jin@apache.org>
- Validate keyed replays against the current action schema and policy. - Recover the persisted replay winner after a contended SQLite write. - Recognize legacy logical selector names and prune unselected paths. - Preserve evidence when filesystem access prevents verification. - Report incomplete scans to listing, task, and ingest callers. Co-authored-by: z <3042372703@qq.com>
- Recreate policy sidecars after removing the previous resource. - Keep settled proposals closed during and after evaluation. - Reject unsupported mounts before touching the package and align console choices.
- Resolve typed primary keys and encode text IDs using HugeGraph conventions. - Deduplicate typed edge lookups and limit concurrent requests. - Reject incompatible projected field types before replacing graph data. - Verify mixed-key writes, reads, edges and archive against HugeGraph.
- Route import-time function diagnostics off the sandbox protocol stream. - Cover direct invocation and derivation with real child processes. - Expose the demo authentication override in Compose and document both launch paths.
- Share identical screenshots across the bilingual guides. - Replace obsolete demo instructions with the current chip-lifecycle case. - Remove the unused demo script and document the supplier-risk fixture tests. - Scope ignore and license exceptions to the Ontogeny files they cover.
- Keep superseded tasks immutable and attach uploads to active document IDs. - Validate candidate overrides and record only one pending decision. - Reserve extracted link tables across domains. - Bound derivation batches and retain the original agent status in diagnostics.


Purpose
This PR introduces Ontogeny as a standalone module in Apache HugeGraph AI. It is the first landing from the proposal in #376. The repository gains a way to model operational data and run governed actions over it alongside the existing graph and AI tooling.
flowchart LR Package["Git-managed ontology package"] --> Runtime["Ontogeny runtime"] Runtime --> Store["SQLite or PostgreSQL"] Runtime --> Projection["HugeGraph projection"] Runtime --> Clients["REST, MCP and Web console"]What ships
GraphRAG and ML integration are follow-up work. See the module guide.
Diff size
The diff adds 104,882 text lines. The backend, extensions and Web console account for 56,777 lines (54.1%). Tests and fixtures account for another 32.2%.
Each text file is counted once by purpose. Frontend tests sit in the tests row even when they share a directory with the implementation. Binary screenshots, icons and fonts are counted separately as 24 files.