-
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
Open
oblinder
wants to merge
286
commits into
rossoctl:main
Choose a base branch
from
s-and-p-team:aiac-phase1-pr
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
286 commits
Select commit
Hold shift + click to select a range
e25c459
Minor formating improvement
oblinder 027c542
docs(aiac): fix pod and manifest counts after PDP Interface Pod conso…
oblinder 3cfe484
fix(aiac): remap PDP service ports and mark dev-only k8s manifest
oblinder 35be1c0
Created initial AIAC Architectural Summary
oblinder 05c7e7e
docs(aiac): add UC-1/UC-2 call flows and restructure Technical Addendum
oblinder 72e0339
docs(aiac): add Short-Term Objectives section to architecture summary
oblinder b95176e
docs(aiac): merge architecture summary into PRD and restructure
oblinder 38f6c04
docs(aiac): update architecture diagram call labels with specific API…
oblinder cb80a5c
docs(aiac): add Red Hat AMQ evaluation as Event Broker alternative
oblinder 1f32280
docs(aiac): remove Key Interface Surface section and simplify UC-1 title
oblinder b9a17ac
docs(aiac): replace flat call flow with structured UC call flows in PRD
oblinder f3aa2af
docs(aiac): reorder architecture summary sections and remove Technica…
oblinder 2abf051
Merge remote-tracking branch 'origin/main' into aiac
anatolykoyfman a095d96
minor fix
anatolykoyfman ef26b21
rego generation
anatolykoyfman 781759e
improve prompt + better rego
anatolykoyfman 776044a
improve prompt + better rego
anatolykoyfman 4940d67
docs(aiac): redesign aiac.pdp.library component PRD
oblinder 4489d70
docs(aiac): add missing description field to Service model in library…
oblinder 5c14729
refactor(aiac): Reshape pdp.library into class-based config/policy cl…
oblinder 7575a49
docs(aiac): move create_scope from policy to configuration library mo…
oblinder 3fae309
feat(aiac): move create_scope to Configuration; add POST /services/{i…
oblinder 12fcda3
docs(aiac): split create_scope into create/map; add role equivalents
oblinder fc43ca5
feat(aiac): add scope/role write endpoints to config service and library
oblinder 1c8aa0c
new config API
anatolykoyfman 3e9775d
docs(aiac): split aiac-agent PRD into 3 UC sub-PRDs
oblinder 883c064
docs(aiac): rename policy update subjects and endpoints
oblinder cd2f577
docs(aiac): rename 'realm role' to 'role' across all requirements
oblinder 15bd86d
minor formatting
anatolykoyfman e06a9c8
Merge branch 'aiac' of github.com:s-and-p-team/kagenti-extensions int…
anatolykoyfman d0fcf5c
feat(agent): implement Role sub-agent, orchestrator, and NATS consumer
oblinder ad3c5d5
feat(agent): implement controller routes, shared nodes, and tests (is…
oblinder 85bed5c
docs: fix Mermaid node colors for dark theme readability
oblinder 3140aa9
docs: remove unreferenced aiac-agent-diagram.md
oblinder ebaf2df
docs: Remove mermaid element styles from aiac-agent requirement docs
oblinder 5558968
docs: refine classify_service spec with AgentRuntime LIST lookup and …
oblinder a017082
docs: redesign UC1 Service Provision nodes — remove LLM, deterministi…
oblinder b9fb982
docs: Mark analyze_tool lookup strategy as TBD in UC1 spec
oblinder 4d9ae86
docs: Update UC1 spec with agreed design decisions from grilling session
oblinder f864166
docs: rename OnboardingProvisionState.client_id to service_id in UC1 …
oblinder 1b1e24c
docs: Refactor UC1 Service Onboarding policy sub-agent into PolicyMod…
oblinder b4c1646
docs: update aiac-agent.md spec for policy sub-agent refactor
oblinder fd4b170
docs: fix Mermaid node ID conflict in aiac-agent.md
oblinder b6bdf47
docs: Restructure library PRD into configuration/ and policy/ sub-pac…
oblinder 5628202
refactor(pdp): restructure library into configuration/ and policy/ su…
oblinder fd2d251
docs: Fix PDP config service install guide for local dev
oblinder 52c7882
chore: untrack Claude Code files and add to .gitignore
oblinder ff6e6f6
revert: restore .claude/ tracking in kagenti-extensions
oblinder 3f6dd71
revert: restore CLAUDE.md tracking in kagenti-extensions
oblinder 2b18919
docs: Refactor PolicyApplyGraph and PolicyModel as shared across all …
oblinder e08c65b
allow for both i nbound and outbound
anatolykoyfman 63579cf
fix: resolve Keycloak clientId and service type in Service model
oblinder ce494a9
test: Expand show_keycloak_data smoke test to display all model fields
oblinder ddd968f
feat: persist kagenti.service.type via PATCH /services and extend mod…
oblinder 5f602e4
temp
anatolykoyfman 28f4836
remove python path
anatolykoyfman 5330f53
feat: populate Service.roles/scopes and Role.childRoles/mappedScopes …
oblinder 5427e61
test: add unit tests for get_roles() secondary calls and GET /roles/{…
oblinder 6d105e4
docs: update PRD and component specs for get_roles() childRoles/mappe…
oblinder ba751b4
fix: fix PDP config service scope-mappings and sync stale tests
oblinder 870c36b
refactor: reorder Keycloak config API endpoints by functionality
oblinder 31a193d
fix: use service account user API for service roles endpoints
oblinder 8600570
temp
anatolykoyfman 7b7a025
fix: use service account user for realm role operations on services
oblinder c639384
feat: Add serviceId field to Service model from Keycloak clientId
oblinder 191a2a8
feat: Print serviceId in show_keycloak_data.py services output
oblinder f27e77a
fix: populate Scope descriptions and Role details in get_services
oblinder c9e9a2e
Merge remote-tracking branch 'origin/aiac' into scopes
anatolykoyfman ca057b1
fixes for new api
anatolykoyfman 9f8f182
scopes initial
anatolykoyfman 588c7ba
merge with scopes
anatolykoyfman 7c2bf91
better prompt
anatolykoyfman 663469c
minor prompt fixes for weaker models
anatolykoyfman c416618
fix: Infer Service type from description in get_services
oblinder 4eda066
refactor: remove per-request realm override from PDP Configuration Se…
oblinder 62e2c1d
feat: per-request realm support with lazy KeycloakAdmin cache in PDP …
oblinder 44c08fb
test: update config service tests for required realm param and lazy c…
oblinder 53e5eff
fix: remove realm query param from /health, use KEYCLOAK_ADMIN_REALM
oblinder e992390
docs: update PRD and component spec for /health realm-param removal
oblinder 0ffaca2
Merge remote-tracking branch 'origin/main' into aiac
oblinder 0217d2f
feat: add get_service and refactor service enrichment into _build_ser…
oblinder 4c4bac8
docs: add get_service and document _build_service refactor in library…
oblinder fa139e7
test: add TestGetService and TestSetServiceType; fix TestGetServices …
oblinder 9a1d7d9
model
anatolykoyfman 5f352e3
model
anatolykoyfman 29d6b69
feat: populate Subject.roles from Keycloak realm role assignments
oblinder fa6fea9
docs: update library.md for get_subjects() role enrichment
oblinder 45bf798
docs: Add Phase 2 PDP Policy Service (OPA) component PRD
oblinder ecd2682
docs: Update PRD for Phase 2 OPA architecture and idp/pdp namespace s…
oblinder 7f97ad4
docs: Remove Phase 1/2 duality from PRD and component specs
oblinder 8b4a452
docs: add State Management Service and state library PRDs; update mas…
oblinder 3de803d
docs: rename Kubernetes Interface Pod to Kagenti Interface Pod, add S…
oblinder a22252a
docs: update requirements to reflect OPA-first architecture and Kagen…
oblinder 14e4d77
docs: rename PDP Interface Pod to Kagenti Interface Pod in standalone…
oblinder f043e3b
docs(aiac): update state management PRD for SQLite + StatefulSet
oblinder 266451a
docs(aiac): rename State Management Service and PDP Policy Service
oblinder 4f8dd9c
docs: Remove deployment topology section from PRD; sync architecture …
oblinder 56af270
Minor arch diagram update
oblinder 2102282
temp
anatolykoyfman 2eee262
temp
anatolykoyfman 43267a4
temp, fix tests
anatolykoyfman a422ac4
fix prompts + add tests
anatolykoyfman 8d7d4eb
docs: redesign AIAC policy architecture — Policy Store, PCE, Policy M…
oblinder ee3b6ed
docs(aiac-agent): replace PolicyBuilder TBD with SharedApplyGraph and…
oblinder 70bd6b2
refactor: rename aiac.pdp.library.configuration → aiac.idp.configurat…
oblinder bf745b4
docs: sync ARCHITECTURE-SUMMARY diagram and component table with PRD
oblinder 7057171
docs(aiac-agent): replace shared apply node with Policy Rules Builder…
oblinder 050646a
docs(aiac-agent): align PRD with Policy Rules Builder architecture
oblinder 3de182a
docs(aiac-agent): remove stale shared module and LLM integration; ext…
oblinder 19e6968
docs(aiac-agent): simplify file structure tree
oblinder 863dd14
docs(aiac-agent): align main PRD with grill-me shared contract
oblinder 6d61e4d
docs(aiac-agent): rewrite UC1, UC2, UC3 sub-PRDs per grill-me session
oblinder 990b382
docs(aiac-agent): rename Service Policy Update sub-agent to Service P…
oblinder 9d6e4b0
docs(aiac-agent): specify Policy Rules Builder interface
oblinder ba9ae0b
docs(aiac-agent): move PRB calls from Controller into producing sub-a…
oblinder 03218be
docs(aiac): align idp-configuration-service spec with implementation
oblinder d715b89
feat(aiac): implement id-only hash/eq, remove set_service_type, updat…
oblinder df10fd7
minor pathe related fixes
anatolykoyfman b02f400
Merge branch 'aiac' of github.com:s-and-p-team/kagenti-extensions int…
anatolykoyfman bbafbd3
docs(aiac): add subject_roles to AgentPolicyModel and PCE algorithm
oblinder b9667dd
feat(aiac): add get_subjects_by_role, move IdP tests to test/idp/
oblinder 8f1f718
Adding aiac/.gitignore
oblinder 7dadcdf
test(aiac): add unit tests for Subject hashability and get_subjects_b…
oblinder d515332
feat(aiac): add aiac.policy.model package with PolicyRule, AgentPolic…
oblinder 43c5f0e
feat(aiac): add policy store service with SQLite-backed FastAPI and u…
oblinder 9a0c18d
feat(aiac): add policy store library and unit tests
oblinder fa4253f
new model struct
anatolykoyfman d270cad
new rego builder + new policy retuns
anatolykoyfman d3f55ab
docs: rename aiac-pdp-policy-service ClusterIP to aiac-pdp-policy-wri…
oblinder 3389cc2
refactor(policy): remove IdP model hashability, key policy maps by st…
oblinder dc8f879
docs: Align PDP writer, PCE, and PRD with revised policy model spec
oblinder b6dfcb3
feat(aiac): add Rego package generator for PDP policy writer
oblinder 7a3e05e
feat(aiac): add PDP Policy Writer OPA filesystem stub service
oblinder 094d650
style: Sort imports in OPA policy-writer per ruff
oblinder c7f5d9c
Style: Fix ruff lint errors across src/aiac
oblinder 8a4606e
remove old rego generation
anatolykoyfman bff3dea
merge
anatolykoyfman b129075
remove old
anatolykoyfman 137fa5f
cleanup
anatolykoyfman 0839b3a
feat(aiac): Add aiac.pdp.policy.library OPA HTTP client with unit tests
oblinder a384ab2
style(aiac): Add aiac-local ruff config and fix lint violations
oblinder 76673a9
docs: Rework PDP policy-writer PRD to ID-only rego model; index integ…
oblinder e254369
docs: Add PDP Policy Writer (OPA) integration-test spec
oblinder 48c6d33
refactor(aiac): Rewrite OPA Rego generator to ID-only model
oblinder ad0a971
test(aiac): Add PDP policy-writer OPA integration launcher (generate_…
oblinder efd8bb2
Refactor(aiac): Reset stale agent layer; finish pdp.policy.library cl…
oblinder 5e64916
Docs(aiac): Update CLAUDE.md for the agent layer reset
oblinder 12dcb1b
feat(aiac): Add Policy Computation Engine (aiac.policy.computation)
oblinder 299b83e
docs(aiac): Move role flattening upstream of PRB; add PCE append/over…
oblinder 72be811
feat(aiac): Add PCE override merge mode and drop role flattening
oblinder 9c97d22
Refactor(aiac): Drop unused _BASE_URL constant in policy store library
oblinder 98f6ffe
feat(aiac): Add agent Controller skeleton + flatten_role helper
oblinder a9a34a2
docs: Record resolved Policy Rules Builder internal design
oblinder 3aa30fa
feat(aiac): Implement Policy Rules Builder phase 1
oblinder f036229
docs: add Keycloak access control analysis for U→A→T scenario with RB…
oblinder 615286e
chore: gitignore aiac/inception/plans and remove stale aiac artefact …
oblinder e650bd3
docs: add OPA-as-PDP architecture sections to Keycloak access control…
oblinder 13c47b7
fix(aiac): Filter services client-side and drop role→scopes endpoint
oblinder 842de2a
feat(aiac): route PCE rules by kind and add outbound subject gate
oblinder 26acebb
docs: Add policy-pipeline integration-test spec and index it in the PRD
oblinder fbbe9be
feat(aiac): add policy-pipeline integration test (5.3) with shared la…
oblinder 0a69bc2
docs(aiac): record 5.3 launcher deviations in policy-pipeline spec
oblinder 8544600
feat(aiac): mark AIAC-provisioned roles/scopes and filter Keycloak bu…
oblinder 0d37879
feat(aiac): canonical client.type attribute for service typing with I…
oblinder 8304b75
docs(aiac): make policy-pipeline scenario descriptions generic and ty…
oblinder 5ab2fa1
docs(aiac): reframe policy-pipeline spec as asserting opa-eval pytest…
oblinder 94d036a
test(aiac): add policy-pipeline OPA-eval integration test; align scen…
oblinder 2f09954
docs(aiac): elaborate policy-pipeline roles; rename agent roles to so…
oblinder dc3b5b2
fix(aiac): scope PRB auditor to one access relationship per verdict
oblinder ff28299
fix(aiac): converge PRB output across explicit/abstract policy variants
oblinder 0c85274
chore(aiac): gitignore policy-pipeline integration-test rego_out
oblinder 9f8b61b
refactor(aiac): remove spiffe:// clientId type fallback in IdP models
oblinder dba699f
docs(aiac): label-based onboarding classification + hybrid MCP tool l…
oblinder dc696f0
chore(aiac): untrack and gitignore gh-issues drafts
oblinder 1546c51
docs: Clarify UC1 own-vs-other roles/scopes and self-mapping invariant
oblinder 1c08a03
feat(aiac): Service Provision sub-agent (UC1) + shared ServiceType
oblinder 1b65c53
feat(aiac): Service Policy sub-agent (UC1) + shared run_upstream helper
oblinder 7838ab0
refactor(aiac): Rename Service Policy sub-agent to Service Policy Bui…
oblinder 7d56f1f
feat(aiac): Service Onboarding Orchestrator (UC1) — provision → polic…
oblinder 89ec0da
refactor(aiac): Relocate run_upstream to project level and push retri…
oblinder e977da4
Fix(aiac): Reconcile PRB deny-by-default with description-based grants
oblinder 25d54e2
Refactor(aiac): Factor generic policy into the PRB prompt
oblinder 9be73e2
Docs(aiac): Add github-agent demo spec (source + issue A2A agent)
oblinder d893168
Docs(aiac): Spec UC-1 onboarding-pipeline integration test + github-t…
oblinder bbbd1cc
Test(aiac): Assert onboarding orchestrator invokes provision graph wi…
oblinder 08113fc
Feat: Add minimal github-tool MCP demo server (UC-1 discovery)
oblinder 3085e24
Feat(aiac): Add github-agent demo (GA-1…GA-9)
oblinder d5d0808
Feat(aiac): Add k8s deployment manifests Phase 1 — Interface Pod, Pol…
oblinder dd59149
Fix(aiac): Phase 1 k8s — Policy Store own ConfigMap, keycloak PDP Pol…
oblinder 84cc2ae
fix: use localhost/...:local image names in AIAC k8s production manif…
oblinder 560f921
docs: reorganise inception/ into docs/ — specs, issues, handoffs, gh-…
oblinder 29fa093
Test(aiac): Add UC-1 onboarding-pipeline integration test (5.4)
oblinder 16856df
Chore(aiac): Retarget github demo manifests to aiac-demo namespace
oblinder e999512
Docs: Add AIAC specification documents
oblinder 2929605
Merge branch 'aiac' into aiac-phase1
oblinder 6b764be
Chore(aiac): Defer aiac-init and phase-gated env vars from Phase 1 de…
oblinder c983a34
Chore(aiac): Retarget github demo manifests back to team1 namespace
oblinder dfbaaf7
Chore(aiac): Point github demo at existing kagenti realm
oblinder b51ebd5
Docs(aiac): Reframe uc1-onboarding integration test as a rung ladder
oblinder 24767fc
Docs(aiac): Apply SPM/APM redesign across policy component specs
oblinder 98ad2c3
feat(aiac): Add ServicePolicyModel + Role/Scope SPM fields (Wave 1)
oblinder 195590e
Test(aiac): Verify idp Configuration surfaces SPM/APM fields (handoff…
oblinder 27304c7
Feat(aiac): SPM-centric policy store (persist SPMs, drop APM persiste…
oblinder eaa8961
Feat(aiac): Source agent roles from client roles + populate SPM/APM f…
oblinder 0096426
Refactor(aiac): Rewrite PCE to SPM-based order-independent engine
oblinder abd1b91
Docs(aiac): Refresh CLAUDE.md source/image map post handoffs 01-05
oblinder fa1957b
Test(aiac): Fix stale store DB env var name in policy-pipeline integr…
oblinder dc8e677
Fix(aiac): Populate agent-role kind/actorIds + scope.serviceId at IdP…
oblinder 545bdc3
Docs(aiac): Reconcile IdP role-sourcing specs with two-source agent r…
oblinder f9fb74a
fix(demo): add protocol label and direct agent port for AgentCard aut…
oblinder 6071eb8
Fix(aiac): Deploy OPA rego-file PDP writer in Phase 1, not Keycloak mock
oblinder 14e7761
Fix(aiac): UC-1 onboarding pipeline fixes + rung-1 integration test
oblinder 9c5cdee
Docs(aiac): Reconcile UC-1 specs with the onboarding pipeline fixes
oblinder 5864c2c
Docs(aiac): Reconcile PCE spec/PRD with re-raise (was fire-and-forget…
oblinder 8701788
Docs(aiac): Add Kagenti dev-guide link to CLAUDE.md external references
oblinder 452aba6
test(aiac): Add UC-1 onboarding rung-2 integration test + shared harness
oblinder 45a6169
Fix(aiac): Policy Store slash-safe service_id + SPIFFE-aware slugify
oblinder caa2978
Chore(aiac): Remove obsolete onboarding.old and test_llm_config.py.old
oblinder 0eabfd0
Fix(aiac): Authenticate UC-1 tool MCP discovery with tool-audienced t…
oblinder 7be21bf
docs(aiac): Reconcile IdP/library/UC-1 specs with discovery-token fix
oblinder 97dec16
test(aiac): Capture UC-1 rego into per-rung project subfolders
oblinder f721b38
test(aiac): Nest policy-pipeline rego under rego_out/policy_pipeline
oblinder e02d1f9
Fix(aiac): Align UC-1 integration realm with deployed stack (kagenti)
oblinder ba29c03
Test(aiac): Rename policy-pipeline throwaway realm to aiac-pp
oblinder 07cd7d6
chore(aiac): Remove unused test/fixtures directory
oblinder 0ee4dcc
docs: Correct PDP responsibility wording in architecture summary
oblinder dff7f34
docs(aiac): Fix OPA/token-issuance contradiction in spec docs
oblinder d86c9d6
docs: Align PDP Policy Writer service name and library import path
oblinder 591251c
docs: Fix module path, naming, and link inconsistencies in AIAC specs
oblinder f573c9d
docs(aiac): Fix dangling link to issue 6.2 in uc1-service-onboarding …
oblinder 1f34234
fix: Exclude Keycloak default-roles composite from GET /roles
oblinder 1be366e
fix(pdp): Drop dead agent_scopes from outbound Rego package
oblinder dc290f0
fix: Source Service Policy Builder candidates from get_services()/get…
oblinder 3476833
test: Rewrite Service Policy Builder unit tests for ownership-based c…
oblinder 00eb321
fix: Resolve Service Policy Builder focus by internal client UUID
oblinder 93814b8
docs: Correct service_id identity to internal client UUID
oblinder 4b1d5e2
chore: Drop onboarding.old/policy from ruff/pytest config
oblinder bc164b0
feat: Add Policy Store clear-all endpoint and clear store per UC-1 run
oblinder 11eb02c
docs: Record RC-B per-scope two-gate AND + capability-match in PCE an…
oblinder 5535e05
feat: Capability-match UC-1 outbound as per-scope two-gate AND
oblinder 15bc220
test: Align 5.3 pipeline agent roles to UC-1 (source_operations / iss…
oblinder e0781e1
feat: Add PCE decommission (service offboard) + offboard route
oblinder 4d76052
Merge origin/main into aiac-phase1-pr
oblinder 8bdb5b3
chore: Fix pre-commit hook findings on PR diff files
oblinder 05abdb2
Merge remote-tracking branch 'origin/main' into aiac-phase1-pr
oblinder 6a019bf
fix(aiac): Address CodeRabbit review findings on UC-1 Phase 1
oblinder a9de8f9
Fix: Address second CodeRabbit pass on UC-1 Phase 1
oblinder 4686e75
Fix: Resolve CodeQL security findings on UC-1 Phase 1
oblinder 58160b0
Fix: Resolve CodeQL SSRF/path-injection and chromadb dependency-revie…
oblinder 36c7d73
Fix: Bump json-repair to 0.60.1 to clear dependency-review DoS finding
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,113 @@ | ||
| # 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) | | ||
|
|
||
| ## 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.