Skip to content

Commit 1205d92

Browse files
authored
Merge pull request #62 from G-Core/fix/plugin-migration
Fix/plugin migration
2 parents fd15633 + 59df2ad commit 1205d92

3 files changed

Lines changed: 93 additions & 14 deletions

File tree

context/CONTEXT_INDEX.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ Contract directory consumed by the fastedge-plugin sync pipeline. Contains `mani
6767
| `fastedge-plugin-source/.generation-config.md` | Generation instructions for each docs/ file (Global Rules, per-file specs) |
6868
| `fastedge-plugin-source/generate-docs.sh` | Tiered parallel generation script |
6969

70+
### Plugin Integration (read when modifying manifest or examples)
71+
72+
| Document | Lines | Purpose |
73+
|----------|-------|---------|
74+
| `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/`. |
75+
7076
### External (not in context/)
7177

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

131138
### Understanding the System (New to Codebase)
132139
1. Read `PROJECT_OVERVIEW.md` (~149 lines)

context/PLUGIN_CONTRACT.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Plugin Source Contract — Naming Conventions
2+
3+
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.
4+
5+
## Reference File Structure
6+
7+
Reference files in the plugin repo are organized by app_type:
8+
9+
```
10+
plugins/gcore-fastedge/skills/
11+
scaffold/reference/
12+
http/ # HTTP app blueprints
13+
base-rust.md # Base skeleton
14+
kv-store-rust.md # Feature blueprint
15+
cdn/ # CDN app blueprints
16+
base-rust.md # Base skeleton
17+
body-rust.md # Feature blueprint
18+
fastedge-docs/reference/
19+
http/ # HTTP app example patterns
20+
examples-kv-store-rust.md
21+
cdn/ # CDN app example patterns
22+
examples-body-rust.md
23+
sdk-reference-rust.md # Cross-cutting (no subfolder)
24+
host-services-rust.md # Cross-cutting (no subfolder)
25+
cdn-apps-rust.md # Cross-cutting app-type guide (no subfolder)
26+
```
27+
28+
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.
29+
30+
## File Naming Convention
31+
32+
**`{concept}-{lang}.md`** — concept first, language last. The subfolder provides the app_type context.
33+
34+
| Type | Pattern | Example |
35+
|---|---|---|
36+
| Base skeleton | `{appType}/base-{lang}.md` | `http/base-rust.md`, `cdn/base-rust.md` |
37+
| Feature blueprint | `{appType}/{concept}-{lang}.md` | `cdn/body-rust.md` |
38+
| Docs pattern | `{appType}/examples-{concept}-{lang}.md` | `cdn/examples-body-rust.md` |
39+
| Cross-cutting SDK ref | `sdk-reference-{lang}.md` | `sdk-reference-rust.md` |
40+
| Cross-cutting host services | `host-services-{lang}.md` | `host-services-rust.md` |
41+
| Cross-cutting app-type guide | `{appType}-apps-{lang}.md` | `cdn-apps-rust.md` |
42+
43+
## Manifest target_mapping Rules
44+
45+
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
46+
2. **section** should be `null` for all entries (each file is owned by one repo — no splicing)
47+
3. **Dual-intent pattern**: each **feature** example gets two entries with the same `files` array:
48+
- `{name}-blueprint``scaffold/reference/{appType}/{concept}-{lang}.md`
49+
- `{name}-pattern``fastedge-docs/reference/{appType}/examples-{concept}-{lang}.md`
50+
51+
**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.
52+
53+
## Intent File Matching
54+
55+
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.
56+
57+
Example:
58+
- `reference_file`: `plugins/.../scaffold/reference/cdn/body-rust.md`
59+
- Path suffix: `cdn/body-rust.md`
60+
- Intent lookup: `agent-intent-skills/fastedge-sdk-rust/cdn/body-rust.md`
61+
62+
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.
63+
64+
## When Adding New Examples
65+
66+
1. Add source entries (paired `-blueprint` and `-pattern` for feature examples; `-blueprint` only for base skeletons) to `manifest.json`
67+
2. Add target_mapping entries pointing to `{appType}/{concept}-{lang}.md` paths
68+
3. Request intent files be created in `fastedge-plugin` repo (or create via PR):
69+
- `agent-intent-skills/fastedge-sdk-rust/{appType}/{concept}-{lang}.md` (scaffold)
70+
- `agent-intent-skills/fastedge-sdk-rust/{appType}/examples-{concept}-{lang}.md` (docs)
71+
- Each should reference `../_scaffold-blueprint-base.md` or `../_docs-pattern-base.md`
72+
4. Create placeholder reference files at the target paths in the plugin repo

fastedge-plugin-source/manifest.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,61 +107,61 @@
107107
},
108108
"target_mapping": {
109109
"sdk-api": {
110-
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/sdk-reference.md",
111-
"section": "Rust SDK"
110+
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/sdk-reference-rust.md",
111+
"section": null
112112
},
113113
"host-services": {
114-
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/sdk-reference.md",
115-
"section": "Rust SDK"
114+
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/host-services-rust.md",
115+
"section": null
116116
},
117117
"cdn-apps": {
118118
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/cdn-apps-rust.md",
119119
"section": null
120120
},
121121

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

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

132132
"cdn-body-blueprint": {
133-
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/cdn-rust-body.md",
133+
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/cdn/body-rust.md",
134134
"section": null
135135
},
136136
"cdn-body-pattern": {
137-
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/examples-rust-body.md",
137+
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/cdn/examples-body-rust.md",
138138
"section": null
139139
},
140140

141141
"http-key-value-blueprint": {
142-
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/http-rust-kv-store.md",
142+
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/http/kv-store-rust.md",
143143
"section": null
144144
},
145145
"http-key-value-pattern": {
146-
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/examples-rust-kv-store.md",
146+
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/http/examples-kv-store-rust.md",
147147
"section": null
148148
},
149149

150150
"cdn-jwt-blueprint": {
151-
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/cdn-rust-auth-jwt.md",
151+
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/cdn/auth-jwt-rust.md",
152152
"section": null
153153
},
154154
"cdn-jwt-pattern": {
155-
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/examples-rust-auth-jwt.md",
155+
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/cdn/examples-auth-jwt-rust.md",
156156
"section": null
157157
},
158158

159159
"cdn-geoblock-blueprint": {
160-
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/cdn-rust-geoblock.md",
160+
"reference_file": "plugins/gcore-fastedge/skills/scaffold/reference/cdn/geoblock-rust.md",
161161
"section": null
162162
},
163163
"cdn-geoblock-pattern": {
164-
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/examples-rust-geoblock.md",
164+
"reference_file": "plugins/gcore-fastedge/skills/fastedge-docs/reference/cdn/examples-geoblock-rust.md",
165165
"section": null
166166
}
167167
},

0 commit comments

Comments
 (0)