{"id":22901058,"url":"https://github.com/mpdn/debug-tag","last_synced_at":"2025-08-25T17:08:19.907Z","repository":{"id":57617078,"uuid":"248576949","full_name":"mpdn/debug-tag","owner":"mpdn","description":"Debug-only tagging for tracking values","archived":false,"fork":false,"pushed_at":"2020-03-19T18:51:40.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-05T12:11:41.554Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpdn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-19T18:31:10.000Z","updated_at":"2020-03-19T18:51:59.000Z","dependencies_parsed_at":"2022-08-29T05:31:44.756Z","dependency_job_id":null,"html_url":"https://github.com/mpdn/debug-tag","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mpdn/debug-tag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpdn%2Fdebug-tag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpdn%2Fdebug-tag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpdn%2Fdebug-tag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpdn%2Fdebug-tag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpdn","download_url":"https://codeload.github.com/mpdn/debug-tag/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpdn%2Fdebug-tag/sbom","scorecard":{"id":662695,"data":{"date":"2025-08-11","repo":{"name":"github.com/mpdn/debug-tag","commit":"16bf2b2848d1176a297a44bc942d535d6e1441d6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/4 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rust.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/mpdn/debug-tag/rust.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/rust.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-21T16:41:28.014Z","repository_id":57617078,"created_at":"2025-08-21T16:41:28.014Z","updated_at":"2025-08-21T16:41:28.014Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272100683,"owners_count":24873442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-14T01:31:29.175Z","updated_at":"2025-08-25T17:08:19.877Z","avatar_url":"https://github.com/mpdn.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# debug-tag\n\nA library for creating debug-only tags to track and check where values are used.\n\nUseful for asserting that two values stem from the same origin. For example, an operation on two\nnodes may only be valid if the nodes are in the same graph. `DebugTag` can be used to check for\nthis in tests and when debugging.\n\nSee the `DebugTag` type for more details.\n\n## Motivation\n\nWhen developing Rust, we often use *indices* to refer to other values instead of using\n*pointers*. Using indices allows us to \"point\" to a value without borrowing it and can basically\nbe seen as bypassing the borrow checker in a restricted way.\n\nOne of the issues of using indicies, is that it is not connected at compile time to the\ncontainer storing the value. An index used with an incorrect container might panic, or worse,\nreturn garbage values.\n\nWe need a way to \"tag\" values such that we can determine if an index is used with the correct\ncontainer.\n\n## Example\n\n```rust\nuse debug_tag::DebugTag;\n\n/// An example vec-like structure that allows pushing values and getting values by index.\n#[derive(Default)]\nstruct Slab\u003cT\u003e{\n    items: Vec\u003cT\u003e,\n    tag: DebugTag,\n}\n\n/// An index into a value on a slab.\n#[derive(Copy, Clone)]\nstruct Index {\n    index: usize,\n    tag: DebugTag,\n}\n\nimpl\u003cT\u003e Slab\u003cT\u003e {\n    /// Pushes a new value onto the slab.\n    fn push(\u0026mut self, item: T) -\u003e Index {\n        let index = self.items.len();\n        self.items.push(item);\n        Index {\n            index,\n            tag: self.tag\n        }\n    }\n\n    /// Gets a value in this `Slab`. If the index is not from this slab, either panics or\n    /// returns an arbitrary value.\n    fn get(\u0026self, index: Index) -\u003e \u0026T {\n        assert_eq!(self.tag, index.tag, \"Index must stem from this slab\");\n        \u0026self.items[index.index]\n    }\n}\n\nlet mut slab_a = Slab::default();\nlet ix = slab_a.push(42);\n\nassert_eq!(slab_a.get(ix), \u002642);\n\nlet mut slab_b = Slab::default();\nslab_b.push(1337);\n\n// Panics due to the tags being checked:\n//   assert_eq!(slab_b.get(ix), \u00261337);\n```\n\nWithout `DebugTag`s, the last line above would just return 1337 - a \"garbage value\" since `ix`\nstems from a different `Slab`.\n\nLicense: MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpdn%2Fdebug-tag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpdn%2Fdebug-tag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpdn%2Fdebug-tag/lists"}