Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions context/CONTEXT_INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ Contract directory consumed by the fastedge-plugin sync pipeline. Contains `mani
| `fastedge-plugin-source/.generation-config.md` | Generation instructions for each docs/ file (Global Rules, per-file specs) |
| `fastedge-plugin-source/generate-docs.sh` | Tiered parallel generation script |

### Plugin Integration (read when modifying manifest or examples)

| Document | Lines | Purpose |
|----------|-------|---------|
| `PLUGIN_CONTRACT.md` | ~70 | Naming conventions, manifest rules, intent file matching for the fastedge-plugin sync pipeline. Read when adding examples to `manifest.json` or changing `fastedge-plugin-source/`. |

### External (not in context/)

| Resource | Location | Purpose |
Expand Down Expand Up @@ -127,6 +133,7 @@ Contract directory consumed by the fastedge-plugin sync pipeline. Contains `mani
4. Read `PROJECT_OVERVIEW.md` (examples section)
5. Read `development/BUILD_AND_CI.md` (example build pattern)
6. **Logging:** Use `println!` only — `eprintln!` output is lost on the platform
7. **Plugin sync**: If this example should feed into fastedge-plugin, read `context/PLUGIN_CONTRACT.md` for manifest and naming conventions

### Understanding the System (New to Codebase)
1. Read `PROJECT_OVERVIEW.md` (~149 lines)
Expand Down
72 changes: 72 additions & 0 deletions context/PLUGIN_CONTRACT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Plugin Source Contract — Naming Conventions

This document describes the naming and structure conventions for `manifest.json` in this repo. These rules ensure the sync-reference-docs pipeline correctly maps source files to plugin reference docs and intent skills.

## Reference File Structure

Reference files in the plugin repo are organized by app_type:

```
plugins/gcore-fastedge/skills/
scaffold/reference/
http/ # HTTP app blueprints
base-rust.md # Base skeleton
kv-store-rust.md # Feature blueprint
cdn/ # CDN app blueprints
base-rust.md # Base skeleton
body-rust.md # Feature blueprint
fastedge-docs/reference/
http/ # HTTP app example patterns
examples-kv-store-rust.md
cdn/ # CDN app example patterns
examples-body-rust.md
sdk-reference-rust.md # Cross-cutting (no subfolder)
host-services-rust.md # Cross-cutting (no subfolder)
cdn-apps-rust.md # Cross-cutting app-type guide (no subfolder)
```
Comment thread
godronus marked this conversation as resolved.

Note: `http/base-rust.md` and `cdn/base-rust.md` have the same filename but live in different subfolders. The pipeline's path-based intent matching resolves them to different intent files.

## File Naming Convention

**`{concept}-{lang}.md`** — concept first, language last. The subfolder provides the app_type context.

| Type | Pattern | Example |
|---|---|---|
| Base skeleton | `{appType}/base-{lang}.md` | `http/base-rust.md`, `cdn/base-rust.md` |
| Feature blueprint | `{appType}/{concept}-{lang}.md` | `cdn/body-rust.md` |
| Docs pattern | `{appType}/examples-{concept}-{lang}.md` | `cdn/examples-body-rust.md` |
| Cross-cutting SDK ref | `sdk-reference-{lang}.md` | `sdk-reference-rust.md` |
| Cross-cutting host services | `host-services-{lang}.md` | `host-services-rust.md` |
| Cross-cutting app-type guide | `{appType}-apps-{lang}.md` | `cdn-apps-rust.md` |

## Manifest target_mapping Rules

1. **reference_file** paths must include the `http/` or `cdn/` subfolder for per-example content (blueprints and patterns). Cross-cutting references (`sdk-reference`, `host-services`, `cdn-apps`) live directly under `fastedge-docs/reference/` with no subfolder
2. **section** should be `null` for all entries (each file is owned by one repo — no splicing)
3. **Dual-intent pattern**: each **feature** example gets two entries with the same `files` array:
- `{name}-blueprint` → `scaffold/reference/{appType}/{concept}-{lang}.md`
- `{name}-pattern` → `fastedge-docs/reference/{appType}/examples-{concept}-{lang}.md`

**Exception**: Base skeleton examples (`http-hello-world`, `cdn-hello-world`) only get a `-blueprint` entry pointing to `scaffold/reference/{appType}/base-{lang}.md`. They have no `-pattern` counterpart because they don't demonstrate a reusable feature pattern.

## Intent File Matching

The pipeline resolves intent files by extracting the path suffix after `reference/` from the `reference_file` path. It looks for that same relative path inside the plugin's intent directory for this repo.

Example:
- `reference_file`: `plugins/.../scaffold/reference/cdn/body-rust.md`
- Path suffix: `cdn/body-rust.md`
- Intent lookup: `agent-intent-skills/fastedge-sdk-rust/cdn/body-rust.md`

This is why `http/base-rust.md` and `cdn/base-rust.md` can coexist — they resolve to `agent-intent-skills/fastedge-sdk-rust/http/base-rust.md` and `agent-intent-skills/fastedge-sdk-rust/cdn/base-rust.md` respectively.

## When Adding New Examples

1. Add source entries (paired `-blueprint` and `-pattern` for feature examples; `-blueprint` only for base skeletons) to `manifest.json`
2. Add target_mapping entries pointing to `{appType}/{concept}-{lang}.md` paths
3. Request intent files be created in `fastedge-plugin` repo (or create via PR):
- `agent-intent-skills/fastedge-sdk-rust/{appType}/{concept}-{lang}.md` (scaffold)
- `agent-intent-skills/fastedge-sdk-rust/{appType}/examples-{concept}-{lang}.md` (docs)
- Each should reference `../_scaffold-blueprint-base.md` or `../_docs-pattern-base.md`
4. Create placeholder reference files at the target paths in the plugin repo
28 changes: 14 additions & 14 deletions fastedge-plugin-source/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,61 +107,61 @@
},
"target_mapping": {
"sdk-api": {
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/sdk-reference.md",
"section": "Rust SDK"
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/sdk-reference-rust.md",
"section": null
},
"host-services": {
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/sdk-reference.md",
"section": "Rust SDK"
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/host-services-rust.md",
"section": null
},
"cdn-apps": {
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/cdn-apps-rust.md",
"section": null
},
Comment thread
godronus marked this conversation as resolved.

"http-hello-world-blueprint": {
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/base-http-rust.md",
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/http/base-rust.md",
"section": null
},

"cdn-hello-world-blueprint": {
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/base-cdn-rust.md",
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/cdn/base-rust.md",
"section": null
},

"cdn-body-blueprint": {
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/cdn-rust-body.md",
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/cdn/body-rust.md",
"section": null
},
"cdn-body-pattern": {
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/examples-rust-body.md",
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/cdn/examples-body-rust.md",
"section": null
},

"http-key-value-blueprint": {
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/http-rust-kv-store.md",
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/http/kv-store-rust.md",
"section": null
},
"http-key-value-pattern": {
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/examples-rust-kv-store.md",
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/http/examples-kv-store-rust.md",
"section": null
},

"cdn-jwt-blueprint": {
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/cdn-rust-auth-jwt.md",
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/cdn/auth-jwt-rust.md",
"section": null
},
"cdn-jwt-pattern": {
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/examples-rust-auth-jwt.md",
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/cdn/examples-auth-jwt-rust.md",
"section": null
},

"cdn-geoblock-blueprint": {
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/cdn-rust-geoblock.md",
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/cdn/geoblock-rust.md",
"section": null
},
"cdn-geoblock-pattern": {
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/examples-rust-geoblock.md",
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/cdn/examples-geoblock-rust.md",
"section": null
}
},
Expand Down
Loading