Skip to content

feat(agent-runtime): add advisory procedural graphs and guarded candidate screening - #585

Merged
seonghobae merged 28 commits into
mainfrom
feat/procedural-graph-core-20260910
Sep 10, 2026
Merged

feat(agent-runtime): add advisory procedural graphs and guarded candidate screening#585
seonghobae merged 28 commits into
mainfrom
feat/procedural-graph-core-20260910

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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@748970213509d1383115c4196ed99fc9ee49742e at the latest observation; re-fetch live main immediately 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 evidence docs/doctoring/procedural_graph_adoption.md. No workflow, credential, dependency, provider-routing, existing lifecycle implementation or foreign-owner source is changed.

Implemented behavior

  • Canonical, content-addressed, deep-frozen tenant/task/graph snapshots and execution-pinned advisory sessions.
  • Module-local admission for graphs/sessions and closed-code provenance for locally originated procedural validation errors; structural lookalikes or caller-created errors do not gain local authority.
  • Execution IDs reuse the canonical Agent Runtime identity grammar and bound.
  • Strict schema/resource bounds, cycle-safe bounded traversal, and explicit abstention for unknown procedures or exceeded context budgets.
  • Offline paired held-out direct-child screening binds exact candidate/base/evaluation identities and rejects train/holdout overlap, incomplete pairing, invalid scores, candidate safety violations and measured mean regression.
  • Every decision keeps 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 to enterprise-architecture-core; model discovery/routing to contextual-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 eligibleForApproval are 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

  • Initial exact 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.
  • Protected main already owned unrelated ADR-0016, so this decision moved non-destructively to Proposed ADR-0017.
  • Hostile review reproduced structural-session injection; module-owned session admission and canonical Agent Runtime execution identity repaired it.
  • After docs(commercial): reconcile live authority and protected ADR index #583 integrated, ordinary two-parent convergence placed this branch on protected main@748970...; no force update or destructive rebase was used.
  • Canonical Architecture/PRD/TRD/UML/TRACEABILITY/TEST_STRATEGY/OPERABILITY/product-gap docs were reconciled while retaining this feature as source-only and its activation work as an open buyer gap.
  • Hosted application CI on predecessor exact 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.
  • Hostile-input review repaired two caller-selected error-provenance paths: public ProceduralGraphError construction 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 referenced docs/doctoring/procedural_graph_adoption.md existed 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.
  • aa954e60a4ed1a940dd4eb118bc74854ac0b2491 promoted 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.
  • Exact c016ee1073fb0ea1d5152100cc90ff3678ed0d84 adds the executable regression in test/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.
  • feat(agent-runtime): gate procedural guidance by execution lifecycle #586 has been ordinary/non-force reconverged onto this exact parent. Parent→child compare remains four execution-gating paths; the adoption record is no longer duplicated in the child delta.

Every source mutation invalidates predecessor workflow evidence. GREEN on 58ec47e... and the short-lived aa954e... generation do not transfer to c016ee....

Required verification and stack order

Keep Draft until unchanged exact c016ee1073fb0ea1d5152100cc90ff3678ed0d84 has 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.

…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.
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

Please review exact head 5813ee1cb8958aa25e622fe31adfa8dc229f2e3c, particularly descriptor-safe input admission, frozen graph scope, digest/rejection identity, paired-case evidence checks, and the separation of advisory eligibility from actual authority. No request to approve, waive gates or merge.

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 verify and reviewer are QUEUED. These observations are not a claim that all required checks passed. PR stays Draft; no merge or deployment was performed.

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.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

@seonghobae I will perform a full review of PR #585 at head 5813ee1cb8958aa25e622fe31adfa8dc229f2e3c.

I will assess the specified security and correctness boundaries. I will not approve, waive checks, merge, or deploy the PR.

⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 33 minutes.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

One additional code-current requirement should be handled when repairing this Draft: protected CLAUDE.md and CONTRIBUTING.md require CHANGELOG.md ## Unreleased to be updated for every behavior change. This PR currently consists of seven added files and does not update the changelog. Keep that change narrow and factual (advisory procedural graph + offline screening only; no deployed/activation claim).

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.
seonghobae added a commit that referenced this pull request Sep 9, 2026
Ordinary non-force integration of #585 head a351bff while preserving #586's lifecycle-gating delta. Also document #586's own exported TypeScript types/classes so the repository public-API gate can evaluate this child without a known repeat failure.

Copy link
Copy Markdown
Contributor Author

Resuming the user-authorized procedural-graph adoption work from live #585 5623f83b001aedfffcc0e28b734d864521655ecb and child #586 2ea14b980ffb7b2cdd81fcf5a22f1a2286da0365. Path-scoped writer claim: procedural graph/session admission and focused regressions on #585, lifecycle/session boundary on #586, associated procedural docs/CHANGELOG entry. Existing #583 root gap-baseline lane remains untouched; no provider, credential, policy, workflow or sibling source is claimed. I will reproduce session-lookalike admission and abstention propagation against the current code before making behavioral changes, preserve ADR-0017 and all predecessor deltas, and use non-force parent integration. Hosted queued checks are not GREEN; no merge or activation authorization is inferred.

seonghobae added a commit that referenced this pull request Sep 10, 2026
Ordinary non-force integration of #585 exact 63c8a81 into #586. Preserve the child lifecycle-gating delta while carrying ADR-0017 identity, implementation-plan retarget, and the exact one-line Unreleased record. No runtime behavior is changed by this merge itself.
seonghobae added a commit that referenced this pull request Sep 10, 2026
Ordinary non-force integration of #585 exact 9056eb2 into #586. Preserve the child lifecycle-gating delta while inheriting the module-owned runtime session brand and its regression. No child behavior is changed by this merge itself.
…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 added a commit that referenced this pull request Sep 10, 2026
Ordinary non-force integration of #585 exact a99b861 into #586. Preserve the child lifecycle/session gate while carrying the runtime-shared execution identity grammar and hostile session-admission regressions added concurrently on the parent.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Ordinary two-parent integration of protected main after #583. Preserve the complete #585 Agent Runtime delta, adopt the protected commercial-baseline/documentation authority changes, and index Proposed ADR-0017 without overwriting ADR-0016.

Refs #583, #584, #585, #586.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant