Skip to content

Compress non-deploy Copilot on Rails agent instructions - #1892

Merged
Nathan (nturinski) merged 2 commits into
mainfrom
nturinski-agent-instruction-compression
Sep 23, 2026
Merged

Nathan (nturinski) merged 2 commits into
mainfrom
nturinski-agent-instruction-compression

Conversation

@nturinski

@nturinski Nathan (nturinski) commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Summary

  • compress prose across 60 non-deploy Copilot on Rails agent/reference Markdown files
  • preserve headings, frontmatter, code blocks, inline code, paths, commands, links, tables, and behavioral requirements
  • leave azure-deploy.agent.md and the entire azure-deploy/** tree byte-identical to main
  • refresh the verified agent-asset drift baseline

The remaining files shrink from 756,445 bytes to 689,849 bytes (8.80%). No UI or documented user flow changes; no screenshots need refreshing.

Why deploy instructions are excluded

The broader experiment initially compressed all 137 files. It showed strong aggregate local efficiency, but deployment follow-up exposed operational uncertainty: the compressed orders and media samples were slower and compressed media had artifact-reporting/authentication defects. The deploy router and every prerequisite/prepare/scaffold/deploy reference are therefore restored to main and are not part of this PR.

Clean deployment rerun

Four projects were reconstructed to their exact pre-deployment state, assigned immutable agent packs, and deployed to fresh retained Azure groups. Original arms used current main; compressed arms used commit f44ed6ba. Deploy instruction diff between packs: 0 files.

Scenario First deployment gap Clean rerun active time Clean rerun gap
Orders compressed +22.8% original 266.6m / compressed 273.7m compressed +2.7%
Media compressed +220.4% original 53.8m / compressed 59.5m compressed +10.6%

Both orders targets passed full dashboard/API/PostgreSQL/queue/worker/idempotency verification. Both media targets passed provisioning, frontend, health, CORS, identity/RBAC, keyless security, scope, and retention checks; compressed media also completed authenticated 100 MiB Blob upload and Cosmos CRUD, while original media's protected flows were correctly blocked without an interactive Entra principal. Every clean rerun used zero-delete what-if, retained all infrastructure, and recorded zero out-of-scope mutations.

The large first-run deployment gaps did not reproduce after deploy compression was removed. Absolute timing still contains different Azure/tooling outliers, so this is safety evidence—not a claim of statistical speed equivalence.

Validation

  • Caveman structural validator: 60/60 passed, no validation errors
  • deploy instruction diff from main: 0 files
  • agent drift: 21/21 contracts intact; baseline refreshed
  • eval typecheck: passed
  • import scanner self-test: 17/17 passed
  • grader certification: 164/164 passed
  • stack checks: 36 rules proven by 37 fixtures
  • assertion gates: 144 assertions across 49 stimuli
  • phase reachability, seed contract, eval-spec lint, and clean-machine checks: passed
  • GitHub build/lint/package/tests/contracts/API extraction: passed

Evidence limitations

  • paid project generation used the earlier 137-file compressed pack, not this narrowed 60-file revision
  • clean reruns tested deployment only from already-generated artifacts
  • the orders planning/scaffold/integrate/debug slowdown has not been rerun against the exact narrowed revision
  • remote MSBench runs failed before model execution, and the PR model-eval job was skipped
  • one generated implementation was measured per arm/scenario

Recommendation

Mergeable from a correctness/safety perspective after required human approval. Do not claim the narrowed revision is statistically proven faster until a full orders create-pipeline rerun is performed against this exact revision.

Copilot AI lite review requested due to automatic review settings September 21, 2026 17:55
@nturinski
Nathan (nturinski) requested a review from a team as a code owner September 21, 2026 17:55

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Several edited references keep .github/agents/... link targets that don’t resolve within this repo’s resources/agents/... tree, resulting in broken in-repo cross-references.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 4 Low severity

Open (4)
What changed in this PR

This PR reduces token/byte footprint of Copilot on Rails agent/reference Markdown content by compressing prose while aiming to preserve headings, code blocks, commands/paths, links, tables, and behavioral requirements, and updates the agent-asset drift baseline accordingly.

Changes:

  • Compressed/rewrote prose across a large set of Copilot on Rails agent and reference Markdown files without intended behavior changes.
  • Reconciled the compressed pack with current main guidance (including security/workflow wording updates).
  • Refreshed the verified agent-asset drift baseline (per PR description).
File Description
resources/​agents/​shared-references/​seed-data.md Compressed guidance around migrations/seed data and fixture/test patterns.
resources/​agents/​shared-references/​runtimes/​python.md Condensed Python runtime notes and package-purpose tables.
resources/​agents/​shared-references/​frontend-patterns.md Compressed frontend architecture rules and patterns wording.
resources/​agents/​shared-references/​examples/​service-abstraction-examples.md Shortened intro and clarified example notes.
resources/​agents/​shared-references/​error-handling.md Compressed standardized error-handling guidance and cross-links.
resources/​agents/​shared-references/​database-integrity.md Condensed DB constraints/transactions/index rules and examples.
resources/​agents/​azure-project-scaffold/​references/​sub-agent-strategy.md Shortened backend scaffold sub-agent parallelization description.
resources/​agents/​azure-project-integrate/​references/​smoke-test.md Compressed Step 2 smoke test instructions and PASS/FAIL tables.
resources/​agents/​azure-project-integrate/​references/​migrations.md Condensed “schema-only” migration rules and checkpoints.
resources/​agents/​azure-project-integrate/​references/​end-to-end.md Shortened end-to-end wiring verification procedure.
resources/​agents/​azure-deploy/​scaffold/​references/​waf-checklist.md Compressed WAF checklist phrasing while keeping per-pillar checks.
resources/​agents/​azure-deploy/​scaffold/​references/​terraform-patterns.md Condensed Terraform layout/provider/state/tagging/security rules.
resources/​agents/​azure-deploy/​scaffold/​references/​subagent-review.md Compressed subagent security/adversarial review workflow text.
resources/​agents/​azure-deploy/​scaffold/​references/​self-review-procedure.md Condensed Step 9 self-review workflow and prompt template.
resources/​agents/​azure-deploy/​scaffold/​references/​self-healing.md Shortened self-healing loop description and error table wording.
resources/​agents/​azure-deploy/​scaffold/​references/​scaffold-healing-rules.md Condensed scaffold healing escalation/plan-level-change rules.
resources/​agents/​azure-deploy/​scaffold/​references/​rbac-roles.md Compressed RBAC role guidance and delegation handoff description.
resources/​agents/​azure-deploy/​scaffold/​references/​mcp-tools.md Condensed scaffold-phase MCP tool reference text.
resources/​agents/​azure-deploy/​scaffold/​references/​error-handling.md Compressed scaffold error/remediation table rows.
resources/​agents/​azure-deploy/​scaffold/​references/​env-var-secrets.md Condensed env-var derivation rules and validation bullets.
resources/​agents/​azure-deploy/​scaffold/​references/​dockerfile-generation.md Shortened Dockerfile guidance including BuildKit/ACR constraints.
resources/​agents/​azure-deploy/​scaffold/​references/​cicd-pipelines.md Condensed CI/CD deferral guidance and MCP call parameters.
resources/​agents/​azure-deploy/​scaffold/​references/​bicep-swa.md Compressed SWA Bicep patterns, including CORS requirement.
resources/​agents/​azure-deploy/​scaffold/​references/​bicep-patterns.md Condensed core Bicep scaffold structure/naming constraints.
resources/​agents/​azure-deploy/​scaffold/​references/​bicep-patterns-security.md Shortened mandatory security defaults and no-KeyVault rules.
resources/​agents/​azure-deploy/​scaffold/​references/​bicep-patterns-data.md Compressed data-module pointers and context.
resources/​agents/​azure-deploy/​scaffold/​references/​bicep-container-apps.md Condensed Container Apps two-phase wiring and pitfalls.
resources/​agents/​azure-deploy/​scaffold/​references/​bicep-app-service.md Compressed App Service patterns and native-module deploy rules.
resources/​agents/​azure-deploy/​references/​subscription-resolution.md Condensed defensive subscription resolution fallback sequence.
resources/​agents/​azure-deploy/​references/​pipeline-rules-runtime.md Compressed known platform bugs/timing notes.
resources/​agents/​azure-deploy/​references/​mcp-tool-reference.md Condensed shared MCP tool index and global parameter guidance.
resources/​agents/​azure-deploy/​references/​intent-gathering.md Compressed intent gathering/scope triage guidance.
resources/​agents/​azure-deploy/​references/​iac-resources.md Condensed official doc links and troubleshooting workflow.
resources/​agents/​azure-deploy/​references/​handoff-protocol.md Compressed Step 9 handoff requirements and ordering.
resources/​agents/​azure-deploy/​references/​azd-template-routing.md Condensed azd detection + routing gate behavior.
resources/​agents/​azure-deploy/​references/​approval-gates.md Shortened scaffold/deploy approval gate contract wording.
resources/​agents/​azure-deploy/​prereq/​references/​zero-code-path.md Condensed empty-workspace prereq workflow and consent gates.
resources/​agents/​azure-deploy/​prereq/​references/​subscription-resolution.md Compressed prereq-phase subscription resolution fallback.
resources/​agents/​azure-deploy/​prereq/​references/​subagent-starter-scaffold.md Condensed starter scaffold subagent rules and output contract.
resources/​agents/​azure-deploy/​prereq/​references/​remediation-protocol.md Compressed remediation loop scope and consent gate wording.
resources/​agents/​azure-deploy/​prereq/​references/​prereq-artifacts.md Condensed prereq artifact write requirements and schemas.
resources/​agents/​azure-deploy/​prereq/​references/​deployability-check.md Compressed deployability check steps and routing notes.
resources/​agents/​azure-deploy/​prereq/​references/​component-mapping.md Condensed component mapping + existing infra detection steps.
resources/​agents/​azure-deploy/​prereq/​references/​completeness-check.md Compressed completeness checklist and severity guidance.
resources/​agents/​azure-deploy/​prereq/​references/​cloud-sdk-migration.md Condensed cloud-SDK classification and observability carve-out.
resources/​agents/​azure-deploy/​prepare/​references/​validation-rubric.md Compressed prepare validation rubric and pass criteria.
resources/​agents/​azure-deploy/​prepare/​references/​subagent-quota.md Condensed quota subagent rules, inputs/outputs, anti-patterns.
resources/​agents/​azure-deploy/​prepare/​references/​subagent-pricing.md Condensed cost estimation subagent description/token budget.
resources/​agents/​azure-deploy/​prepare/​references/​sku-quota-validation.md Compressed quota validation procedure and region selection rules.
resources/​agents/​azure-deploy/​prepare/​references/​sku-matrix.md Condensed SKU selection guidance and fast-track defaults.
resources/​agents/​azure-deploy/​prepare/​references/​pricing-guide.md Compressed pricing self-check and multiplier/troubleshooting rules.
resources/​agents/​azure-deploy/​deploy/​references/​subagent-preflight.md Condensed deploy preflight subagent procedure and checklist output.
resources/​agents/​azure-deploy/​deploy/​references/​preflight-checks.md Compressed deploy preflight checks and mandatory what-if guidance.
resources/​agents/​azure-deploy/​deploy/​references/​portal-links.md Condensed portal link generation and chat output constraints.
resources/​agents/​azure-deploy/​deploy/​references/​mcp-tools.md Compressed deploy-phase MCP tool contract and classification notes.
resources/​agents/​azure-deploy/​deploy/​references/​health-check-patterns.md Compressed health-check heuristics and placeholder detection.
resources/​agents/​azure-deploy/​deploy/​references/​error-classification.md Condensed deploy error classification and healing rules.
resources/​agents/​azure-deploy/​deploy/​references/​deploy-checklist-template.md Compressed compaction-safe checklist template guidance.
resources/​agents/​azure-deploy/​deploy/​references/​code-deployment-swa.md Condensed SWA CLI deploy and build pre-check instructions.
resources/​agents/​azure-deploy/​deploy/​references/​code-deployment-appservice.md Condensed App Service code deploy rules and zipdeploy guidance.
resources/​agents/​azure-deploy/​deploy/​references/​approval-gate-template.md Condensed deploy approval gate formatting and rules.
resources/​agents/​azure-deploy/​deploy/​instructions.md Compressed deploy agent workflow constraints and inventory contract.
resources/​agents/​azure-debug-plan/​references/​runtimes.md Condensed runtime detection notes and derived-field rules.
resources/​agents/​azure-debug-plan/​references/​project-types.md Condensed project type detection and Functions dependency notes.
resources/​agents/​azure-debug-plan/​references/​plan-template.md Condensed debug plan template and table-integrity requirements.
resources/​agents/​azure-debug-plan/​references/​multi-service.md Compressed multi-service orchestration and dedup rules.
resources/​agents/​azure-debug-plan/​references/​migrations.md Condensed migration-tool detection steps and synthesis guidance.
resources/​agents/​azure-debug-plan/​references/​inventory.md Compressed inventory scan rules and autopilot prerequisite reuse.
resources/​agents/​azure-debug-plan/​references/​classify.md Compressed classification procedure and service-root exclusions.
resources/​agents/​azure-debug-generate/​references/​runtimes/​dotnet.md Condensed .NET debug/runtime wiring notes and processName rules.
resources/​agents/​azure-debug-generate/​references/​project-types/​frontend-spa/​debug-adapters/​chromium.md Condensed Chromium adapter rules and troubleshooting guidance.
resources/​agents/​azure-debug-generate/​references/​project-types/​frontend-spa/​debug-adapters/​blazorwasm.md Condensed planned Blazor WASM adapter notes.
resources/​agents/​azure-debug-generate/​references/​project-types/​frontend-spa/​debug-adapters/​_template.md Condensed adapter template guidance.
resources/​agents/​azure-debug-generate/​references/​preflight.md Compressed generation preflight checks and user-confirmed cleanup rules.
resources/​agents/​azure-debug-generate/​references/​migrations.md Condensed migration-service generation patterns and resolution steps.
resources/​agents/​azure-debug-generate/​references/​limited-support.md Condensed limited-support detection/emission protocol.
resources/​agents/​azure-debug-generate/​references/​emulators/​postgres.md Condensed Postgres emulator guidance and secret-handling cautions.
resources/​agents/​azure-debug-generate/​references/​emulators/​azurite.md Condensed Azurite notes and consolidation/runtime caveats.
resources/​agents/​azure-debug-generate/​references/​emulators/​_template.md Condensed emulator template guidance.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread resources/agents/shared-references/error-handling.md
Comment thread resources/agents/shared-references/frontend-patterns.md
Comment thread resources/agents/shared-references/seed-data.md
@nturinski Nathan (nturinski) changed the title Compress Copilot on Rails agent instructions Compress non-deploy Copilot on Rails agent instructions Sep 22, 2026
Nathan (nturinski) and others added 2 commits September 22, 2026 16:39
Reduce repeated agent-context prose while preserving structural and behavioral contracts. Refresh the validated agent asset baseline.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Restore the deploy router and all deploy references to main after deployment testing exposed timing and reporting risk. Refresh the validated agent asset baseline.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@nturinski
Nathan (nturinski) force-pushed the nturinski-agent-instruction-compression branch from f0388cf to 90e65bd Compare September 22, 2026 23:39
@nturinski
Nathan (nturinski) merged commit 9e2b6e0 into main Sep 23, 2026
6 checks passed
@nturinski
Nathan (nturinski) deleted the nturinski-agent-instruction-compression branch September 23, 2026 22:28
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.

3 participants