Skip to content

feat(vance): implement CFRSG architecture and DCCD guards#74

Merged
projectedanx merged 1 commit into
mainfrom
jules-2525798753864661015-6edcf18a
May 30, 2026
Merged

feat(vance): implement CFRSG architecture and DCCD guards#74
projectedanx merged 1 commit into
mainfrom
jules-2525798753864661015-6edcf18a

Conversation

@projectedanx
Copy link
Copy Markdown
Owner

  • Implemented _compute_cfdi_check and _dccd_guard in VanceAgent to enforce strict LSP 3.17 schema compliance and CFDI ambiguity thresholds.
  • Updated DOMAIN_GLOSSARY.md with VANCE-specific terminology (NFL, CFRSG, Drift Deficit, Reversal Curse, etc.).
  • Authored ADR-21 (docs/adr/21-vance-cfrsg-architecture.md) detailing the Conflict-Free Replicated Semantic Graph approach.
  • Created JSON registry artifacts (pattern_inventory, retrieval_manifest, reflexive_check) in vance_emergence_planning/.
  • Updated README.md to document the four non-negotiable architectural layers of VANCE.
  • Extended unit tests in tests/test_vance_agent.py to cover new CFDI and DCCD validation logic.

PR created automatically by Jules for task 2525798753864661015 started by @projectedanx

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the Conflict-Free Replicated Semantic Graph (CFRSG) architecture for the VANCE agent, adding comprehensive documentation (ADR-21, glossary updates), configuration manifests, and implementation details for CFDI cross-validation and DCCD schema guarding in vance_agent.py, along with corresponding unit tests. The review feedback highlights a critical logical bug in the symbol mismatch check where a missing found_symbol incorrectly passes validation, and suggests improvements to handle falsy but valid proposed results and to optimize redundant dictionary lookups.

if context.get("simulate_missing_node"):
return {"valid": False, "reason": "No AST node exists at proposed location"}

if expected_symbol and expected_symbol != context.get("found_symbol", expected_symbol):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The default value in context.get("found_symbol", expected_symbol) causes the inequality check to always evaluate to False when found_symbol is missing from the context. This means that if an expected_symbol is specified but no symbol is found (i.e., found_symbol is absent), the check will silently pass as valid instead of failing. Removing the default value ensures that a missing found_symbol is correctly treated as a mismatch.

Suggested change
if expected_symbol and expected_symbol != context.get("found_symbol", expected_symbol):
if expected_symbol and expected_symbol != context.get("found_symbol"):

return {"decided_result": context.get("expected_result")}
# Perform CFDI Cross-Validation
proposed_result = context.get("expected_result")
if proposed_result:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using a simple truthiness check if proposed_result: can lead to unexpected behavior if expected_result is a falsy but valid value (such as an empty dictionary {} or list []). It is safer and more robust to explicitly check if proposed_result is not None: to ensure validation is not skipped for empty structures.

Suggested change
if proposed_result:
if proposed_result is not None:

# Additional simulated checks based on schema_type can go here

# Check CFDI violation if result has a range
if payload.get("result") and isinstance(payload["result"], dict) and "range" in payload["result"]:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The truthiness check payload.get("result") is redundant because isinstance(..., dict) already ensures the value is a dictionary (and thus not None or other non-dict types). Additionally, binding payload.get("result") to a local variable avoids multiple dictionary lookups and simplifies the code.

Suggested change
if payload.get("result") and isinstance(payload["result"], dict) and "range" in payload["result"]:
result = payload.get("result")
if isinstance(result, dict) and "range" in result:

@projectedanx projectedanx merged commit a097072 into main May 30, 2026
3 checks passed
@projectedanx projectedanx deleted the jules-2525798753864661015-6edcf18a branch May 30, 2026 11:24
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