-
Notifications
You must be signed in to change notification settings - Fork 39
Feat: AIAC Phase 1 — functional agent, UC-1 service onboarding + integration tests #710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
290 commits
Select commit
Hold shift + click to select a range
b6f180b
docs(aiac): add UC-1/UC-2 call flows and restructure Technical Addendum
oblinder 36b66ce
docs(aiac): add Short-Term Objectives section to architecture summary
oblinder d7ddc08
docs(aiac): merge architecture summary into PRD and restructure
oblinder 16660c5
docs(aiac): update architecture diagram call labels with specific API…
oblinder beb0dff
docs(aiac): add Red Hat AMQ evaluation as Event Broker alternative
oblinder e7245c9
docs(aiac): remove Key Interface Surface section and simplify UC-1 title
oblinder 8ea332f
docs(aiac): replace flat call flow with structured UC call flows in PRD
oblinder bc1692f
docs(aiac): reorder architecture summary sections and remove Technica…
oblinder 653d90e
Merge remote-tracking branch 'origin/main' into aiac
anatolykoyfman f777590
minor fix
anatolykoyfman 91f4da0
rego generation
anatolykoyfman 41b4fee
improve prompt + better rego
anatolykoyfman d5f38a1
improve prompt + better rego
anatolykoyfman 85f7b6f
docs(aiac): redesign aiac.pdp.library component PRD
oblinder e738bdf
docs(aiac): add missing description field to Service model in library…
oblinder 69fc6a4
refactor(aiac): Reshape pdp.library into class-based config/policy cl…
oblinder 8b3ba35
docs(aiac): move create_scope from policy to configuration library mo…
oblinder dada065
feat(aiac): move create_scope to Configuration; add POST /services/{i…
oblinder b2b3487
docs(aiac): split create_scope into create/map; add role equivalents
oblinder 6d20fc5
feat(aiac): add scope/role write endpoints to config service and library
oblinder e001125
new config API
anatolykoyfman 471261e
docs(aiac): split aiac-agent PRD into 3 UC sub-PRDs
oblinder 5ed725e
docs(aiac): rename policy update subjects and endpoints
oblinder f9c1973
docs(aiac): rename 'realm role' to 'role' across all requirements
oblinder c90f1d0
minor formatting
anatolykoyfman afeabc6
Merge branch 'aiac' of github.com:s-and-p-team/kagenti-extensions int…
anatolykoyfman fe98a63
feat(agent): implement Role sub-agent, orchestrator, and NATS consumer
oblinder f30e6fa
feat(agent): implement controller routes, shared nodes, and tests (is…
oblinder a7001f5
docs: fix Mermaid node colors for dark theme readability
oblinder c3cb27a
docs: remove unreferenced aiac-agent-diagram.md
oblinder 92301b9
docs: Remove mermaid element styles from aiac-agent requirement docs
oblinder 6686ef7
docs: refine classify_service spec with AgentRuntime LIST lookup and …
oblinder a2b58d9
docs: redesign UC1 Service Provision nodes — remove LLM, deterministi…
oblinder 0268174
docs: Mark analyze_tool lookup strategy as TBD in UC1 spec
oblinder 78e1e89
docs: Update UC1 spec with agreed design decisions from grilling session
oblinder 7f3a7be
docs: rename OnboardingProvisionState.client_id to service_id in UC1 …
oblinder 040fc0d
docs: Refactor UC1 Service Onboarding policy sub-agent into PolicyMod…
oblinder acb7eb7
docs: update aiac-agent.md spec for policy sub-agent refactor
oblinder a6ade2f
docs: fix Mermaid node ID conflict in aiac-agent.md
oblinder 712ec2b
docs: Restructure library PRD into configuration/ and policy/ sub-pac…
oblinder 7fbe12a
refactor(pdp): restructure library into configuration/ and policy/ su…
oblinder ceb5f43
docs: Fix PDP config service install guide for local dev
oblinder 20dfa23
chore: untrack Claude Code files and add to .gitignore
oblinder d9051ff
revert: restore .claude/ tracking in kagenti-extensions
oblinder 85a9b0e
revert: restore CLAUDE.md tracking in kagenti-extensions
oblinder ca1008b
docs: Refactor PolicyApplyGraph and PolicyModel as shared across all …
oblinder e37f920
allow for both i nbound and outbound
anatolykoyfman 759a22e
fix: resolve Keycloak clientId and service type in Service model
oblinder ce2e652
test: Expand show_keycloak_data smoke test to display all model fields
oblinder 256fc6c
feat: persist kagenti.service.type via PATCH /services and extend mod…
oblinder 296afe0
temp
anatolykoyfman c7e01a0
remove python path
anatolykoyfman f3496af
feat: populate Service.roles/scopes and Role.childRoles/mappedScopes …
oblinder 5466064
test: add unit tests for get_roles() secondary calls and GET /roles/{…
oblinder f4fd13d
docs: update PRD and component specs for get_roles() childRoles/mappe…
oblinder 328d2fb
fix: fix PDP config service scope-mappings and sync stale tests
oblinder d72b498
refactor: reorder Keycloak config API endpoints by functionality
oblinder 7727b6f
fix: use service account user API for service roles endpoints
oblinder edbdaa0
temp
anatolykoyfman 82a8097
fix: use service account user for realm role operations on services
oblinder 16180a1
feat: Add serviceId field to Service model from Keycloak clientId
oblinder 72ef1ca
feat: Print serviceId in show_keycloak_data.py services output
oblinder 4871de6
fix: populate Scope descriptions and Role details in get_services
oblinder 463db4e
Merge remote-tracking branch 'origin/aiac' into scopes
anatolykoyfman 6535d3a
fixes for new api
anatolykoyfman 93e04c6
scopes initial
anatolykoyfman 7ba5fbe
merge with scopes
anatolykoyfman 559b433
better prompt
anatolykoyfman 167c526
minor prompt fixes for weaker models
anatolykoyfman 1f4d1c8
fix: Infer Service type from description in get_services
oblinder 3b1f230
refactor: remove per-request realm override from PDP Configuration Se…
oblinder 12eb891
feat: per-request realm support with lazy KeycloakAdmin cache in PDP …
oblinder f34c7a9
test: update config service tests for required realm param and lazy c…
oblinder fa306ef
fix: remove realm query param from /health, use KEYCLOAK_ADMIN_REALM
oblinder 3a2b331
docs: update PRD and component spec for /health realm-param removal
oblinder fbc3ec5
Merge remote-tracking branch 'origin/main' into aiac
oblinder 84e7dfb
feat: add get_service and refactor service enrichment into _build_ser…
oblinder cc245cd
docs: add get_service and document _build_service refactor in library…
oblinder a19eb2c
test: add TestGetService and TestSetServiceType; fix TestGetServices …
oblinder 971b5d0
model
anatolykoyfman 89f36b3
model
anatolykoyfman f5d6ac2
feat: populate Subject.roles from Keycloak realm role assignments
oblinder ac2b249
docs: update library.md for get_subjects() role enrichment
oblinder 62986d0
docs: Add Phase 2 PDP Policy Service (OPA) component PRD
oblinder d861878
docs: Update PRD for Phase 2 OPA architecture and idp/pdp namespace s…
oblinder 955f52c
docs: Remove Phase 1/2 duality from PRD and component specs
oblinder 3bd9248
docs: add State Management Service and state library PRDs; update mas…
oblinder 38d50d0
docs: rename Kubernetes Interface Pod to Kagenti Interface Pod, add S…
oblinder 4516cbf
docs: update requirements to reflect OPA-first architecture and Kagen…
oblinder e891309
docs: rename PDP Interface Pod to Kagenti Interface Pod in standalone…
oblinder 0c9e26c
docs(aiac): update state management PRD for SQLite + StatefulSet
oblinder 930b561
docs(aiac): rename State Management Service and PDP Policy Service
oblinder d9f9db0
docs: Remove deployment topology section from PRD; sync architecture …
oblinder 69bfdd5
Minor arch diagram update
oblinder 70bd53b
temp
anatolykoyfman 9a7bcd1
temp
anatolykoyfman 042732f
temp, fix tests
anatolykoyfman 09486b4
fix prompts + add tests
anatolykoyfman 03012e0
docs: redesign AIAC policy architecture — Policy Store, PCE, Policy M…
oblinder fa205b1
docs(aiac-agent): replace PolicyBuilder TBD with SharedApplyGraph and…
oblinder 61d213d
refactor: rename aiac.pdp.library.configuration → aiac.idp.configurat…
oblinder 1d6185e
docs: sync ARCHITECTURE-SUMMARY diagram and component table with PRD
oblinder fcfb746
docs(aiac-agent): replace shared apply node with Policy Rules Builder…
oblinder 3a4ebed
docs(aiac-agent): align PRD with Policy Rules Builder architecture
oblinder 835d602
docs(aiac-agent): remove stale shared module and LLM integration; ext…
oblinder 48dda11
docs(aiac-agent): simplify file structure tree
oblinder 34e8b87
docs(aiac-agent): align main PRD with grill-me shared contract
oblinder de4721f
docs(aiac-agent): rewrite UC1, UC2, UC3 sub-PRDs per grill-me session
oblinder ca3527d
docs(aiac-agent): rename Service Policy Update sub-agent to Service P…
oblinder f2011c7
docs(aiac-agent): specify Policy Rules Builder interface
oblinder fb5d242
docs(aiac-agent): move PRB calls from Controller into producing sub-a…
oblinder 5e0fff0
docs(aiac): align idp-configuration-service spec with implementation
oblinder 61ac3c7
feat(aiac): implement id-only hash/eq, remove set_service_type, updat…
oblinder a0b8a79
minor pathe related fixes
anatolykoyfman dca6b3a
Merge branch 'aiac' of github.com:s-and-p-team/kagenti-extensions int…
anatolykoyfman 144e0ba
docs(aiac): add subject_roles to AgentPolicyModel and PCE algorithm
oblinder 093495f
feat(aiac): add get_subjects_by_role, move IdP tests to test/idp/
oblinder ccf858a
Adding aiac/.gitignore
oblinder c2f20c5
test(aiac): add unit tests for Subject hashability and get_subjects_b…
oblinder b3dcd4f
feat(aiac): add aiac.policy.model package with PolicyRule, AgentPolic…
oblinder 42b2ee3
feat(aiac): add policy store service with SQLite-backed FastAPI and u…
oblinder bede4ee
feat(aiac): add policy store library and unit tests
oblinder 47dd872
new model struct
anatolykoyfman e868795
new rego builder + new policy retuns
anatolykoyfman 7399962
docs: rename aiac-pdp-policy-service ClusterIP to aiac-pdp-policy-wri…
oblinder e8dc4a5
refactor(policy): remove IdP model hashability, key policy maps by st…
oblinder 56693bc
docs: Align PDP writer, PCE, and PRD with revised policy model spec
oblinder a604320
feat(aiac): add Rego package generator for PDP policy writer
oblinder 31e1c77
feat(aiac): add PDP Policy Writer OPA filesystem stub service
oblinder 1cb3e2f
style: Sort imports in OPA policy-writer per ruff
oblinder 4d38393
Style: Fix ruff lint errors across src/aiac
oblinder ce70b2a
remove old rego generation
anatolykoyfman 681acfc
merge
anatolykoyfman b068ab1
remove old
anatolykoyfman 651c63c
cleanup
anatolykoyfman 7c7957b
feat(aiac): Add aiac.pdp.policy.library OPA HTTP client with unit tests
oblinder cf2b9f8
style(aiac): Add aiac-local ruff config and fix lint violations
oblinder 0f25da6
docs: Rework PDP policy-writer PRD to ID-only rego model; index integ…
oblinder 9ef0f59
docs: Add PDP Policy Writer (OPA) integration-test spec
oblinder 341657b
refactor(aiac): Rewrite OPA Rego generator to ID-only model
oblinder db6d078
test(aiac): Add PDP policy-writer OPA integration launcher (generate_…
oblinder ebb33b6
Refactor(aiac): Reset stale agent layer; finish pdp.policy.library cl…
oblinder f21a22a
Docs(aiac): Update CLAUDE.md for the agent layer reset
oblinder 1ddf65f
feat(aiac): Add Policy Computation Engine (aiac.policy.computation)
oblinder 1340a60
docs(aiac): Move role flattening upstream of PRB; add PCE append/over…
oblinder 7bac2cb
feat(aiac): Add PCE override merge mode and drop role flattening
oblinder 6f7cb3b
Refactor(aiac): Drop unused _BASE_URL constant in policy store library
oblinder 9610d79
feat(aiac): Add agent Controller skeleton + flatten_role helper
oblinder 21e5ea3
docs: Record resolved Policy Rules Builder internal design
oblinder 7bb56dc
feat(aiac): Implement Policy Rules Builder phase 1
oblinder e326151
docs: add Keycloak access control analysis for U→A→T scenario with RB…
oblinder b4a18db
chore: gitignore aiac/inception/plans and remove stale aiac artefact …
oblinder b5ef7af
docs: add OPA-as-PDP architecture sections to Keycloak access control…
oblinder ef7d3d8
fix(aiac): Filter services client-side and drop role→scopes endpoint
oblinder 41aa64d
feat(aiac): route PCE rules by kind and add outbound subject gate
oblinder 2cc3cec
docs: Add policy-pipeline integration-test spec and index it in the PRD
oblinder 429c3bb
feat(aiac): add policy-pipeline integration test (5.3) with shared la…
oblinder c90d47a
docs(aiac): record 5.3 launcher deviations in policy-pipeline spec
oblinder a7fe45a
feat(aiac): mark AIAC-provisioned roles/scopes and filter Keycloak bu…
oblinder 35c5269
feat(aiac): canonical client.type attribute for service typing with I…
oblinder f86e710
docs(aiac): make policy-pipeline scenario descriptions generic and ty…
oblinder 84111b1
docs(aiac): reframe policy-pipeline spec as asserting opa-eval pytest…
oblinder bc63a54
test(aiac): add policy-pipeline OPA-eval integration test; align scen…
oblinder 60f4177
docs(aiac): elaborate policy-pipeline roles; rename agent roles to so…
oblinder efbc908
fix(aiac): scope PRB auditor to one access relationship per verdict
oblinder b986849
fix(aiac): converge PRB output across explicit/abstract policy variants
oblinder 7daf3c8
chore(aiac): gitignore policy-pipeline integration-test rego_out
oblinder 2b623ec
refactor(aiac): remove spiffe:// clientId type fallback in IdP models
oblinder 3bb7449
docs(aiac): label-based onboarding classification + hybrid MCP tool l…
oblinder c9832f6
chore(aiac): untrack and gitignore gh-issues drafts
oblinder fccff9c
docs: Clarify UC1 own-vs-other roles/scopes and self-mapping invariant
oblinder c1ccbde
feat(aiac): Service Provision sub-agent (UC1) + shared ServiceType
oblinder 08d920f
feat(aiac): Service Policy sub-agent (UC1) + shared run_upstream helper
oblinder 545a902
refactor(aiac): Rename Service Policy sub-agent to Service Policy Bui…
oblinder 1719eb8
feat(aiac): Service Onboarding Orchestrator (UC1) — provision → polic…
oblinder b5e582e
refactor(aiac): Relocate run_upstream to project level and push retri…
oblinder d01f57b
Fix(aiac): Reconcile PRB deny-by-default with description-based grants
oblinder fcb50cf
Refactor(aiac): Factor generic policy into the PRB prompt
oblinder 36e8d51
Docs(aiac): Add github-agent demo spec (source + issue A2A agent)
oblinder 1ca4bc4
Docs(aiac): Spec UC-1 onboarding-pipeline integration test + github-t…
oblinder 31cd1e8
Test(aiac): Assert onboarding orchestrator invokes provision graph wi…
oblinder 962f892
Feat: Add minimal github-tool MCP demo server (UC-1 discovery)
oblinder b04c702
Feat(aiac): Add github-agent demo (GA-1…GA-9)
oblinder 1513412
Feat(aiac): Add k8s deployment manifests Phase 1 — Interface Pod, Pol…
oblinder f7a6834
Fix(aiac): Phase 1 k8s — Policy Store own ConfigMap, keycloak PDP Pol…
oblinder 54fb64a
fix: use localhost/...:local image names in AIAC k8s production manif…
oblinder 7b14995
docs: reorganise inception/ into docs/ — specs, issues, handoffs, gh-…
oblinder 448da92
Test(aiac): Add UC-1 onboarding-pipeline integration test (5.4)
oblinder 727743f
Chore(aiac): Retarget github demo manifests to aiac-demo namespace
oblinder 263fb32
Docs: Add AIAC specification documents
oblinder cd6b389
Merge branch 'aiac' into aiac-phase1
oblinder cf48099
Chore(aiac): Defer aiac-init and phase-gated env vars from Phase 1 de…
oblinder 2a3c0a1
Chore(aiac): Retarget github demo manifests back to team1 namespace
oblinder 1895994
Chore(aiac): Point github demo at existing kagenti realm
oblinder c19073d
Docs(aiac): Reframe uc1-onboarding integration test as a rung ladder
oblinder 1f64da0
Docs(aiac): Apply SPM/APM redesign across policy component specs
oblinder 4500bc9
feat(aiac): Add ServicePolicyModel + Role/Scope SPM fields (Wave 1)
oblinder 9c82313
Test(aiac): Verify idp Configuration surfaces SPM/APM fields (handoff…
oblinder 6a93e1f
Feat(aiac): SPM-centric policy store (persist SPMs, drop APM persiste…
oblinder 8ad2286
Feat(aiac): Source agent roles from client roles + populate SPM/APM f…
oblinder c53e1e3
Refactor(aiac): Rewrite PCE to SPM-based order-independent engine
oblinder 773844c
Docs(aiac): Refresh CLAUDE.md source/image map post handoffs 01-05
oblinder b58a16d
Test(aiac): Fix stale store DB env var name in policy-pipeline integr…
oblinder 24c5fec
Fix(aiac): Populate agent-role kind/actorIds + scope.serviceId at IdP…
oblinder 259f2b4
Docs(aiac): Reconcile IdP role-sourcing specs with two-source agent r…
oblinder b785c2e
fix(demo): add protocol label and direct agent port for AgentCard aut…
oblinder e55a333
Fix(aiac): Deploy OPA rego-file PDP writer in Phase 1, not Keycloak mock
oblinder 646d1a4
Fix(aiac): UC-1 onboarding pipeline fixes + rung-1 integration test
oblinder a118fb6
Docs(aiac): Reconcile UC-1 specs with the onboarding pipeline fixes
oblinder 5bd33e5
Docs(aiac): Reconcile PCE spec/PRD with re-raise (was fire-and-forget…
oblinder 86a20a6
Docs(aiac): Add Kagenti dev-guide link to CLAUDE.md external references
oblinder 1317e20
test(aiac): Add UC-1 onboarding rung-2 integration test + shared harness
oblinder cc3afb8
Fix(aiac): Policy Store slash-safe service_id + SPIFFE-aware slugify
oblinder c5f2fc3
Chore(aiac): Remove obsolete onboarding.old and test_llm_config.py.old
oblinder 954c204
Fix(aiac): Authenticate UC-1 tool MCP discovery with tool-audienced t…
oblinder 1b24f96
docs(aiac): Reconcile IdP/library/UC-1 specs with discovery-token fix
oblinder 8a3f415
test(aiac): Capture UC-1 rego into per-rung project subfolders
oblinder bf93895
test(aiac): Nest policy-pipeline rego under rego_out/policy_pipeline
oblinder 91738fe
Fix(aiac): Align UC-1 integration realm with deployed stack (kagenti)
oblinder 872daef
Test(aiac): Rename policy-pipeline throwaway realm to aiac-pp
oblinder 5939673
chore(aiac): Remove unused test/fixtures directory
oblinder 6b56983
docs: Correct PDP responsibility wording in architecture summary
oblinder 32ed2ae
docs(aiac): Fix OPA/token-issuance contradiction in spec docs
oblinder 29b20af
docs: Align PDP Policy Writer service name and library import path
oblinder cbe0301
docs: Fix module path, naming, and link inconsistencies in AIAC specs
oblinder bb123be
docs(aiac): Fix dangling link to issue 6.2 in uc1-service-onboarding …
oblinder 122eae0
fix: Exclude Keycloak default-roles composite from GET /roles
oblinder 34700bd
fix(pdp): Drop dead agent_scopes from outbound Rego package
oblinder 15d3bf3
fix: Source Service Policy Builder candidates from get_services()/get…
oblinder b91e4d2
test: Rewrite Service Policy Builder unit tests for ownership-based c…
oblinder 2efc4d4
fix: Resolve Service Policy Builder focus by internal client UUID
oblinder e50ce3e
docs: Correct service_id identity to internal client UUID
oblinder c7f9867
chore: Drop onboarding.old/policy from ruff/pytest config
oblinder fd620df
feat: Add Policy Store clear-all endpoint and clear store per UC-1 run
oblinder 53fd2d8
docs: Record RC-B per-scope two-gate AND + capability-match in PCE an…
oblinder e59ed76
feat: Capability-match UC-1 outbound as per-scope two-gate AND
oblinder 696a649
test: Align 5.3 pipeline agent roles to UC-1 (source_operations / iss…
oblinder e3e3352
feat: Add PCE decommission (service offboard) + offboard route
oblinder 4e9c6c0
Merge origin/main into aiac-phase1-pr
oblinder 0d26fed
chore: Fix pre-commit hook findings on PR diff files
oblinder dd13b10
Merge remote-tracking branch 'origin/main' into aiac-phase1-pr
oblinder 6298321
fix(aiac): Address CodeRabbit review findings on UC-1 Phase 1
oblinder c79fa2e
Fix: Address second CodeRabbit pass on UC-1 Phase 1
oblinder 2e0eb79
Fix: Resolve CodeQL security findings on UC-1 Phase 1
oblinder 53258ac
Fix: Resolve CodeQL SSRF/path-injection and chromadb dependency-revie…
oblinder 21b03a5
Fix: Bump json-repair to 0.60.1 to clear dependency-review DoS finding
oblinder 1490494
Fix: Run AIAC service containers as non-root (clawgenti finding)
oblinder 679392f
Docs: Document non-root container / volume-ownership deployment pattern
oblinder d83f0db
Fix: Address must-fix PR review findings (PR #710)
oblinder 585b7a6
Fix: Address suggestion-severity PR review findings (PR #710)
oblinder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # AIAC working artefacts (regenerated; not source of truth) | ||
| docs/issues/ | ||
| docs/handoffs/ | ||
| docs/gh-issues/ | ||
|
|
||
| # PDP policy writer integration-test scratch output (test/pdp/policy/generate_rego.py) | ||
| test/pdp/policy/rego_out/ | ||
|
|
||
| # policy-pipeline integration-test generated Rego (test/integration/test_policy_pipeline.py); | ||
| # regenerated per run, left on disk for eyeballing — not source of truth. probe.rego is a | ||
| # committed fixture and is not under rego_out/, so it stays tracked. | ||
| test/integration/rego_out/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,180 @@ | ||
| # AIAC Codebase Guide | ||
|
|
||
| All paths below are relative to `kagenti-extensions/aiac/`. | ||
|
|
||
| ## Requirements / PRD docs | ||
|
|
||
| `docs/specs/PRD.md` — master PRD. | ||
| `docs/specs/components/` — per-component specs. | ||
|
|
||
| For current file list, `ls docs/specs/` and `ls docs/specs/components/`. | ||
|
|
||
| ## Requirements directory — link-following policy | ||
|
|
||
| When a document under `docs/specs/` contains a markdown link to another file, use the AskUserQuestion tool to ask before reading it — present "Yes" and "No" as clickable options. If the user picks Yes, read the file normally. If No, treat the link as a label and continue without reading it. | ||
|
|
||
| ## Issue tracking | ||
|
|
||
| Issues are tracked as local markdown files under `docs/issues/`, not on GitHub. | ||
| Never use `gh` commands to create, update, or list issues — always read/write the local files directly. | ||
|
|
||
| `docs/issues/implementation-plan.md` — overall implementation plan. | ||
| For current issue list, `ls` the subdirectories under `docs/issues/`. | ||
|
|
||
| ## Issue tracking — codebase inspection policy | ||
|
|
||
| When working on an issue would benefit from inspecting the relevant source code, use the AskUserQuestion tool to ask before doing so — present "Yes" and "No" as clickable options. If the user picks Yes, inspect the codebase normally. If No, work from the issue description and existing context only. | ||
|
|
||
| ## Handoffs | ||
|
|
||
| Per-task handoff documents live under `docs/handoffs/` — one markdown file per task, numeric-prefixed (e.g. `01-update-issues.md`, `02-update-source-and-tests.md`). When asked to generate a handoff, write it here (not a scratch/temp path). Each handoff must be self-contained — background, task, exact files, and acceptance criteria — so a fresh session can execute it without the originating conversation. | ||
|
|
||
| ## Source code | ||
|
|
||
| `src/aiac/` — Python package root (`__init__.py` is empty). | ||
|
|
||
| Key stable structure: | ||
| - `idp/` — IdP configuration service and models | ||
| - `pdp/` — PDP policy writer service and library | ||
| - `agent/` — the AIAC Agent layer (rebuilt on the SPM/APM model): | ||
| - `agent/controller/` — FastAPI Controller (`routes.py` + Dockerfile); `/apply/*` routes dispatch to the UC sub-agents and make the single `compute_and_apply` (PCE) call | ||
| - `agent/uc/` — use-case sub-agents: `onboarding/` (provision + policy_builder + orchestrator), `policy_update/` (build/rebuild), `role_update/` | ||
| - `agent/policy_rules_builder/` — PRB: `build_role_rules` / `build_scope_rules` emit `list[PolicyRule]` | ||
| - `agent/shared/` — shared helpers (`roles.py`, e.g. `flatten_role`) | ||
| - `agent/onboarding.old/` — archived prior implementation (built on the superseded `ProposedDiff` model); not part of the active build | ||
| - `policy/` — the two-layer policy stack (all implemented): | ||
| - `policy/model/` — `PolicyRule`, `ServicePolicyModel` (SPM), `AgentPolicyModel` (APM), `PolicyModel` | ||
| - `policy/store/` — Policy Store service + library (SPM CRUD) | ||
| - `policy/computation/` — Policy Computation Engine (`compute_and_apply`, SPM-based) | ||
|
|
||
| For current file list, `ls` or `find` under `src/aiac/`. | ||
|
|
||
| ## Tests | ||
|
|
||
| `test/` — mirrors `src/aiac/` structure. For current file list, `ls` under `test/`. | ||
|
|
||
| **Unit test command:** | ||
|
|
||
| ```bash | ||
| .venv/bin/pytest test/ -m "not integration" | ||
| ``` | ||
|
|
||
| The whole `test/` tree (including `test/policy/`) collects and runs green. The Policy | ||
| Computation Engine (`aiac.policy.computation.engine`) was migrated to the SPM store surface in | ||
| **Wave 3 / Handoff 05**, so the earlier PCE-chain collection failures (which required ignoring | ||
| `test/policy/computation`, `test/agent/controller/test_routes.py`, and | ||
| `test/integration/test_policy_pipeline.py`) are resolved — no `--ignore` flags are needed. | ||
|
|
||
| Use `ls test/` to discover current test directories. | ||
|
|
||
| **Integration tests** (`-m integration`) need live config — Keycloak + admin creds + an LLM | ||
| endpoint (`opa` on PATH for the policy-pipeline suite). Those variables live in | ||
| `test/integration/.env` (gitignored): `LLM_BASE_URL`, `LLM_API_KEY`, `LLM_MODEL`, `KEYCLOAK_URL`, | ||
| `KEYCLOAK_ADMIN_USERNAME`, `KEYCLOAK_ADMIN_PASSWORD`. Source it before running: | ||
|
|
||
| ```bash | ||
| set -a; . test/integration/.env; set +a | ||
| .venv/bin/pytest test/integration/ -m integration | ||
| ``` | ||
|
|
||
| **Smoke test** (requires live service at `AIAC_PDP_CONFIG_URL`, default `http://127.0.0.1:7071`): | ||
|
|
||
| ```bash | ||
| .venv/bin/python test/idp/configuration/show_keycloak_data.py | ||
| ``` | ||
|
|
||
| Exercises all `Configuration` methods — run `ls test/idp/configuration/` to see current coverage. | ||
|
|
||
| ## Python environment | ||
|
|
||
| Virtual environment: `kagenti-extensions/aiac/.venv` | ||
|
|
||
| Activate: `source kagenti-extensions/aiac/.venv/bin/activate` | ||
| Run directly: `kagenti-extensions/aiac/.venv/bin/python` / `kagenti-extensions/aiac/.venv/bin/pytest` | ||
|
|
||
| Always use this venv for any Python execution, test runs, or dependency checks. | ||
|
|
||
| ## Kubernetes & builds | ||
|
|
||
| Config: `k8s/`, `pyproject.toml`, `pyrightconfig.json` | ||
|
|
||
| Docker images: | ||
|
|
||
| | Image | Dockerfile location | | ||
| |-------|-------------------| | ||
| | `aiac-agent` | `src/aiac/agent/controller/Dockerfile` (build context `src/`) | | ||
| | `aiac-pdp-config` | `src/aiac/idp/service/configuration/keycloak/Dockerfile` | | ||
| | `aiac-pdp-policy-opa` | `src/aiac/pdp/service/policy/opa/Dockerfile` | | ||
| | `aiac-policy-store` | `src/aiac/policy/store/service/Dockerfile` | | ||
| | `aiac-rag-ingest` | `rag-ingest/` (separate directory) | | ||
|
|
||
| ### Non-root container / volume-ownership pattern | ||
|
|
||
| All AIAC service images run as **non-root UID 10001**. Each service Dockerfile | ||
| adds the user before `CMD`, matching the `authbridge/sparc-service` pattern: | ||
|
|
||
| ```dockerfile | ||
| # Drop privileges. | ||
| RUN useradd --no-create-home --uid 10001 aiac | ||
| USER 10001 | ||
| ``` | ||
|
|
||
| A Dockerfile `chown` of a directory is **masked once a volume is mounted over | ||
| it** (the mounted volume, not the image layer, is what the container sees), and | ||
| the kubelet leaves emptyDir/PVC volumes root-owned by default. So any service | ||
| that writes to a mounted volume also needs pod-level `securityContext` in its | ||
| k8s manifest so the kubelet chowns the volume to the non-root user: | ||
|
|
||
| ```yaml | ||
| spec: | ||
| securityContext: | ||
| runAsUser: 10001 | ||
| runAsGroup: 10001 | ||
| fsGroup: 10001 # makes the mounted volume group-writable by UID 10001 | ||
| ``` | ||
|
|
||
| Services requiring this today: | ||
| - **Policy store** — PVC at `/data` (SQLite backend), `policy-store-statefulset.yaml` | ||
| - **PDP policy OPA writer** — emptyDir at `/rego` (`REGO_OUTPUT_DIR`), `pdp-interface-deployment.yaml` | ||
|
|
||
| Services that mount no volumes still need the Dockerfile `USER` directive; the | ||
| pod-level `fsGroup`/volume-chown block above is only required for those that | ||
| write to a mounted volume. | ||
|
|
||
| ### Pod-security hardening baseline | ||
|
|
||
| Beyond non-root, every workload in `k8s/` and the demo manifests carries a | ||
| hardened `securityContext`. Pod level (omitted on the demo `github-agent`, whose | ||
| injected AuthBridge sidecar runs as UID 1337 — hardening there is set per | ||
| container instead so a pod-level `runAsUser` can't clobber the sidecar): | ||
|
|
||
| ```yaml | ||
| spec: | ||
| securityContext: | ||
| runAsNonRoot: true | ||
| runAsUser: 10001 # 1001 for the demo github-agent | ||
| seccompProfile: | ||
| type: RuntimeDefault | ||
| ``` | ||
|
|
||
| Container level, on each app container: | ||
|
|
||
| ```yaml | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| readOnlyRootFilesystem: true | ||
| capabilities: | ||
| drop: ["ALL"] | ||
| ``` | ||
|
|
||
| With `readOnlyRootFilesystem: true` the container gets a writable `/tmp` | ||
| `emptyDir` (and its real data mount — `/data`, `/rego`) so runtime temp writes | ||
| have somewhere to land. The demo `github-agent` **omits** `readOnlyRootFilesystem` | ||
| because its runtime (`uv` / `litellm` / `crewai`) writes caches under `HOME=/app`. | ||
| All core workloads also carry both readiness **and** liveness probes (`httpGet | ||
| /health` where the service exposes one; `tcpSocket` for the Controller and the | ||
| demo workloads, which don't) and CPU/memory requests + limits. | ||
|
|
||
| ## External references | ||
|
|
||
| - [Kagenti Developer Guide](https://github.com/kagenti/kagenti/blob/main/docs/dev-guide.md) — upstream Kagenti dev guide: per-persona workflows (agent, tool, extensions developers, MCP gateway operators), Git/PR process, pre-commit hooks, feature flags, local Kagenti UI v2 development (React frontend + FastAPI backend, building/deploying images to Kubernetes), and HyperShift-based testing on ephemeral OpenShift clusters (cluster lifecycle, cost management, troubleshooting). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| .venv | ||
|
|
||
| # Secrets — never bake into the image | ||
| .env | ||
|
|
||
| # `expect` scripts | ||
| test_startup.exp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Github Agent - configuration template | ||
| # Copy to .env and fill in your values. | ||
|
|
||
| # LLM configuration | ||
| TASK_MODEL_ID=ollama/ibm/granite4:latest | ||
| LLM_API_BASE=http://host.docker.internal:11434 | ||
| LLM_API_KEY=my_api_key | ||
| MODEL_TEMPERATURE=0 | ||
|
|
||
| # MCP Tool endpoint | ||
| MCP_URL=http://github-tool-mcp:9090/mcp | ||
|
|
||
| # Agent service | ||
| PORT=8000 | ||
| LOG_LEVEL=INFO | ||
|
|
||
| # Optional: static GitHub PAT passed to MCP as Bearer token. | ||
| # If unset, the inbound Authorization header (AuthBridge path) is forwarded instead. | ||
| GITHUB_TOKEN= | ||
|
|
||
| # Optional: override the URL advertised in the agent card | ||
| AGENT_ENDPOINT= | ||
|
|
||
| # Optional: override the curated tool allow-list (comma-separated tool names) | ||
| ENABLED_TOOLS= | ||
|
|
||
| # Optional: expected issuer of inbound JWTs (informational) | ||
| ISSUER= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim | ||
| ARG RELEASE_VERSION="main" | ||
|
|
||
| WORKDIR /app | ||
| COPY . . | ||
| RUN uv sync --no-cache --locked --link-mode copy | ||
|
|
||
| ENV PRODUCTION_MODE=True \ | ||
| HOME=/app \ | ||
| RELEASE_VERSION=${RELEASE_VERSION} | ||
|
|
||
| RUN chown -R 1001:1001 /app | ||
| USER 1001 | ||
|
|
||
| CMD ["uv", "run", "--no-sync", "server"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| # github-agent | ||
|
|
||
| An autonomous A2A agent that acts on a user's behalf against GitHub **source repositories** and an **issue/PR tracker**, using the [`github-tool-mcp`](https://github.com/kagenti/kagenti-extensions) MCP server. | ||
|
|
||
| This agent implements the canonical `github-agent` used by the AIAC policy-pipeline integration test — the two skills match the policy scenario's `source_operations` and `issue_operations` roles. | ||
|
|
||
| ## Skills | ||
|
|
||
| | Skill id | Name | Description | | ||
| |---|---|---| | ||
| | `source_operations` | Source repository operations | Browse and search code; read, create, and modify repository file contents, branches, and commits. | | ||
| | `issue_operations` | Issue & PR tracker operations | Read, search, create, and update issues, comments, sub-issues, and pull requests. | | ||
|
|
||
| ## Prerequisite: `github-tool-mcp` (production tool) | ||
|
|
||
| This agent connects to **`github-tool-mcp:9090/mcp`** — the production 44-tool MCP server — at `MCP_URL`. | ||
| Deploy it before starting the agent: | ||
|
|
||
| ``` | ||
| authbridge/demos/github-issue/k8s/github-tool-deployment.yaml | ||
| ``` | ||
|
|
||
| > **Not the same as `demo/tools/github_tool/`.** | ||
| > `demo/tools/github_tool/` is a simplified 4-tool stub (`source-read`, `source-write`, `issues-read`, | ||
| > `issues-write`) deployed as Service `github-tool` for **UC-1 onboarding discovery** only. | ||
| > The agent never connects to it — it connects to the production `github-tool-mcp` server which | ||
| > exposes the 44-tool GitHub API federation. | ||
|
|
||
| ## Configuration | ||
|
|
||
| All settings are read from environment variables (or a `.env` file). Copy one of the presets: | ||
|
|
||
| | Preset | Description | | ||
| |---|---| | ||
| | `.env.ollama` | Default — local Ollama (ibm/granite4) | | ||
| | `.env.openai` | OpenAI gpt-4o-mini | | ||
| | `.env.claude` | Anthropic Claude Sonnet | | ||
| | `.env.template` | Documented placeholder for all vars | | ||
|
|
||
| ### Variables | ||
|
|
||
| | Variable | Description | Default | | ||
| |---|---|---| | ||
| | `TASK_MODEL_ID` | litellm model id | `ollama/ibm/granite4:latest` | | ||
| | `LLM_API_BASE` | OpenAI-compatible base URL | `http://host.docker.internal:11434` | | ||
| | `LLM_API_KEY` | LLM API key | `my_api_key` | | ||
| | `MODEL_TEMPERATURE` | Sampling temperature | `0` | | ||
| | `EXTRA_HEADERS` | Extra LLM headers (JSON) | `{}` | | ||
| | `MCP_URL` | MCP tool endpoint | `http://github-tool-mcp:9090/mcp` | | ||
| | `MCP_TIMEOUT` | MCP connect timeout (s) | `600` | | ||
| | `ENABLED_TOOLS` | Override the curated tool allow-list (comma-separated) | (unset → default set) | | ||
| | `PORT` | A2A listen port | `8000` | | ||
| | `LOG_LEVEL` | Log level | `INFO` | | ||
| | `GITHUB_TOKEN` | Static Bearer to MCP (else inbound passthrough) | (unset) | | ||
| | `ISSUER` | Expected `iss` of inbound JWTs (informational) | (unset) | | ||
| | `AGENT_ENDPOINT` | Override the URL advertised in the card | (unset) | | ||
|
|
||
| ## Running locally | ||
|
|
||
| ```bash | ||
| cd aiac/demo/agents/github_agent | ||
| cp .env.ollama .env # or another preset | ||
| uv sync | ||
| uv run server | ||
| # In another terminal: | ||
| curl -s localhost:8000/.well-known/agent-card.json | python3 -m json.tool | ||
| ``` | ||
|
|
||
| Optionally, run `expect -f test_startup.exp` instead to check startup automatically. | ||
|
|
||
| ## Deploying to Kagenti (Kind cluster) | ||
|
|
||
| Prerequisites: a running Kagenti cluster (Keycloak realm `kagenti`, namespace `team1`) with `github-tool-mcp` already deployed. | ||
|
|
||
| 1. **Build the image:** | ||
| ```bash | ||
| cd aiac/demo/agents/github_agent | ||
| podman build -t github-agent:latest . | ||
| # or: docker build -t github-agent:latest . | ||
| ``` | ||
|
|
||
| 2. **Load into the Kind cluster:** | ||
| ```bash | ||
| kind load docker-image github-agent:latest --name kagenti | ||
| ``` | ||
|
|
||
| 3. **Apply manifests:** | ||
| ```bash | ||
| kubectl apply -f k8s/configmaps.yaml | ||
| kubectl apply -f k8s/github-agent-deployment.yaml | ||
| ``` | ||
|
|
||
| 4. **Confirm AuthBridge injection:** | ||
| ```bash | ||
| kubectl get pod -n team1 -l app.kubernetes.io/name=github-agent -o jsonpath='{.items[0].spec.containers[*].name}' | ||
| ``` | ||
| You should see the `authbridge-proxy` (or `envoy-proxy`) sidecar alongside `agent`. | ||
|
|
||
| 5. **Port-forward and send a message:** | ||
| ```bash | ||
| kubectl port-forward svc/github-agent 8080:8080 -n team1 & | ||
| # Send an A2A message/send request: | ||
| curl -s http://localhost:8080/.well-known/agent-card.json | python3 -m json.tool | ||
| ``` | ||
|
|
||
| ## Architecture | ||
|
|
||
| ``` | ||
| A2A client ──(JSON-RPC /)──► github-agent (:8000) | ||
| │ CrewAI: prereq extract → researcher | ||
| └──(streamable-http, MCP_URL)──► github-tool-mcp:9090/mcp ──► GitHub | ||
| (AuthBridge sidecar: inbound JWT validation; outbound RFC-8693 token exchange for MCP_URL host) | ||
| ``` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
allow-ghsas: GHSA-f4j7-r4q5-qw2cis scoped at the job level, so it silences the advisory for all packages in the scan, not justchromadb. The justification in the comment is sound (no fixed version,trust_remote_codenot used), but worth noting if a future dep happens to share the advisory ID. Consider adding a follow-up ticket to re-evaluate once chromadb ships a patched release.