Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

cnlangzi
Copy link
Member

@cnlangzi cnlangzi commented Oct 15, 2025

Changed

Fixed

Added

  • docs: added AGENTS.md for AI Agent

Tests

Tasks to complete before merging PR:

  • Ensure unit tests are passing. If not run make unit-tests to check for any regressions πŸ“‹
  • Ensure lint tests are passing. if not run make lint to check for any issues
  • Ensure codecov/patch is passing for changes.

@sourcery-ai
Copy link

sourcery-ai bot commented Oct 15, 2025

Reviewer's Guide

Introduces a new AGENTS.md file that serves as an end-to-end developer guide for the xun framework’s AI Agent features, covering core concepts, setup, routing, viewers, templating, assets, extensions, and best practices.

Class diagram for core xun framework types (from AGENTS.md)

classDiagram
class App {
  +ServeMux
  +routes
  +globalMiddlewares
  +viewEngines
  +viewers
  +compressors
  +templateFuncMap
  +assetURLMap
  +Start()
  +Close()
  +Get()
  +Group()
  +Use()
}
class Context {
  +Request
  +Response
  +Routing
  +App
  +TempData
  +View()
  +Redirect()
  +Accept()
  +AcceptLanguage()
  +Get()
  +Set()
}
class Viewer {
  +MimeType
  +Render()
}
class ViewEngine {
  +Load()
  +FileChanged()
}
class ResponseWriter {
  +http.ResponseWriter
  +status
  +bodyBytes
  +Close()
}
App "1" -- "*" Context : creates
App "1" -- "*" ViewEngine : uses
App "1" -- "*" Viewer : uses
App "1" -- "*" ResponseWriter : wraps
Context "1" -- "1" App : belongs to
Context "1" -- "1" ResponseWriter : wraps
Viewer <|-- HtmlViewer
Viewer <|-- JsonViewer
Viewer <|-- TextViewer
Viewer <|-- XmlViewer
Viewer <|-- StringViewer
Viewer <|-- FileViewer
ViewEngine <|-- HtmlViewEngine
ViewEngine <|-- TextViewEngine
ViewEngine <|-- StaticViewEngine
Loading

Class diagram for extension modules (ext/*) overview

classDiagram
class ACL {
  +filterByHost()
  +filterByIP()
  +filterByCIDR()
  +filterByCountry()
  +redirect()
  +hotReloadConfig()
}
class AutoTLS {
  +manageCertificates()
  +renewCertificates()
}
class Cache {
  +cacheHelpers()
}
class Cookie {
  +base64Cookies()
  +signedCookies()
}
class CSRF {
  +csrfProtection()
  +jsToken()
}
class Form {
  +BindQuery[T]()
  +BindForm[T]()
  +BindJson[T]()
  +Validate()
}
class HSTS {
  +enforceHSTS()
  +redirectHTTP()
}
class HTMX {
  +integrationHelpers()
  +interceptor()
}
class ProxyProto {
  +supportV1()
  +supportV2()
}
class ReqLog {
  +accessLogMiddleware()
}
class SSE {
  +sessions()
  +push()
  +broadcast()
  +shutdown()
}
App "1" -- "*" ACL : uses
App "1" -- "*" AutoTLS : uses
App "1" -- "*" Cache : uses
App "1" -- "*" Cookie : uses
App "1" -- "*" CSRF : uses
App "1" -- "*" Form : uses
App "1" -- "*" HSTS : uses
App "1" -- "*" HTMX : uses
App "1" -- "*" ProxyProto : uses
App "1" -- "*" ReqLog : uses
App "1" -- "*" SSE : uses
Loading

File-Level Changes

Change Details Files
Added comprehensive Xun AI Agents developer guide
  • Documented core concepts, context, viewer, and engine abstractions
  • Outlined project structure, routing patterns, and middleware order
  • Specified error contracts and extension points
  • Included best practices, performance notes, and pitfalls
AGENTS.md
Embedded code snippets and real-world usage examples
  • App creation, lifecycle, and server initialization samples
  • Routing, handler signatures, and middleware usage examples
  • Viewer, templating, asset fingerprinting, and compression demonstrations
  • Minimal production setup and safe-change checklist
AGENTS.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepsource-io
Copy link

deepsource-io bot commented Oct 15, 2025

Here's the code health analysis summary for commits 39d4d77..a9c6244. View details on DeepSourceΒ β†—.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Go LogoGoβœ…Β SuccessView CheckΒ β†—

πŸ’‘ If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click πŸ‘ or πŸ‘Ž on each comment and I'll use the feedback to improve your reviews.

@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 91.70%. Comparing base (39d4d77) to head (a9c6244).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #90   +/-   ##
=======================================
  Coverage   91.70%   91.70%           
=======================================
  Files          66       66           
  Lines        2676     2676           
=======================================
  Hits         2454     2454           
  Misses        192      192           
  Partials       30       30           
Flag Coverage Ξ”
Unit-Tests 91.70% <ΓΈ> (ΓΈ)

Flags with carried forward coverage won't be shown. Click here to find out more.

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cnlangzi cnlangzi merged commit ff5e0e0 into main Oct 15, 2025
8 of 10 checks passed
@cnlangzi cnlangzi deleted the fix/ai_agents branch October 15, 2025 09:11
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