Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ add_library(ark STATIC
src/authoring_024b.cpp src/media_authoring.cpp src/appearance_024b.cpp src/plane_sections_024b.cpp
src/authoring_023b.cpp src/cad_import.cpp src/holes_orchestrator.cpp src/design_containers.cpp
src/parametric_components.cpp src/parametric_programs.cpp
src/geometry_nodes_078b.cpp
src/design_variants.cpp src/design_review.cpp
src/surface_quality_068b.cpp src/surface_network_068b.cpp src/surface_operations_068b.cpp src/surface_offset_068b.cpp
src/design_disciplines.cpp
Expand Down Expand Up @@ -279,6 +280,21 @@ endif()
add_executable(ark-evaluation-scheduler-070a-tests tests/evaluation_scheduler_070a_tests.cpp)
target_link_libraries(ark-evaluation-scheduler-070a-tests PRIVATE ark)
add_test(NAME evaluation-scheduler-070a COMMAND ark-evaluation-scheduler-070a-tests)
add_executable(ark-geometry-nodes-078b-tests tests/geometry_nodes_078b_tests.cpp)
target_link_libraries(ark-geometry-nodes-078b-tests PRIVATE ark)
add_test(NAME geometry-nodes-078b COMMAND ark-geometry-nodes-078b-tests)
add_executable(ark-resource-scheduling-078b-tests tests/resource_scheduling_078b_tests.cpp)
target_link_libraries(ark-resource-scheduling-078b-tests PRIVATE ark)
if(ARK_WITH_OCCT)
target_compile_definitions(ark-geometry-nodes-078b-tests PRIVATE ARK_GEOMETRY_NODES_NATIVE_TESTS=1)
add_dependencies(ark-geometry-nodes-078b-tests ark-occt-worker)
target_compile_definitions(ark-resource-scheduling-078b-tests PRIVATE ARK_RESOURCE_SCHEDULING_NATIVE_TESTS=1)
add_dependencies(ark-resource-scheduling-078b-tests ark-occt-worker)
add_test(NAME resource-scheduling-078b COMMAND ark-resource-scheduling-078b-tests $<TARGET_FILE:ark-occt-worker>)
else()
add_test(NAME resource-scheduling-078b COMMAND ark-resource-scheduling-078b-tests)
endif()
set_tests_properties(resource-scheduling-078b PROPERTIES TIMEOUT 60)
if(ARK_WITH_OCCT)
target_compile_definitions(ark-evaluation-scheduler-070a-tests PRIVATE ARK_SCHEDULER_NATIVE_TESTS=1)
add_dependencies(ark-evaluation-scheduler-070a-tests ark-occt-worker)
Expand Down Expand Up @@ -847,7 +863,7 @@ if(WIN32)
add_test(NAME studio-${check} COMMAND ark-studio --self-test-${check} --settings-file "${ARK_STUDIO_TEST_ARTIFACT_ROOT}/${check}.settings.json" --shot "${ARK_STUDIO_TEST_ARTIFACT_ROOT}/${check}.png" --size 1280 800)
set_tests_properties(studio-${check} PROPERTIES TIMEOUT 300 RUN_SERIAL TRUE)
endforeach()
foreach(check surface-quality-ui surface-network-ui surface-operations-ui surface-offset-ui design-variants-ui component-library-ui design-review-ui inertial-ui viewport-quality-ui connectors-ui local-models-ui viewport-dock-ui context-ui suspension-ui assistant-steering-ui assistant-chat-ui chat-dock-ui parametric-role-ui stamps-ui media-044b-ui planes-sections-ui holes-orchestrator-ui design-container-ui parametric-graph-ui design-disciplines-ui cad-import-ui native-vertex-pull-ui advanced-sheetmetal-ui specialized-pattern-ui drawing-viewport-ui direct-authoring-ui parametric-authoring-ui selection-glow-ui selection-picking-ui image-attachment-ui sketch-edit-ui sketch-drawing-ui typed-sketch-ui arc-ui assistant-ui render-ui action-icons-ui interaction-ui baked-motions-ui exploded-views-ui drag-chain-ui)
foreach(check surface-quality-ui surface-network-ui surface-operations-ui surface-offset-ui design-variants-ui component-library-ui design-review-ui inertial-ui viewport-quality-ui connectors-ui local-models-ui viewport-dock-ui context-ui suspension-ui assistant-steering-ui assistant-chat-ui chat-dock-ui parametric-role-ui stamps-ui media-044b-ui planes-sections-ui holes-orchestrator-ui design-container-ui parametric-graph-ui geometry-nodes-ui design-disciplines-ui cad-import-ui native-vertex-pull-ui advanced-sheetmetal-ui specialized-pattern-ui drawing-viewport-ui direct-authoring-ui parametric-authoring-ui selection-glow-ui selection-picking-ui image-attachment-ui sketch-edit-ui sketch-drawing-ui typed-sketch-ui arc-ui assistant-ui render-ui action-icons-ui interaction-ui baked-motions-ui exploded-views-ui drag-chain-ui)
add_test(NAME studio-${check} COMMAND ark-studio --self-test-${check} --settings-file "${ARK_STUDIO_TEST_ARTIFACT_ROOT}/${check}.settings.json" --shot "${ARK_STUDIO_TEST_ARTIFACT_ROOT}/${check}.png" --size 1440 900)
set_tests_properties(studio-${check} PROPERTIES TIMEOUT 180 RUN_SERIAL TRUE)
endforeach()
Expand Down
101 changes: 101 additions & 0 deletions docs/AGENT_CONTEXT_078B.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# 078B — bounded graph context and Obsidian navigation

**D.02 / D.05 / A.03 / A.04 — Em curso**, pending final native integration tests.

The live CAD graph, the typed Geometry Nodes view, the repository AST graph and
historical memory are separate sources. This work gives each a small, explicit
navigation contract instead of treating a truncated response as the whole model.
It makes no measured provider-cost or design-quality claim and adds no agent
turn/token execution budget.

## Live context

- `context_graph` preserves the existing schema and read-only behavior, with
direction-aware, deterministic pages. Cursors bind source, project, revision
and selection; stale or malformed continuations reject.
The first agent-attributed graph read/batch reserves its audit identity before
producing a scoped cursor, while still recording only the actual action once.
Usage/feedback bookkeeping does not enter the saved-authoring source hash;
ordinary audit recording therefore cannot invalidate its own continuation.
- Boundary edges and nodes remain when delta fingerprints omit unchanged facts.
Incident edges include both directions even when node traversal is directed.
Internal/boundary edges share a128-edge chunk; `next_call` continues those
edges without repeating node facts before advancing the node slice. Wide
boundaries truncated beyond64 nodes remain reachable through expansion and
continuation. Navigation never bypasses `expected_revision` or native inspection.
- Graph construction indexes parameter names and incident edge indices rather
than scanning every node for each expression token and every edge per node.
The existing authored-data/incident-link fingerprint representation is retained.
- Request-history projection preserves distinct pagination/frontier receipts.
There are no new live provider calls or inferred claims of better designs.

## Geometry-node discovery

`agent_onboard{topic:"geometry_nodes",detail:"guide"}` exposes the actual
`geometry_graph` tool through specialist discovery. The preloaded overview
points to that guide without adding a full specialist contract to every turn.
`inspect` accepts selected `ids`, a default16/max64 `limit`, and a current-source
cursor. It returns metadata/ports and a bounded incident-link excerpt, with
`context_call` for full adjacent discovery and `next_call` for remaining nodes.
Native source payloads and full parameter tables are absent from the overview.

The Studio canvas retains its complete compact snapshot. Agents use catalog and
selected context before preparing add/edit/link/disconnect/remove and publishing
the validated candidate. Direct socket admission distinguishes mesh/surface/solid;
it is not a whole-project type proof. Exact sampling into mesh remains explicit.
Team preparations use the same checked-recipe ownership, role operation scope,
step limits, source revision and project epoch guards as other prepared workflows.
Only the owning role can publish its retained node candidate. Reviewers receive
an inspect/catalog-only schema; backend permission checks still reject prepare
and publication. The geometry guide retains the global explicit-user-request
rule for technical drawing work.

## Provider catalogue compatibility

The provider's128-function limit is unchanged. The host reserves a slot for an
enabled HTTP `result_get` helper before composing the shared Team catalogue.
Only when space is needed, exact proposal reading is advertised through
`team_context{proposal_id}` instead of its redundant `team_proposal` name. If
another slot is necessary, release is advertised through
`team_reserve_write{release:true,reservation_id}` instead of `team_release_write`.
Schemas, role instructions and proposal notices identify the active aliases.

The original proposal read and release paths still perform the operation,
including owner/token checks and idempotent release. Neither alias applies,
rebases, renews or grants a write. Legacy dispatch and non-crowded catalogues
remain available; CAD capabilities are not dropped to fit. A catalogue that
still cannot fit rejects explicitly. Isolated part specialists retain their
private interface and cannot use aliases to browse the parent Team store.

## Obsidian

Each new code export has an attested `ARK Context.md` start page and a location-
coverage receipt. Both carry the current source/graph identities and real links
to exported notes/canvas. Unlocated symbols, unsupported syntax and partial
extraction remain explicit limitations. A graph link grants no write authority.

Combining memory now checks that the selected Obsidian snapshot and current code
index describe the same source/graph, and checks that inventory again before
publishing. A stale/mutated input leaves the earlier current pointer intact.
Refresh code export first; memory anchors still carry their own current/stale
source status and historical attribution. No personal vault is overwritten.

## Verification

- PowerShell code-context tests: **55 checks passed**, actual pinned offline
Graphify on synthetic source; zero model calls.
- Combined memory-vault tests passed, including real held-reader publication
contention, source tampering, stale code-index rejection, prior-pointer and
edited-export preservation, and current/stale/unsafe anchor handling.
- Native test coverage added for pagination, large boundaries, cursor staleness,
incoming/outgoing205-leaf stars, dense256-edge slices, aggregate edge identity
coverage, deltas, no evaluation/mutation, geometry specialist discovery and600KB synthetic
native payload exclusion from graph overview. Native integration passed:
783 graph checks, 233 onboarding checks, 349 geometry-node checks and the
complete 210-suite native/script regression. Team catalogue, candidate custody
and read-only review checks passed. No live-provider quality comparison is claimed.
- Compatibility regressions exercise normal/isolated Team catalogues with and
without result handles, exact proposal read parity, actual foreign-owner
release rejection, private-scope denial, and real node prepare/owned apply
versus foreign/readonly attempts. Integration execution remains the delivery
gate for these follow-up fixes.
45 changes: 45 additions & 0 deletions docs/CONTEXT_GRAPHS_034D.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,40 @@ there are no other relevant nodes. Query words match names, kinds and compact
facts; exact selectors reject missing or repeated keys. Geometry buffers stay
local. Use `object_context` and native inspection for actual selected geometry.

078B adds deterministic continuation without increasing response limits.
`direction:both|outgoing|incoming` filters traversal by the stored edge direction;
it does not reinterpret every relationship as a geometric dependency. `page`
reports matching roots, the requested neighborhood size and `has_more`.
Call `context_graph` with the returned `next_call` arguments for the next page.
Its cursor binds project scope, saved-authoring SHA-256, revision and exact
query/keys/depth/direction/limit/history selection. Any mismatch rejects and
requires fresh discovery, including an in-place source edit at the same revision.
Usage, audit and journal bookkeeping are excluded from that source projection.
An agent-attributed first read or read batch establishes its activity identity
before returning scoped continuation, then records the normal single action.
Its own audit/feedback updates do not immediately invalidate the returned cursor.

`frontier` and `boundary_edges` retain omitted incident neighbors even when known
fingerprints omit unchanged node facts. The frontier excerpt is bounded to64
nodes; internal `edges` and `boundary_edges` share a128-edge page, with exact
counts and offsets. Edge reporting includes **all incident edges** of the node
slice, independent of the direction used to traverse nodes. This prevents a
root-to-leaf edge from disappearing when only its leaf is on a later page.

`next_call` drains remaining edges before advancing to the next node slice.
Its optional cursor `edge_offset` is bound to that slice and the same source,
revision and selector. Edge-only continuations have empty `nodes` and preserve
the earlier node facts; edge identities can overlap across endpoint slices.
Aggregate both edge arrays and deduplicate identities. `page.has_more` and
`partial` include pending node **or edge** chunks; `nodes_have_more` and
`edges_have_more` distinguish them. No page claims unbounded edge transport.
`expand_call` expands from
the whole current page, so its own continuation can reach neighbors beyond that
excerpt. `page.depth_boundary_nodes` separately describes an unexpanded radius.
Neither `partial:false` nor a completed page proves full dependency closure.
Feature rows expose observed/conservative `geometry_domain` even in delta reads;
the domain is not geometric or manufacturing certification.

Supply the received `known_scope` and `known_fingerprints` to omit unchanged
node facts. Fingerprints cover that node's authored data and incident links;
they do not certify its evaluated geometry or an unchanged transitive dependency.
Expand Down Expand Up @@ -83,6 +117,8 @@ and source hash. Delta facts can be restored only from exact prior
scope/key/fingerprint matches. An unrated action stays exact until a successful
`tool_feedback` receipt contains its ID. Different sources/scopes, incomplete
call/output pairs, errors, writes and candidate receipts are not deduplicated.
078B also retains distinct page, frontier, boundary-edge and continuation
receipts. Identical node facts alone cannot erase a route to omitted context.

Only the outbound request changes, and only when its actual serialized size is
smaller. Full host history and exact user/role messages remain. The continuation
Expand All @@ -108,6 +144,15 @@ Only allowlisted source extensions under `src`, `include`, `tests`, `scripts`
and `cmake` enter an owned snapshot. User CAD files, sessions and environment
files are excluded. The optional tool is not bundled into the ARK runtime.

New exports include `ARK Context.md` and `.ark-context-navigation.json`, bound
to the same code/graph fingerprints as the vault. They link the actual canvas,
available code cards and curated guides, and report files/nodes without source
locations and relation-confidence counts. This is location coverage, not a claim
of complete parsing or dependency analysis. Old edited exports remain untouched.
The combined memory exporter now rejects a selected code vault whose source/graph
differs from the current code-index manifest, and guards that manifest during
publication. Refresh with `code-context.ps1 -Obsidian` before combining memory.

The source manifest hashes each input and the generated graph. Changed/deleted
inputs or a changed graph invalidate reuse. The wrapper conservatively performs
a full extraction after source changes, verifies source did not change during
Expand Down
41 changes: 41 additions & 0 deletions docs/DISPLAY_MEMORY_078B.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Display memory allocation — 078B

**A.04 / B.01 — Verificado no escopo local**, on the native Windows Studio and
NVIDIA RTX 4080 SUPER used for the checks.

Display meshes retain the existing exact source hash, shared GPU handles,
float32 positions, triangle order and SNORM16 display normals. Exact B-reps,
picking sources and authored geometry are independent of these buffers.

New uploads first sample available driver memory and reclaim unreferenced
buffers when the incoming allocation needs headroom. Live handles are never
evicted. Unknown telemetry uses a conservative idle allowance; approximate
driver counters do not reject valid geometry or reserve memory in advance.

The source identity is hashed as consecutive existing buffers with Windows
CNG instead of concatenating another complete positions/normals/index string.
The digest remains byte-identical. The existing concatenation fallback remains
available if platform hashing cannot run.

Packed vertices upload in blocks of at most 65,536 vertices (1.25 MiB), rather
than allocating a full second packed mesh in host RAM. The final GPU buffer
size and contents are unchanged. Indices upload directly from their existing
CPU storage. Resources shows active/idle/peak mesh-buffer bytes and peak upload
staging, separately from process-wide driver memory, textures and framebuffers.

A failed allocation preserves an existing handle passed to that upload, frees
unfinished new buffers and leaves an explicit display warning. The Resources
dialog offers a rendering retry. This does not roll back already committed
authoring; a scene containing new parts can remain partly undisplayed until
rendering succeeds. It must never be mistaken for a successful full display.

Verification includes deterministic pressure-policy checks, exact segmented
hash parity, actual OpenGL readback across upload chunk boundaries, display
frame comparisons, live-handle protection and an injected allocation failure.
The injected failure is not evidence of a real driver out-of-memory event.

The real GL fixture passed with 1.8 million source vertices and a maximum
1,310,720-byte packed upload staging buffer. Chunk-boundary bytes, source-normal
hash sensitivity, active sharing, idle eviction and rendering recovery were
checked; captured source/rendering state remained unchanged. This is a staging
bound, not a claim that all process RAM or total GPU memory fits that size.
Loading
Loading