Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 1, 2026

Update Go frontmatter hash to match JavaScript text-based implementation

Problem: Go uses YAML-parsed structured data for hashing, JavaScript uses text-based approach (no YAML parsing). They produce different hashes.

Solution: Update Go implementation to match JavaScript's text-based approach.

Summary

Successfully updated the Go frontmatter hash implementation to use a text-based approach matching the JavaScript implementation. All tests now pass with cross-language consistency.

Changes Made

  1. Go Implementation (pkg/parser/frontmatter_hash.go):

    • Added text-based frontmatter extraction functions
    • Implemented text normalization (trim whitespace, normalize line endings)
    • Added import processing without YAML parsing
    • Updated canonical structure to match JavaScript (frontmatter-text, imports, imported-frontmatters, template-expressions, versions)
  2. JavaScript Version Update (actions/setup/js/frontmatter_hash_pure.cjs):

    • Updated version constants to match Go (v0.0.86 for agents/gateway)
  3. Test Updates:

    • Updated key ordering test to reflect text-based behavior (different orderings produce different hashes)
    • All cross-language consistency tests pass
  4. Workflow Recompilation:

    • Recompiled all 148 workflows with new hash algorithm
    • All repository workflow hashes verified

Completed

  • Update Go to text-based approach
  • Update JavaScript version constants
  • Update tests for text-based behavior
  • Recompile all workflows
  • Revert unrelated Serena tool changes
  • Merge main branch (multiple times)
  • Recompile after each merge

All tasks completed successfully!

Original prompt

Update Go front matter hash consistency algorithm to match javascript implementation. Use test suite to validate.

Use simple text based approach as JavaScript does not have a yaml parser.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits February 1, 2026 12:38
…ript

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review February 1, 2026 12:50
@pelikhan
Copy link
Contributor

pelikhan commented Feb 1, 2026

@copilot revert Serena tool changes, merge main and recompile

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Go front matter hash consistency algorithm Align Go frontmatter hash with JavaScript text-based implementation Feb 1, 2026
Copilot AI requested a review from pelikhan February 1, 2026 12:54
Copilot AI and others added 3 commits February 1, 2026 12:59
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 1, 2026

@copilot revert Serena tool changes, merge main and recompile

Done! Changes:

The merge from main included project safe output handler unification changes, which affected smoke-project.lock.yml.

@pelikhan
Copy link
Contributor

pelikhan commented Feb 1, 2026

@copilot merge main and recompile

Copilot AI and others added 2 commits February 1, 2026 13:10
…h-consistency

# Conflicts:
#	.github/workflows/smoke-copilot.lock.yml
#	.github/workflows/smoke-project.lock.yml
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 1, 2026

@copilot merge main and recompile

Done! Changes:

  • Merged main branch (984d77a) - resolved conflicts in lock files
  • Recompiled workflows (57a3e71)

The merge included updated safe output project handler and Serena tool documentation changes. Recompiled 5 affected lock files.

Copilot AI requested a review from pelikhan February 1, 2026 13:11
@pelikhan pelikhan merged commit bc19e9f into main Feb 1, 2026
84 checks passed
@pelikhan pelikhan deleted the copilot/update-go-hash-consistency branch February 1, 2026 13:15
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.

2 participants