Skip to content

feat: add gemara://about resource and richer server instructions - #122

Draft
jpower432 wants to merge 2 commits into
gemaraproj:mainfrom
jpower432:feat/issue-98-about-resource
Draft

feat: add gemara://about resource and richer server instructions#122
jpower432 wants to merge 2 commits into
gemaraproj:mainfrom
jpower432:feat/issue-98-about-resource

Conversation

@jpower432

Copy link
Copy Markdown
Contributor

Summary 🤖

Reduces the server's reliance on ad-hoc web fetches by shipping an LLM-optimized Gemara overview (issue #98).

  • Add a static preamble to the connect-time instructions describing Gemara, the seven-layer model, and artifact types, pointing clients at gemara://about instead of the open web.
  • Add the gemara://about resource: fetches the LLM-optimized guidance from https://gemara.openssf.org/llms-full.txt with a TTL cache and an embedded offline fallback (internal/server/about.md), mirroring the lexicon pattern. Remote auto-activates once llms.txt lands upstream.
  • Add fetcher.NewStaticHTTPFetcher for fixed, unversioned HTTPS URLs.

Testing

  • Unit + integration tests pass; make lint clean.
  • New tests: isValidAbout, NewStaticHTTPFetcher, embedded-content validity, resource registration, and preamble assertions. Network-touching about reads live in the
    integration-tagged file.
  • Smoke-tested the built binary over stdio: initialize returns the preamble; resources/read gemara://about returns text/markdown and correctly falls back to embedded
    on the 404.

Reduces the server's reliance on ad-hoc web fetches by shipping an
LLM-optimized Gemara overview (issue gemaraproj#98).

- Add a static preamble to the connect-time instructions describing
  Gemara, the seven-layer model, and artifact types, pointing clients
  at gemara://about instead of the open web.
- Add the gemara://about resource: fetches the LLM-optimized guidance
  from https://gemara.openssf.org/llms-full.txt with a TTL cache and an
  embedded offline fallback (internal/server/about.md), mirroring the
  lexicon pattern. Remote auto-activates once llms.txt lands upstream.
- Add fetcher.NewStaticHTTPFetcher for fixed, unversioned HTTPS URLs.

Also refresh dependencies and test fixtures to current versions:

- Bump testify to v1.12.1.
- Bump the test schema pin to the gemara CUE module v1.5.0 and refresh
  testdata/good-ccc.yaml from upstream to match the current schema.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Wrap HTTP fetchers with validatingFetcher to validate content BEFORE the
CachedFetcher stores it. This prevents invalid 200 responses (e.g. proxy
error pages) from poisoning the cache and pinning resources to embedded
fallbacks for the entire TTL.

Applied to both about and lexicon resources. Also relaxed isValidAbout to
strip a leading UTF-8 BOM and tolerate heading variations (requires markdown
heading + mentions "Gemara") instead of strict "# Gemara" prefix.

Add regression test for cache-poisoning fix.

Assisted-by: Claude (Anthropic, Claude Opus 4.8)
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
@hbraswelrh

Copy link
Copy Markdown
Contributor

@jpower432 would you like an early review on this PR?

@jpower432

Copy link
Copy Markdown
Contributor Author

@jpower432 would you like an early review on this PR?

Yes please @hbraswelrh! Let it in draft while I do something testing, but a review would be great.

id: FINOS-CCC
type: ControlCatalog
gemara-version: "1.0"
gemara-version: "1.1.0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jpower432 thoughts on using the migration assistant to upgrade to v1.5.0? A bulk update may be necessary with the test-data in gemaraproj/gemara see good-ccc.yaml example.

Comment thread internal/server/about.md
@@ -0,0 +1,224 @@
# Gemara

> GRC Engineering Model for Automated Risk Assessment. Gemara provides a logical model describing categories of compliance activities, how they interact, and schemas enabling automated interoperability between GRC tools. Part of the OpenSSF ecosystem.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we include that the Gemara project is governed by the ORBIT Working Group?

Comment thread internal/server/mode.go
lexiconPathSuffix = "/docs/lexicon.yaml"
)

// gemaraPreamble is a static overview prepended to every mode's instructions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is incredible! I tested using Claude Opus 4.8 and it worked extremely well on the first run using the MCP server.

@hbraswelrh hbraswelrh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jpower432 Left a couple non-blocking comments, but tested with the MCP Server using Claude Opus 4.8. The results were very concise and the output was highly readable. This is a great resource and allows the MCP Server to evolve with consistency over time.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The MCP server should ship with (or be able to download) an LLM-optimzed form of the web guidance

2 participants