Skip to content

ai: prepare for agentic workflows#290

Open
upils wants to merge 3 commits into
canonical:mainfrom
upils:feat/ai-infra
Open

ai: prepare for agentic workflows#290
upils wants to merge 3 commits into
canonical:mainfrom
upils:feat/ai-infra

Conversation

@upils
Copy link
Copy Markdown
Collaborator

@upils upils commented Apr 23, 2026

  • Have you signed the CLA?

Add scaffolding for agent-agnostic agent workflows. This was mostly produced by an agent, prompted to replicate the existing kb structure from a reference project. Manual changes and further agent work after some steering happened.

@upils upils marked this pull request as ready for review April 24, 2026 14:03
Copy link
Copy Markdown
Collaborator

@letFunny letFunny left a comment

Choose a reason for hiding this comment

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

It is a bit imprecise in some of the descriptions. These discrepancies might not look significant but they might compound into something major if left unchecked. I am not sure what is the best course of action, we can continue and the agents can refine the knowledge and correct themselves as they make changes to the code; or we might correct it ourselves.

Also, I think we should include the .github directory so the agent(s) know when to update the CI, how it is invoked, etc. There is knowledge about how to run the different test suites there for example.

Comment thread cmd/kb/AGENTS.md
- `chisel/cmd_find.go` - Implements the `find` command for searching available slices by name or package.
- `chisel/cmd_info.go` - Implements the `info` command for displaying detailed metadata about specific slices.
- `chisel/cmd_debug.go` - Implements the `debug` subcommand group for internal diagnostics.
- `chisel/cmd_debug_check_release_archives.go` - Implements `debug check-release-archives`, which validates archive configurations in a chisel-releases tree.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is a bit imprecise. I am not sure what is the expected level of detail at this point, it is my understanding this is a rough high level overview per-file and the "knowledge database" will grow to contain more specific instructions later on.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is a bit imprecise.

I agree but I understand the goal is not to be super precise here, but to help the agent knows if going deeper in a specific direction is relevant for whatever task is at hand.

it is my understanding this is a rough high level overview per-file and the "knowledge database" will grow to contain more specific instructions later on.

This is also my understanding, but the proper level of detail is yet to be defined (or at least I still need to form a solid understanding of it). The goal of this PR is to bootstrap the infra with basic knowledge and then play with agents to see how well they work with it.

Comment thread internal/kb/AGENTS.md Outdated
Comment thread internal/kb/AGENTS.md Outdated
Comment thread internal/kb/AGENTS.md
Comment on lines +17 to +19
- `manifestutil/` - Generates the Chisel manifest: a ZSTD-compressed file in jsonwall format recording every installed package, slice, and file. The default filename is `manifest.wall`.
- `scripts/` - Executes Starlark mutation scripts defined in slice definitions. Scripts run after extraction and can transform or clean up files within the target filesystem.
- `control/` - Fast, memory-efficient parser for Debian control files (the metadata sections embedded in `.deb` archives). Uses a two-pass approach: index sections first, then retrieve fields directly on access.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some of these are very good already. I am positively surprised.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It was a mixed bag. The agent was rather good on small packages, doing well-known operations. However it got confused by names on the apache* packages and completely missed the point of these packages until I instructed it to look into the commit history.

Comment thread internal/kb/AGENTS.md Outdated
```
slicer/ → setup/ (resolve slice deps) → archive/ (fetch package indices)
→ cache/ + deb/ (extract .deb to cache by SHA256)
→ fsutil/ (hardlink/copy from cache to target rootfs)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We don't hardlink from cache to rootfs, we hardlink from rootfs to rootfs, this is misleading.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Maybe that is naive but we may want to specifically instruct the agent to carefully avoid any misleading descriptions/statements.

Comment thread internal/kb/AGENTS.md

Chisel's internal packages form a directed dependency chain driven by `slicer/`:

```mermaid
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[Note to reviewer]: I am really not sure about the value of this as it can be discovered again via tools or other sources (semantic index, LSP). This can also very quickly become out of date and thus we should probably make sure the agent is instructed to periodically confirm and update this knowledge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants