feat(agent-runtime): add advisory procedural graphs and guarded candidate screening - #585
Conversation
…ndidate screening Refs #584 and ContextualWisdomLab/.github#2067. Add isolated advisory graph/session values, held-out paired evidence screening, contextual rejection identity, 89 focused regressions, and proposed ADR-0016. No runtime route, provider, credential, package, workflow, or activation changes. Local adapted-runner evidence does not replace native exact-head CI or review.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
seonghobae
left a comment
There was a problem hiding this comment.
Current-head review on 5813ee1cb8958aa25e622fe31adfa8dc229f2e3c found one deterministic repository-contract defect before native CI can be treated as merge authority. Protected test/rate-limit-public-api-docs.test.ts recursively inventories every direct src/**/*.ts export, requires adjacent meaningful JSDoc longer than 80 characters for each export, and additionally requires @param and @returns on exported callables. The new source exports undocumented interfaces including ProceduralEdge, ProceduralGraph, ProceduralContext, ProceduralSession, and ProceduralCandidateDecision; several exports in procedural-input.ts have no meaningful adjacent JSDoc; and exported callables such as createProceduralGraph, startProceduralSession, and assessProceduralCandidate do not currently carry the required parameter/return tags. The adapted 89-test authoring evidence did not exercise this repository-wide inventory gate.
This is a valid source/documentation finding, not a reason to weaken the gate. Minimal causal repair is to document every retained public export to the protected contract (or make an export non-public only where it is genuinely not needed across module boundaries), preserving the advisory-only/foreign-owner boundaries. Then rerun native exact-head typecheck/full tests and all four hosted gates on the successor exact. I did not mutate this separately claimed branch and this review is COMMENT only, not self-approval.
|
@coderabbitai full review Please review exact head Publication verification: all three source files and both test files were fetched through their exact-commit GitHub blob identities and matched against locally tested bytes. A fresh run of those matching sources again passed 89/89 focused assertions. Scoped compiled-module line/branch/function coverage is 100%; native whole-repository coverage and pinned-runtime verification remain unproven. Observed hosted state on this head: CodeQL completed SUCCESS; application Owner follow-through is now recorded in ContextualWisdomLab/context-graph-contracts#28, ContextualWisdomLab/enterprise-architecture-core#50, ContextualWisdomLab/contextual-orchestrator#1116 and ContextualWisdomLab/psychometrics-commons#447, all under ContextualWisdomLab/.github#2067. Path-scoped authoring claim from #584: RELEASED for this published seven-file slice on handoff. This means source-writer coordination only, not a software release. A successor should refresh live head/base/checks/review threads, claim the appropriate paths, repair native CI/review findings, reconcile ADR/traceability through the existing docs owner, and use ordinary protected governance. Do not overwrite #583's unrelated baseline lane, consume sibling PR heads, close valid deltas without carryover, or promote from these local results. |
|
I will assess the specified security and correctness boundaries. I will not approve, waive checks, merge, or deploy the PR.
|
seonghobae
left a comment
There was a problem hiding this comment.
A second current-head repair finding is authoritative and independent of the JSDoc issue: this PR adds docs/adr/0016-procedural-graph-guidance.md and labels it ADR-0016, but protected main@b946d04236613544ceedb2160ed68b4e6d855dd8 already contains docs/adr/0016-avoid-repository-git-conversion-execution-in-acquisition-preflight.md, also ADR 0016, Proposed on 2026-09-10 for #575/#576. This is a real ADR identity collision, not a reason to replace or renumber the protected acquisition decision.
Repair the new procedural-graph ADR to the next genuinely unused ADR number after a fresh protected-directory inventory, and update every reference in this PR (implementation plan, tests or prose if any) atomically. Keep it Proposed; do not mark it Accepted from source implementation. I am leaving the separately claimed branch untouched and am not treating either queued CI generation as evidence.
|
One additional code-current requirement should be handled when repairing this Draft: protected For the ADR index, avoid racing the active #583 documentation lane: #583 now carries the missing index row for already-protected acquisition ADR 0016. Repair this PR's ADR identity first; after #583 integrates, non-force reconverge on protected main and add the new Proposed procedural ADR to the then-current index rather than overwriting #583 or consuming its mutable head. |
Repair the exact #585 CI finding by documenting every newly exported TypeScript API with meaningful adjacent JSDoc and explicit parameter/return contracts. No runtime, schema, authority, or evaluation behavior changes.
|
Resuming the user-authorized procedural-graph adoption work from live #585 |
…al sessions Preserve the concurrently published assertProceduralSession owner and its regressions, ADR-0017, and Unreleased entry. Reuse runtime-shared execution identity rather than a narrower graph-node grammar. Add hostile lookalike, proxy, control-character and length-bound tests. Observed RED on the predecessor accepted runtime IDs but rejected graph sessions for run@workflow+attempt=1 and _run:attempt#1. Integrated local compiled-source battery: 140/140 assertions pass across parent and child candidate sources; native exact-head repository CI remains mandatory. Refs #584, #585, #586 and ContextualWisdomLab/.github#2067.
seonghobae
left a comment
There was a problem hiding this comment.
Current-head review on a99b8615c0959252e6fa78029203e9983f840356: the earlier repository API-doc RED, ADR-0016 identity collision, missing Unreleased record, structural-session admission gap, and narrower-than-runtime execution-ID grammar all have causal successor repairs in this branch. I reproduced the structural-session bypass against the predecessor source locally (forged frozen session returned arbitrary advisory context), then verified the branded-session repair rejects the copied session while preserving a genuine session. The concurrent a99b8615... successor preserves that boundary and correctly delegates execution identity to the existing Agent Runtime owner. No open review thread remains from this pass. Keep Draft: all four current-head hosted gates are newly queued and predecessor GREEN does not transfer; after #583 merges, ordinary/non-force reconvergence plus ADR-0017 index reconciliation is still required before readiness.
seonghobae
left a comment
There was a problem hiding this comment.
Current-head review on 8b63edbb7d88bfc7536b3f66bd030e2c8b5d74af: the procedural-graph slice remains bounded to Noema Agent Runtime advisory mechanics. Graph/session admission is local and execution-scoped, candidate screening keeps activationAuthorized: false, and the canonical Architecture/PRD/TRD/UML/TRACEABILITY/TEST_STRATEGY/OPERABILITY/product-gap documents now preserve the same owner and non-authority boundaries. The reviewed exact diff does not introduce workflow/provider credential/routing, foreign domain truth, persistence, HTTP activation, or Policy/Approval substitution. No current inline thread exists. This is a COMMENT review, not self-approval; final readiness still depends on unchanged-head terminal CI/reviewer/Security/image evidence and a fresh live-base/governance read.
seonghobae
left a comment
There was a problem hiding this comment.
Current-head repair review on a91098e3c6952d1c3ab9eba02f45172997aee7c9: hosted application CI 34424836355 on predecessor exact 8b63edbb... gave a real repository RED after typecheck: release tests ended 4,457 passed / 1 failed because test/documentation-current-trust-authority.test.ts still asserted the pre-#583 dated observation main@b946d042... while the current candidate baseline deliberately records the post-#583 protected observation main@748970213.... The one-commit compare from the failed exact changes only that single expected SHA (1 insertion / 1 deletion) and leaves runtime, procedural graph semantics, workflows, dependencies and authority boundaries untouched.
This is the minimum causal fixture repair; the test continues to require live-current authority wording, a dated exact observation, the immutable central consumer pin, and rejection of an evergreen frozen current-main claim. No predecessor GREEN transfers: all four hosted generations have restarted on a91098e3.... I found no additional source finding in this repair pass. Keep Draft until current exact application CI, reviewer-ci, required Security Scan and patch-validator-image are terminal SUCCESS and the live base/ruleset remain unchanged. COMMENT only, not self-approval.
seonghobae
left a comment
There was a problem hiding this comment.
Current-head review on 0ee2992825dfc79e07efa6aff6fc3f385db1a5ee: this is the root repair for hosted application CI 34424836355's real 4,457-pass / 1-fail documentation-authority RED. The failed exact hard-coded one historical Dated protected observation SHA in the executable test. Merely changing that SHA at a91098e3... would have repeated the same failure class on a future legitimate dated observation, so the successor now validates the authority category instead: one syntactically valid 40-lowercase-hex dated protected observation, while retaining the live-current-authority requirement, immutable central consumer pin, moving-vs-pinned distinction, merged #582 evidence, and explicit rejection of an evergreen Current protected source ... main@<sha> assertion.
The two-commit delta from the failed exact remains confined to test/documentation-current-trust-authority.test.ts; no Agent Runtime behavior, procedural graph semantics, workflow, dependency or foreign-owner boundary changed. I found no additional valid source finding in this pass. All older and a910... hosted generations are predecessor evidence only. Keep Draft until the four fresh 0ee299... generations are terminal SUCCESS and live base/ruleset remain compatible. COMMENT only, not self-approval.
seonghobae
left a comment
There was a problem hiding this comment.
Current-head hostile-input review on bed1629e0020b109a0fefb001edea0f718aaa066: a valid provenance defect was found and repaired without broadening authority. At predecessor source, ProceduralGraphError's exported constructor itself inserted the object into the private proceduralErrors WeakSet. Any caller importing the class could construct an attacker-message error and throw it from a Proxy trap; normalizeProceduralError() would then preserve that message as though Noema had originated it. Test-first 4707f0a90a5fad0fb4656e44aa274e28d8a23ffc adds this exact hostile case. It was succeeded before shared hosted runners assigned, so it is test-first RED lineage rather than a claimed hosted terminal RED.
The causal fix keeps the public error shape but makes provenance constructor-independent: only private ownedProceduralError() inserts into the WeakSet, and both normal rejection and foreign-error normalization use that factory. Caller-created ProceduralGraphError values therefore normalize to fixed unreadable_input; genuine locally issued domain errors retain their stable code. This is the same capability/admission principle already used for graph/session WeakSets and does not import security truth from another product. I found no further valid source finding in this pass. Fresh exact-head gates are required; COMMENT only, not self-approval.
seonghobae
left a comment
There was a problem hiding this comment.
Current-head review on 58ec47e617d4ad1e0fe5199516b807707b4a38e5: the two error-provenance paths are now fail-closed against caller-selected arbitrary text, the verification record reflects the already-shipped Unreleased entry, and the TRD reference authority removed by the candidate documentation edit has been restored. I found no additional source-level finding in the reviewed delta that justifies another mutation in this lane. This is COMMENT evidence only, not approval or readiness: all predecessor workflow evidence is invalidated and the unchanged current exact still needs native application CI, reviewer-ci, required central Security Scan and patch-validator-image to finish successfully.
seonghobae
left a comment
There was a problem hiding this comment.
Current-head documentation review found one stack-direction defect that blocks readiness even though application CI, reviewer-ci and patch-validator-image are now GREEN. docs/TRD.md on exact 58ec47e617d4ad1e0fe5199516b807707b4a38e5 declares docs/doctoring/procedural_graph_adoption.md as the procedural method/adoption evidence source, but that path does not exist in this parent exact; it currently exists only in stacked child #586. A canonical parent document therefore contains a broken local reference and implicitly depends on a mutable downstream branch. This is repair-not-close. The smallest non-destructive repair is to make the adoption record an actual parent-owned Proposed documentation artifact (preserving its explicit source/shadow/canary/non-authority boundaries), or remove the child-only pointer from the parent TRD. Do not treat #586's mutable head as parent documentation authority. Any source repair invalidates the current exact-head checks and requires fresh four-gate evidence. COMMENT only, not self-approval.
seonghobae
left a comment
There was a problem hiding this comment.
Current-head repair review on aa954e60a4ed1a940dd4eb118bc74854ac0b2491: the broken canonical TRD reference found on 58ec47e... is causally repaired without importing mutable child authority. The exact adoption-record blob c0684c52d5d4c41b2d240f3ada3ce6d6d5a62755 now exists on the parent branch at docs/doctoring/procedural_graph_adoption.md, remains explicitly Proposed implementation and rollout record, not release or deployment acceptance, and names #586 as a separate lifecycle candidate rather than claiming it is protected source. No runtime, workflow, credential, provider, Policy/Approval or foreign-owner source changed. #586 was ordinary/non-force reconverged onto this parent and its current parent→child delta is now four execution-gating paths, so the doctoring artifact has one parent owner instead of a reverse child dependency. All 58ec47e... GREEN checks are predecessor evidence only; keep Draft and require fresh four-gate evidence on this exact. COMMENT only, not self-approval.
seonghobae
left a comment
There was a problem hiding this comment.
Current-head review on c016ee1073fb0ea1d5152100cc90ff3678ed0d84: the documentation-stack repair now has an executable regression. test/documentation-current-trust-authority.test.ts verifies that canonical docs/TRD.md references docs/doctoring/procedural_graph_adoption.md, that the path exists in the parent source, and that the record remains explicitly Proposed/non-release with #586 identified as a separate lifecycle candidate. The adoption record itself is parent-owned at the same reviewed blob previously present in #586; no runtime or foreign-owner source changed. #586 has ordinary/non-force reconverged and exact parent→child compare remains four execution-gating paths. I found no additional parent-specific source finding in this pass. All earlier exact-head GREEN is predecessor evidence; keep Draft until c016ee... earns fresh application CI, reviewer-ci, required Security Scan and patch-validator-image. COMMENT only, not self-approval.
Scope and tracking
Implements the first deterministic Noema source slice of ContextualWisdomLab/.github#2067; relates to #584. This is a library-only Agent Runtime candidate, not organization-wide activation or a deployed self-evolving agent.
Current exact head:
c016ee1073fb0ea1d5152100cc90ff3678ed0d84.Current protected base:
main@748970213509d1383115c4196ed99fc9ee49742eat the latest observation; re-fetch livemainimmediately before merge.Current compare contains 20 paths: three Agent Runtime modules, four focused/executable test files, Proposed ADR-0017 and index row, implementation/verification plan,
CHANGELOG.md, canonical Architecture/PRD/TRD/UML/TRACEABILITY/TEST_STRATEGY/OPERABILITY/product-gap documentation, and parent-owned Proposed method/adoption evidencedocs/doctoring/procedural_graph_adoption.md. No workflow, credential, dependency, provider-routing, existing lifecycle implementation or foreign-owner source is changed.Implemented behavior
activationAuthorized: false. No receipt authentication, durable history, LLM-edit publication, tool authority, Policy/Approval substitution, provider routing or product-domain truth is introduced.DDD / owner boundaries
Noema owns graph/session admission, execution-local bounded advisory context, deterministic candidate screening, and its own procedural error normalization. Released cross-service schemas belong to
context-graph-contracts; enterprise adoption records toenterprise-architecture-core; model discovery/routing tocontextual-orchestrator; credentials to Keyverse; graph/evaluation/outcome truth to consuming products. Mutable sibling PR heads are not production authority.The candidate is deliberately non-durable. Graph/content digests and
eligibleForApprovalare local evidence, not signatures, activation authority or rollout permission. Authenticated evaluation receipts, durable graph/rejection history, current-lifecycle/revocation authority, Policy/Approval CAS, canary/rollback and product outcome evidence remain later boundaries. ADR-0017 stays Proposed.RED → causal repairs → convergence
5813ee1...passed typecheck but produced a real release-test RED at 4,443 pass / 1 fail on the public TypeScript API documentation gate; the successor repaired missing meaningful JSDoc and parameter/return contracts.main@748970...; no force update or destructive rebase was used.8b63edbb...produced a real 4,457-pass / 1-fail RED because an executable documentation-authority test froze a historical protected SHA. The root repair validates the authority category rather than replacing one frozen SHA with another.ProceduralGraphErrorconstruction and exported rejection-helper input can no longer manufacture arbitrary locally trusted error text.58ec47e...restored the canonical TRD References section. Fresh review then found the referenceddocs/doctoring/procedural_graph_adoption.mdexisted only in stacked child feat(agent-runtime): gate procedural guidance by execution lifecycle #586, leaving a broken parent-local reference and reverse mutable child dependency.aa954e60a4ed1a940dd4eb118bc74854ac0b2491promoted the exact existing Proposed adoption-record blob into feat(agent-runtime): add advisory procedural graphs and guarded candidate screening #585. It remains explicitly a Proposed implementation/rollout record and identifies feat(agent-runtime): gate procedural guidance by execution lifecycle #586 as a separate stacked candidate; no runtime or foreign-owner authority moved.c016ee1073fb0ea1d5152100cc90ff3678ed0d84adds the executable regression intest/documentation-current-trust-authority.test.ts: canonical TRD must reference the parent-local adoption path, that path must exist, and the record must retain its Proposed/non-release status plus explicit feat(agent-runtime): gate procedural guidance by execution lifecycle #586 linkage. This prevents silently recreating the reverse child dependency.Every source mutation invalidates predecessor workflow evidence. GREEN on
58ec47e...and the short-livedaa954e...generation do not transfer toc016ee....Required verification and stack order
Keep Draft until unchanged exact
c016ee1073fb0ea1d5152100cc90ff3678ed0d84has terminal application CI, reviewer-ci, required central Security Scan and patch-validator-image success, plus current-head review with zero valid unresolved findings and a fresh live-base/ruleset read. Formal independent approval is required only if fresh live governance actually requires it; protected AGENTS currently keeps code-owner approval on hold for the solo-maintainer repository.#586 remains stacked and must not merge first. After #585 normally integrates, #586 must retarget/reconverge non-force to fresh protected
main, preserve its four-path child delta, and earn its own unchanged exact-head application CI, reviewer-ci, required central Security Scan, patch-validator-image and current-head review. Do not self-approve, bypass gates, force-push/destructively rebase or reuse predecessor GREEN.