Skip to content

feat(sii-gateway): Implement P1 — LangGraph State & Topology#5

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/add-technical-screening-features
Draft

feat(sii-gateway): Implement P1 — LangGraph State & Topology#5
Copilot wants to merge 2 commits into
masterfrom
copilot/add-technical-screening-features

Conversation

Copilot AI commented Mar 17, 2026

Copy link
Copy Markdown

Scaffolds the LangGraph cyclic graph skeleton for the SII Recruitment Gateway, implementing P1 of the sovereign AI screening pipeline with ISO 27001:2022 control anchoring and strict modular file structure.

State Schema (src/state.py)

GraphState — 9-field dict subclass threaded through every node:

Field Type Notes
transcript str PII-redaction-ready (A.5.34)
code_payload str Inert data; ephemeral sandbox only (A.8.10)
security_score float OWASP aggregate [0.0–1.0]
logic_rubric dict Algo + architecture sub-scores
audit_trace Annotated[list[dict], operator.add] Append-only; SHA-256 chain-of-trust ready
iso_controls_applied Annotated[list[str], operator.add] New (P1 ISO update) — every node appends its control ID
reflection_loops int Bounded by MAX_REFLECTION_LOOPS = 2
consensus_score float Weighted: security 40%, logic 35%, arch 25%
candidate_id str Opaque pseudonym — never raw PII/RUT

audit_trace and iso_controls_applied use Annotated[list, operator.add] so LangGraph fan-out merges appends correctly without clobbering concurrent node writes.

Graph Topology

START → ingestor (A.8.2) → rag_router (A.8.24) → evaluators (A.8.10)
          → reflection (A.5.34) ──[consensus < 0.7 AND loops < 2]──► evaluators
                                └──[otherwise]──► report_generator (A.8.2) → END
  • route_reflection() — conditional router enforcing CONSENSUS_THRESHOLD = 0.7 and MAX_REFLECTION_LOOPS = 2
  • build_graph() — wires topology with placeholder stubs; docstring contains explicit IMPORTANT guard against merging node logic into this file
  • Five ISO control constants (ISO_CONTROL_*) importable by P2–P5 node modules for consistent audit trail entries

Dependencies

Added sii-gateway optional extra to pyproject.toml:

langgraph>=1.1.0
structlog>=25.0.0

Testing

  • 23 pytest unit tests in tests/test_state.py covering all public functions, all ISO constant values, all route_reflection routing branches (threshold boundary, loop cap, missing keys), graph node registration, conditional edge wiring, and independent instance creation.

Checklist

  • CI passed

💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

…ateway

Co-authored-by: j211100 <251532790+j211100@users.noreply.github.com>
Copilot AI changed the title [WIP] Add technical screening features for recruitment feat(sii-gateway): Implement P1 — LangGraph State & Topology Mar 17, 2026
Copilot AI requested a review from j211100 March 17, 2026 13:38
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.

2 participants