-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Summary
Rewrite .github/copilot-instructions.md to be more concise and add guidance learned from #346 / #348 (Go-compatible JSON serialization fix).
This was originally part of PR #348 but was split out per reviewer feedback (one logical change per PR).
Motivation
The current instructions file (130 lines, ~8.7 KB) has:
- Verbose prose that can be compressed without losing signal
- Duplicate sections (Go→.NET table repeats translation rules from Spec & Lineage)
- Missing guidance for serialization (
OciJsonSerializeris now the required path) - Missing testing conventions discovered during fix: use Go-compatible JSON encoding for OCI manifests #348 (raw string JSON fixtures, round-trip testing, internal method parameter rules)
- Sections with low value for Copilot (
Copilot Prompt Hints,Non-Goals, trailing---footer)
Proposed Changes
Trim from ~130 to ~100 lines (−28%) with these specific edits:
Remove
- Go → .NET Guideline Quick Map table — duplicates bullets already in Spec & Lineage
- Copilot Prompt Hints section — low signal
- Non-Goals section — already implied by other rules
- Public API Change Gate — mostly duplicates PR Guidance + Coding Style
- Trailing
---footer line
Add
- Serialization section:
- All JSON must go through
OciJsonSerializer(OrasProject.Oras.Serialization) - No direct
JsonSerializercalls - Ensures Go-compatible encoding (
+not\u002B) - Serialization types are internal; domain types have no serialization logic
- All JSON must go through
- Testing additions:
- Raw string literals for JSON fixtures; wire format over object factories
- Round-trip: test serialize → deserialize and reverse through same path
- Coding Style additions:
Spaces not tabsreminder (editorconfig + CI super-linter enforces)No dead code— remove unreachable branches; verify with coverage- Name tuple elements in return types (e.g.,
(Descriptor Descriptor, byte[] Content)) - Line length: clarify URLs may exceed the 120 hard limit
Condense (same content, fewer words)
- Section headers shortened (e.g.,
Project Snapshot→Project) - Bullet points tightened throughout
- Go→C# translation rules nested under Spec & Lineage as sub-bullets
Review Notes
- The
Internal methods: no default parameters (including CancellationToken); prefer overloadsrule was flagged in fix: use Go-compatible JSON encoding for OCI manifests #348 review as potentially contradicting existing codebase patterns where internal methods do defaultCancellationToken. This should be discussed and resolved in the PR for this issue. - The proposed rewrite was tested as commit
4e6176fon branchagent/fix-plus-escaping-346before being reverted from fix: use Go-compatible JSON encoding for OCI manifests #348.
References
- PR fix: use Go-compatible JSON encoding for OCI manifests #348 (review thread requesting split): fix: use Go-compatible JSON encoding for OCI manifests #348
- Issue Packer.PackManifestAsync escapes '+' in media types as \\u002B #346 (original serialization bug): Packer.PackManifestAsync escapes '+' in media types as \\u002B #346
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels