Skip to content

Documentation#28

Merged
msafarik merged 8 commits into
mainfrom
documentation
May 19, 2026
Merged

Documentation#28
msafarik merged 8 commits into
mainfrom
documentation

Conversation

@msafarik
Copy link
Copy Markdown
Collaborator

@msafarik msafarik commented May 13, 2026

Rewrite README to include configuration table and detailed Makefile descriptions. Add an architecture overview with a Mermaid component diagram and a project structure diagram. Add the MCP tools reference listing all 23 tools and fix configs for functional e2e tests.

Summary by Sourcery

Document Keylime MCP architecture, configuration, and tooling, and update testing and CI settings.

CI:

  • Broaden Packit PR test matrix to include additional Fedora targets.

Documentation:

  • Rewrite README with configuration table, Makefile command reference, and testing instructions.
  • Add architecture overview and project structure documentation with Mermaid component diagram.
  • Add MCP tools reference documenting all available tools and their Keylime API mappings.

Tests:

  • Document and refine e2e Testing Farm setup and plans for server, client, and main workflows.

Summary by CodeRabbit

  • Chores

    • Updated environment defaults: Keylime API → v2.5, web UI port → 3000, TLS server name → localhost; reorganized example config sections.
    • Added persistent and session certificate setup flows with systemd-backed ACL persistence, session-only ACL option, expanded dependency checks, and cleanup handling.
  • Tests

    • Expanded Fedora test targets for additional architectures.
    • Test plans and provisioning now use dynamic references for sourcing test definitions.

Review Change Stack

Marek Safarik added 3 commits May 12, 2026 14:55
Signed-off-by: Marek Safarik <msafarik@redhat.com>
Signed-off-by: Marek Safarik <msafarik@redhat.com>
Signed-off-by: Marek Safarik <msafarik@redhat.com>
@msafarik msafarik self-assigned this May 13, 2026
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 13, 2026

Reviewer's Guide

Documentation-focused PR that rewrites the README to add configuration and Makefile command documentation, introduces architecture and MCP tools reference docs, and adjusts Packit/e2e configs to run functional tests across additional Fedora targets.

File-Level Changes

Change Details Files
Rewrite README with configuration table, Makefile command reference, and testing documentation, and streamline usage instructions.
  • Condensed introduction and requirements to emphasize Keylime dependencies and MCP client usage
  • Added configuration section with environment variable table sourced from .env.example
  • Replaced simple command bullet list with a detailed Makefile command table and explanations
  • Documented unit and e2e testing workflows, including Testing Farm/Packit integration and TMT plans
  • Linked out to new architecture and MCP tools reference docs and simplified contributing/license sections
README.md
Expand Packit test matrix to cover additional Fedora architectures for PR-triggered tests.
  • Added fedora-latest-x86_64 and fedora-latest-aarch64 to Packit tests job targets while keeping rawhide targets
  • Left build skipping enabled to focus on functional tests
.packit.yaml
Introduce MCP tools reference documenting all exposed tools and their mapping to Keylime APIs.
  • Created tools reference document grouped by System, Agent Management, Runtime Policies, and Measured Boot Policies
  • Documented 23 tools with concise descriptions aligned to Keylime REST operations
doc/tools.md
Add architecture overview documenting binaries, component interactions, and project layout, including design considerations.
  • Documented high-level split between MCP server and web client binaries and their responsibilities
  • Added Mermaid component diagram of browser, web server, agent, MCP server, LLM providers, and Keylime services
  • Documented project directory structure and responsibilities of major internal packages
  • Captured design notes on data masking, safe operations, and provider abstraction for LLMs
doc/architecture.md
Align environment configuration example and e2e plans/provisioning configs with documented behavior for functional e2e tests.
  • Ensured .env.example matches new README configuration table and documented variables
  • Adjusted e2e TMT plans to reference correct components (server, client, main) and align with test documentation
  • Updated e2e provisioning/cleanup plans for Keylime services to match current test expectations and functional flows
.env.example
e2e/plans/keylime-mcp-client.fmf
e2e/plans/keylime-mcp-main.fmf
e2e/plans/keylime-mcp-server.fmf
e2e/provision/cleanup-keylime-services/main.fmf
e2e/provision/setup-keylime-services/main.fmf

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 974e99ed-7e8c-492d-976c-d5391a050b9a

📥 Commits

Reviewing files that changed from the base of the PR and between 07a8242 and a3e1f1b.

📒 Files selected for processing (1)
  • Makefile

📝 Walkthrough

Walkthrough

Updates example configuration defaults (Keylime API v2.5, TLS server name localhost, port 3000), migrates FMF refs to a TMT dynamic reference, adds Fedora “latest” targets to Packit CI, and adds Makefile targets and systemd wiring for certificate ACL setup and cleanup.

Changes

Configuration and Test Infrastructure

Layer / File(s) Summary
Example Configuration Defaults
.env.example
Keylime API version bumps from v2.4 to v2.5; KEYLIME_TLS_SERVER_NAME set to localhost; example port changed from 8080 to 3000; comments/sections reorganized.
Test Reference Infrastructure Migration
e2e/plans/keylime-mcp-client.fmf, e2e/plans/keylime-mcp-main.fmf, e2e/plans/keylime-mcp-server.fmf, e2e/provision/cleanup-keylime-services/main.fmf, e2e/provision/setup-keylime-services/main.fmf
FMF plan and provision files switch their repository ref from main to the TMT dynamic reference @.tmt/dynamic_ref.fmf.
CI Testing Targets
.packit.yaml
Packit tests job targets list extended with Fedora “latest” targets for x86_64 and aarch64, inserted before rawhide entries.
Makefile Cert Setup and Cleanup
Makefile
.PHONY and help updated; add setup-certs-session (session-only) and modify setup-certs to persist ACLs via a generated/enabled keylime-mcp-certs.service oneshot; add variables to compute EFFECTIVE_USER/UID and generated paths; check-deps extended to require setfacl, systemctl, and sudo; clean extended to remove/disable the generated unit and tmpfiles config.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Documentation' is vague and generic, using a non-descriptive term that doesn't clearly convey the specific changes made in the changeset. Revise the title to be more specific and descriptive. Consider titles like 'Update configuration defaults and test references' or 'Update Keylime API version, port, and dynamic test references' to better reflect the actual changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch documentation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@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 - 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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/provision/setup-keylime-services/main.fmf`:
- Line 13: The five FMF files reference a missing .tmt/dynamic_ref.fmf; either
create the .tmt directory and add a .tmt/dynamic_ref.fmf with the expected ref
configuration, or update the ref entries in the affected files (main.fmf in
e2e/provision/setup-keylime-services, e2e/provision/cleanup-keylime-services,
and the three plan files e2e/plans/keylime-mcp-main.fmf, keylime-mcp-server.fmf,
keylime-mcp-client.fmf) to point to an existing FMF reference path; ensure the
created .tmt/dynamic_ref.fmf exports the same variables/refs those five files
expect so tests resolve correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 38ca73af-f88a-4218-9259-fca35806a9ce

📥 Commits

Reviewing files that changed from the base of the PR and between c230eaf and c1aff9a.

⛔ Files ignored due to path filters (3)
  • README.md is excluded by !**/*.md
  • doc/architecture.md is excluded by !**/*.md
  • doc/tools.md is excluded by !**/*.md
📒 Files selected for processing (7)
  • .env.example
  • .packit.yaml
  • e2e/plans/keylime-mcp-client.fmf
  • e2e/plans/keylime-mcp-main.fmf
  • e2e/plans/keylime-mcp-server.fmf
  • e2e/provision/cleanup-keylime-services/main.fmf
  • e2e/provision/setup-keylime-services/main.fmf

Comment thread e2e/provision/setup-keylime-services/main.fmf
Signed-off-by: Marek Safarik <msafarik@redhat.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Makefile (1)

73-85: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Preflight new command dependencies in check-deps.

Lines 73–85 don't validate setfacl/sudo/systemctl, even though Line 46 and Line 64 depend on them. Missing tools will fail later with less actionable errors.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 73 - 85, The check-deps Makefile target currently only
verifies Go and certificate files but omits checks for runtime tools used
elsewhere; update the check-deps recipe (the check-deps target) to explicitly
validate availability of setfacl, sudo, and systemctl (using command -v or
similar) and emit clear error messages with remediation hints if any are missing
so the build fails fast with actionable guidance; keep the existing
CERT_FILES/KEYLIME_CERT_DIR certificate checks and add these tool checks before
any certificate or setup steps that rely on them.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Around line 46-71: The ACL commands in targets setup-certs and
setup-certs-session grant permissions to $(USER), which becomes root under sudo;
change occurrences to an expression that prefers the original invoking user
(SUDO_USER) falling back to USER (e.g. use $(or $(SUDO_USER),$(USER))) and
update every place it appears (the service unit lines created in setup-certs
that include ExecStart entries and the setfacl loops in setup-certs-session) so
setfacl and the unit file grant ACLs to the effective non-root user; ensure
references to CERT_FILES, KEYLIME_CERT_DIR and SYSTEMD_SERVICE remain unchanged
except for replacing $(USER) with the SUDO_USER-or-USER expression.

---

Outside diff comments:
In `@Makefile`:
- Around line 73-85: The check-deps Makefile target currently only verifies Go
and certificate files but omits checks for runtime tools used elsewhere; update
the check-deps recipe (the check-deps target) to explicitly validate
availability of setfacl, sudo, and systemctl (using command -v or similar) and
emit clear error messages with remediation hints if any are missing so the build
fails fast with actionable guidance; keep the existing
CERT_FILES/KEYLIME_CERT_DIR certificate checks and add these tool checks before
any certificate or setup steps that rely on them.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 04efe6d3-4ccb-489c-8fb1-00d74d7d22cf

📥 Commits

Reviewing files that changed from the base of the PR and between c1aff9a and 71883d0.

⛔ Files ignored due to path filters (2)
  • README.md is excluded by !**/*.md
  • doc/tools.md is excluded by !**/*.md
📒 Files selected for processing (1)
  • Makefile

Comment thread Makefile
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Around line 78-81: The help text for the Makefile's dependency check is out of
sync with the expanded checks; update the Makefile help text (the description
shown for the check-deps/check targets) so it lists setfacl, systemctl, and sudo
alongside the existing Go/cert checks, keeping the alignment/format of the help
output consistent with the other lines; locate the help/usage echo block and the
check-deps target (the block that currently runs the three `@command` -v ...
checks) and expand its descriptive line to mention all four dependencies.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 33622556-4862-4f05-bb1a-498c11a8dcbb

📥 Commits

Reviewing files that changed from the base of the PR and between 71883d0 and 6a8d60d.

📒 Files selected for processing (1)
  • Makefile

Comment thread Makefile
…t ai PR review)

Signed-off-by: Marek Safarik <msafarik@redhat.com>
Comment thread Makefile
@echo " Certs: OK"
@echo "All dependencies satisfied."

install: setup-certs check-deps .env build
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.

Not from this PR, but this caught my attention anyway. Shouldn't we have check-deps before setup-certs?

Comment thread Makefile
Comment on lines +49 to +59
@printf '%s\n' \
"[Unit]" \
"Description=Grant certificate access for Keylime MCP" \
"After=systemd-tmpfiles-setup.service" \
"[Service]" \
"Type=oneshot" \
$(foreach f,$(CERT_FILES),"ExecStart=/usr/bin/setfacl -m u:$(EFFECTIVE_USER):r $(KEYLIME_CERT_DIR)/$(f)") \
"ExecStart=/usr/bin/setfacl -m u:$(EFFECTIVE_USER):rx /var/lib/keylime" \
"ExecStart=/usr/bin/setfacl -m u:$(EFFECTIVE_USER):rx $(KEYLIME_CERT_DIR)" \
"[Install]" \
"WantedBy=multi-user.target" \
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.

I think we need RemainAfterExit=yes. Without it, the service shows as inactive (dead) after running, even on success. With it, it shows active (exited), which is kind of the standard pattern for oneshot setup services, and the only way to confirm via systemctl that it ran on the current boot. Add it after "Type=oneshot".

Comment thread Makefile Outdated
Comment on lines +55 to +57
$(foreach f,$(CERT_FILES),"ExecStart=/usr/bin/setfacl -m u:$(EFFECTIVE_USER):r $(KEYLIME_CERT_DIR)/$(f)") \
"ExecStart=/usr/bin/setfacl -m u:$(EFFECTIVE_USER):rx /var/lib/keylime" \
"ExecStart=/usr/bin/setfacl -m u:$(EFFECTIVE_USER):rx $(KEYLIME_CERT_DIR)" \
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.

Let's change the order of the ExecStart lines here: do the directories first, then the files. The way it is works because the services run as root, but it creates a brief window during boot where file ACLs exist but directories are not traversable.

Signed-off-by: Marek Safarik <msafarik@redhat.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Line 93: The install target fails because check-deps runs the certificate
readability checks (in the check-deps target) before setup-certs can grant ACLs;
fix by either (A) reordering install's prerequisites to run setup-certs before
check-deps (change install: check-deps setup-certs .env build to install:
setup-certs check-deps .env build) or (B) add a new lightweight prerequisite
(e.g., check-deps-tools) that omits the cert-readability checks and use that in
install instead of check-deps; update the Makefile so install invokes
setup-certs (or the tools-only check) prior to any cert validation to avoid
early exit on fresh systems while preserving the full check-deps target for
CI/dev flows.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6b26bed8-a3d9-45bf-a112-ea6bb7265257

📥 Commits

Reviewing files that changed from the base of the PR and between 6a8d60d and 07a8242.

📒 Files selected for processing (1)
  • Makefile

Comment thread Makefile Outdated
…ore its checked

Signed-off-by: Marek Safarik <msafarik@redhat.com>
@msafarik msafarik requested a review from sergio-correia May 18, 2026 11:04
Signed-off-by: Marek Safarik <msafarik@redhat.com>
@msafarik msafarik merged commit a730b9e into main May 19, 2026
11 checks passed
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