Skip to content

docs: update Template System and Architecture section with accurate Context struct and file mapping - #276

Merged
edenreich merged 1 commit into
mainfrom
fix/issue-269
Jul 14, 2026
Merged

edenreich merged 1 commit into
mainfrom
fix/issue-269

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Resolves #269

Summary

Updated the "Template System & Architecture" section in README.md to accurately reflect the full Context struct and file mapping system as implemented in internal/templates/engine.go and internal/templates/registry.go. The previous documentation showed a simplified 3-field struct and incomplete file lists for each language.

Changes

  • Updated the Context struct to include all 12 fields from the actual implementation: ADL, Metadata, Language, GenerateCI, GenerateCD, EnableAI, AIToggles, GenerateCommand, Skills, BuiltinConfigs, Vendor, and SandboxDeps
  • Expanded Go project file mapping to include config, logger, services, built-in tools with tests, telemetry, Docker, CI/CD workflows, sandbox environments, AI documentation, issue templates, and dependabot config
  • Expanded Rust project file mapping to include built-in tools, Docker, CI/CD workflows, sandbox environments, AI documentation, issue templates, and dependabot config
  • Added a new TypeScript project file mapping section covering all generated files including services, tools index, Cloudflare Worker, and conditional deployment/sandbox/AI files
  • Removed the outdated "Universal Files" section since each language now has its own complete listing

…ontext struct and file mapping

Update the Context struct in the README to match the actual implementation in internal/templates/engine.go, which includes GenerateCI, GenerateCD, EnableAI, AIToggles, GenerateCommand, Skills, BuiltinConfigs, Vendor, and SandboxDeps fields.

Expand the file mapping system description for Go, Rust, and TypeScript projects to include all generated files: config, logger, services, built-in tools, telemetry, Docker, CI/CD workflows, sandbox environments, AI documentation, issue templates, and dependabot config.
@edenreich
edenreich marked this pull request as ready for review July 14, 2026 19:26
@edenreich
edenreich requested a review from a team as a code owner July 14, 2026 19:26
@edenreich
edenreich merged commit 352d084 into main Jul 14, 2026
1 check passed
@edenreich
edenreich deleted the fix/issue-269 branch July 14, 2026 19:27
inference-gateway-releaser Bot added a commit that referenced this pull request Jul 14, 2026
## [0.48.0](v0.47.1...v0.48.0) (2026-07-14)

### ✨ Features

* bump Go version to 1.26.4 ([#279](#279)) ([4945a28](4945a28))
* generate OTel-aligned telemetry configuration from extended spec.telemetry ([#281](#281)) ([47c5b3d](47c5b3d))

### 🐛 Bug Fixes

* quote boolean and numeric env values in compose template ([#267](#267)) ([6198824](6198824))

### 📚 Documentation

* add missing CLI flags to README generate/init flag tables ([#275](#275)) ([db0a842](db0a842))
* document spec.telemetry OpenTelemetry generation ([#277](#277)) ([bd75c08](bd75c08)), references [#259](#259)
* fix project structure diagrams and universal files section ([#274](#274)) ([17bad1b](17bad1b)), closes [#272](#272)
* mark Service Injection code examples as illustrative with template references ([#278](#278)) ([69b9806](69b9806))
* remove missing example ref, document all examples ([#273](#273)) ([4e30aff](4e30aff)), closes [#268](#268)
* update Template System and Architecture section with accurate Context struct and file mapping ([#276](#276)) ([352d084](352d084))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.48.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Jul 14, 2026
inference-gateway-maintainer Bot added a commit that referenced this pull request Aug 7, 2026
Updates stale ADK #276 references in authz.go.tmpl - the fix has been released so comments now use present/past tense.
edenreich pushed a commit that referenced this pull request Aug 7, 2026
…agents (#357)

* feat(generate): scaffold authorization decision hook in generated Go agents

* feat(generate): gate authz on spec.server.authz instead of auth

Make the authorization decision hook opt-in under its own spec.server.authz block instead of piggybacking on spec.server.auth.enabled.

- Add AuthzConfig to schema.json with enabled bool + mode enum (allow-all, deny-all, custom) and regenerate types.go

- Gate authz file generation, .adl-ignore protection, and main.go wiring on spec.server.authz.enabled

- Update authz.go.tmpl to accept a mode parameter and act accordingly (allow-all, deny-all, or custom)

- Update README.md.tmpl feature badge to reference authz

- Update go-agent-authz.yaml example to use the authz block

- Track upstream schema in inference-gateway/adl#159

* refactor(templates): use typed AuthzMode enum instead of raw strings in generated authz.go

Replace magic string comparisons with an AuthzMode type and
exported constants (ModeAllowAll, ModeDenyAll, ModeCustom)
in the generated authz.go template. The BeforeTool function
now accepts AuthzMode instead of string.

Update main.go.tmpl to pass the typed constants based on the
ADL spec value, removing the raw string interpolation.

* feat(templates): add Identity type and IdentityFrom helper for caller-aware authz

Add authz.Identity struct (Subject, Email, Issuer) mapping OIDC ID token claims and IdentityFrom(*ToolContext) helper that reads from toolCtx.State when the ADK surfaces claims (tracked in inference-gateway/adk#276). Returns empty Identity until then - the authz hook MUST allow calls through on empty identity.

Update the BeforeTool doc comment to show identity-aware authz in the example. Add asString helper for safe map-value extraction.

* chore: bump ADL_SCHEMA_VERSION to v0.25.0 and sync schema

Updates stale ADK #276 references in authz.go.tmpl - the fix has been released so comments now use present/past tense.

---------

Co-authored-by: inference-gateway-maintainer[bot] <246577062+inference-gateway-maintainer[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOCS] Template System and Architecture section has incomplete Context struct and file mapping

1 participant